diff --git a/lcl/forms.pp b/lcl/forms.pp index 4a0833c387..9ff7ac8796 100644 --- a/lcl/forms.pp +++ b/lcl/forms.pp @@ -1726,6 +1726,7 @@ var function GetParentForm(Control: TControl; TopForm: Boolean = True): TCustomForm; function GetFirstParentForm(Control:TControl): TCustomForm; +function ValidParentForm(Control: TControl; TopForm: Boolean = True): TCustomForm; function GetDesignerForm(APersistent: TPersistent): TCustomForm; function FindRootDesigner(APersistent: TPersistent): TIDesigner; @@ -1915,6 +1916,15 @@ begin Result := nil; end; +//------------------------------------------------------------------------------ +function ValidParentForm(Control: TControl; TopForm: Boolean): TCustomForm; +begin + Result := GetParentForm(Control, TopForm); + if Result = nil then + raise EInvalidOperation.CreateFmt(sParentRequired, [Control.Name]); +end; + + //------------------------------------------------------------------------------ function IsAccel(VK: word; const Str: string): Boolean; const diff --git a/lcl/languages/lclstrconsts.ca.po b/lcl/languages/lclstrconsts.ca.po index 72a5e48efa..ab4f1626ee 100644 --- a/lcl/languages/lclstrconsts.ca.po +++ b/lcl/languages/lclstrconsts.ca.po @@ -1488,6 +1488,10 @@ msgstr "No hi ha cap forma MDI present" msgid "No timers available" msgstr "No hi ha rellotges disponibles" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "" diff --git a/lcl/languages/lclstrconsts.cs.po b/lcl/languages/lclstrconsts.cs.po index ada7922906..4910ee59b6 100644 --- a/lcl/languages/lclstrconsts.cs.po +++ b/lcl/languages/lclstrconsts.cs.po @@ -1473,6 +1473,10 @@ msgstr "Nepřítomno žádné MDI okno." msgid "No timers available" msgstr "Nedostupné žádné časovače" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "Nesprávný typ symbolu: očekáváno %s" diff --git a/lcl/languages/lclstrconsts.de.po b/lcl/languages/lclstrconsts.de.po index fc51cc7ba9..1d24c8ddfe 100644 --- a/lcl/languages/lclstrconsts.de.po +++ b/lcl/languages/lclstrconsts.de.po @@ -1480,6 +1480,10 @@ msgstr "Kein MDI-Formular vorhanden" msgid "No timers available" msgstr "Keine Timer verfügbar" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "Falscher Token-Typ: %s erwartet" diff --git a/lcl/languages/lclstrconsts.es.po b/lcl/languages/lclstrconsts.es.po index f9c8b26df9..c681fa5306 100644 --- a/lcl/languages/lclstrconsts.es.po +++ b/lcl/languages/lclstrconsts.es.po @@ -1490,6 +1490,10 @@ msgstr "No hay un formulario MDI presente" msgid "No timers available" msgstr "No hay temporizadores disponibles" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "Tipo de token incorrecto: Se esperaba %s " diff --git a/lcl/languages/lclstrconsts.fi.po b/lcl/languages/lclstrconsts.fi.po index c0dc025505..a5fe488507 100644 --- a/lcl/languages/lclstrconsts.fi.po +++ b/lcl/languages/lclstrconsts.fi.po @@ -1447,6 +1447,10 @@ msgstr "" msgid "No timers available" msgstr "" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "" diff --git a/lcl/languages/lclstrconsts.fr.po b/lcl/languages/lclstrconsts.fr.po index 47aab7c58d..e2335fa17b 100644 --- a/lcl/languages/lclstrconsts.fr.po +++ b/lcl/languages/lclstrconsts.fr.po @@ -1470,6 +1470,10 @@ msgstr "Aucune fiche MDI présente" msgid "No timers available" msgstr "Aucun temporisateur disponible" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "Mauvais type d'identifieur: %s attendu" diff --git a/lcl/languages/lclstrconsts.he.po b/lcl/languages/lclstrconsts.he.po index 0fd9882afa..b861f37d30 100644 --- a/lcl/languages/lclstrconsts.he.po +++ b/lcl/languages/lclstrconsts.he.po @@ -1483,6 +1483,10 @@ msgstr "לא קיים טופס MDI " msgid "No timers available" msgstr "אין קוצב זמן זמין" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "סוג token שגוי: %s צפוי" diff --git a/lcl/languages/lclstrconsts.hu.po b/lcl/languages/lclstrconsts.hu.po index 5d7eaf1536..6b61205739 100644 --- a/lcl/languages/lclstrconsts.hu.po +++ b/lcl/languages/lclstrconsts.hu.po @@ -1468,6 +1468,10 @@ msgstr "Nincs MDI form." msgid "No timers available" msgstr "Nincsenek elérhető időzítők" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "Rossz vezérjel típus: %s az elvárt" diff --git a/lcl/languages/lclstrconsts.id.po b/lcl/languages/lclstrconsts.id.po index eec166e95c..d18299bf3e 100644 --- a/lcl/languages/lclstrconsts.id.po +++ b/lcl/languages/lclstrconsts.id.po @@ -1489,6 +1489,10 @@ msgstr "Tidak ada form MDI" msgid "No timers available" msgstr "Tidak tersedia timer" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "" diff --git a/lcl/languages/lclstrconsts.it.po b/lcl/languages/lclstrconsts.it.po index 61e451eb6c..2a1021874f 100644 --- a/lcl/languages/lclstrconsts.it.po +++ b/lcl/languages/lclstrconsts.it.po @@ -1470,6 +1470,10 @@ msgstr "Nessun form MDI presente." msgid "No timers available" msgstr "Nessun timer disponibile" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "Tipo token errato: era atteso %s" diff --git a/lcl/languages/lclstrconsts.ja.po b/lcl/languages/lclstrconsts.ja.po index 9197f728ef..9bb275c0bd 100644 --- a/lcl/languages/lclstrconsts.ja.po +++ b/lcl/languages/lclstrconsts.ja.po @@ -1478,6 +1478,10 @@ msgstr "MDI フォームが存在しません。" msgid "No timers available" msgstr "利用できるタイマーがありません" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "正しくないトークンタイプ:%sではありません" diff --git a/lcl/languages/lclstrconsts.lt.po b/lcl/languages/lclstrconsts.lt.po index 2bbfea27c2..d92bba5048 100644 --- a/lcl/languages/lclstrconsts.lt.po +++ b/lcl/languages/lclstrconsts.lt.po @@ -1488,6 +1488,10 @@ msgstr "MDI formos nėra." msgid "No timers available" msgstr "Nėra laikmačių" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "Klaidingas leksemos tipas: tikėtasi %s" diff --git a/lcl/languages/lclstrconsts.nl.po b/lcl/languages/lclstrconsts.nl.po index 96df880dc9..6b99e0ff5f 100644 --- a/lcl/languages/lclstrconsts.nl.po +++ b/lcl/languages/lclstrconsts.nl.po @@ -1489,6 +1489,10 @@ msgstr "Geen MDI formulier aanwezig" msgid "No timers available" msgstr "Geen timers beschikbaar" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "Verkeerd tokentype: %s verwacht" diff --git a/lcl/languages/lclstrconsts.no.po b/lcl/languages/lclstrconsts.no.po index 42d24a6949..76406663f3 100644 --- a/lcl/languages/lclstrconsts.no.po +++ b/lcl/languages/lclstrconsts.no.po @@ -1494,6 +1494,10 @@ msgstr "Ingen MDI-formular til rådighet." msgid "No timers available" msgstr "Ingen timere tilgjengelig" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "" diff --git a/lcl/languages/lclstrconsts.pl.po b/lcl/languages/lclstrconsts.pl.po index 894c86fff2..753929776e 100644 --- a/lcl/languages/lclstrconsts.pl.po +++ b/lcl/languages/lclstrconsts.pl.po @@ -1460,6 +1460,10 @@ msgstr "" msgid "No timers available" msgstr "Brak dostępnych timerów" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "" diff --git a/lcl/languages/lclstrconsts.po b/lcl/languages/lclstrconsts.po index 1f22040a50..597724ea0f 100644 --- a/lcl/languages/lclstrconsts.po +++ b/lcl/languages/lclstrconsts.po @@ -1441,6 +1441,10 @@ msgstr "" msgid "No timers available" msgstr "" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "" diff --git a/lcl/languages/lclstrconsts.pt_BR.po b/lcl/languages/lclstrconsts.pt_BR.po index d42dbadbad..4bfa8491ad 100644 --- a/lcl/languages/lclstrconsts.pt_BR.po +++ b/lcl/languages/lclstrconsts.pt_BR.po @@ -1485,6 +1485,10 @@ msgstr "Nenhum formulário MDI presente." msgid "No timers available" msgstr "Nenhum temporizador disponível" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "Tipo sílaba incorreta: %s esperado" diff --git a/lcl/languages/lclstrconsts.ru.po b/lcl/languages/lclstrconsts.ru.po index 3449dc68ae..074dc6f07f 100644 --- a/lcl/languages/lclstrconsts.ru.po +++ b/lcl/languages/lclstrconsts.ru.po @@ -1480,6 +1480,10 @@ msgstr "Отсутствует форма MDI." msgid "No timers available" msgstr "Таймеры недоступны" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "Неверный тип лексемы: ожидался %s" diff --git a/lcl/languages/lclstrconsts.sk.po b/lcl/languages/lclstrconsts.sk.po index ced380cbba..598a898aae 100644 --- a/lcl/languages/lclstrconsts.sk.po +++ b/lcl/languages/lclstrconsts.sk.po @@ -1489,6 +1489,10 @@ msgstr "Nie je MIDI formulár" msgid "No timers available" msgstr "Nie sú dostupné žiadne časovače" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "Zlý typ tokenu: očakávaný %s" diff --git a/lcl/languages/lclstrconsts.tr.po b/lcl/languages/lclstrconsts.tr.po index 6db103e0b7..0fb405cee1 100644 --- a/lcl/languages/lclstrconsts.tr.po +++ b/lcl/languages/lclstrconsts.tr.po @@ -1488,6 +1488,10 @@ msgstr "MDI Pencere mevcut değil." msgid "No timers available" msgstr "Kullanılabilir zamanlayıcı yok" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "" diff --git a/lcl/languages/lclstrconsts.uk.po b/lcl/languages/lclstrconsts.uk.po index 1abc8e6f39..42fde66ef0 100644 --- a/lcl/languages/lclstrconsts.uk.po +++ b/lcl/languages/lclstrconsts.uk.po @@ -1483,6 +1483,10 @@ msgstr "Немає MDI форми." msgid "No timers available" msgstr "Немає доступних таймерів" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "Невірний тип маркера: очікується %s" diff --git a/lcl/languages/lclstrconsts.zh_CN.po b/lcl/languages/lclstrconsts.zh_CN.po index 9a5abc9c8e..76373cfb85 100644 --- a/lcl/languages/lclstrconsts.zh_CN.po +++ b/lcl/languages/lclstrconsts.zh_CN.po @@ -1491,6 +1491,10 @@ msgstr "没有 MDI 窗体出现" msgid "No timers available" msgstr "无有效计时器" +#: lclstrconsts.sparentrequired +msgid "Control \"%s\" has no parent window" +msgstr "" + #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" msgstr "错误的标识符类型:期望 %s" diff --git a/lcl/lclstrconsts.pas b/lcl/lclstrconsts.pas index 3825d82028..995c91deea 100644 --- a/lcl/lclstrconsts.pas +++ b/lcl/lclstrconsts.pas @@ -217,6 +217,7 @@ resourceString sInvalidImageSize = 'Invalid image size'; sDuplicateMenus = 'Duplicate menus'; sCannotFocus = 'Cannot focus a disabled or invisible window'; + sParentRequired = 'Control "%s" has no parent window'; sInvalidCharSet = 'The char set in mask "%s" is not valid!'; SMaskEditNoMatch = 'The current text does not match the specified mask.';