mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 14:39:22 +02:00
lcl: forms: add GetParentDesignControl
git-svn-id: trunk@54433 -
This commit is contained in:
parent
5667c05f6c
commit
43f6f51029
13
lcl/forms.pp
13
lcl/forms.pp
@ -1801,6 +1801,7 @@ function GetFirstParentForm(Control:TControl): TCustomForm;
|
|||||||
function ValidParentForm(Control: TControl; TopForm: Boolean = True): TCustomForm;
|
function ValidParentForm(Control: TControl; TopForm: Boolean = True): TCustomForm;
|
||||||
function GetDesignerForm(APersistent: TPersistent): TCustomForm;
|
function GetDesignerForm(APersistent: TPersistent): TCustomForm;
|
||||||
function FindRootDesigner(APersistent: TPersistent): TIDesigner;
|
function FindRootDesigner(APersistent: TPersistent): TIDesigner;
|
||||||
|
function GetParentDesignControl(Control: TControl): TCustomDesignControl;
|
||||||
function NeedParentDesignControl(Control: TControl): TCustomDesignControl;
|
function NeedParentDesignControl(Control: TControl): TCustomDesignControl;
|
||||||
|
|
||||||
function IsAccel(VK: word; const Str: string): Boolean;
|
function IsAccel(VK: word; const Str: string): Boolean;
|
||||||
@ -2006,7 +2007,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
function NeedParentDesignControl(Control: TControl): TCustomDesignControl;
|
function GetParentDesignControl(Control: TControl): TCustomDesignControl;
|
||||||
var
|
var
|
||||||
SControl: TControl;
|
SControl: TControl;
|
||||||
begin
|
begin
|
||||||
@ -2017,7 +2018,15 @@ begin
|
|||||||
if Control is TCustomDesignControl then
|
if Control is TCustomDesignControl then
|
||||||
Result := TCustomDesignControl(Control)
|
Result := TCustomDesignControl(Control)
|
||||||
else
|
else
|
||||||
raise EInvalidOperation.CreateFmt(rsControlHasNoParentFormOrFrame, [SControl.Name]);
|
Result := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
function NeedParentDesignControl(Control: TControl): TCustomDesignControl;
|
||||||
|
begin
|
||||||
|
Result := GetParentDesignControl(Control);
|
||||||
|
if Result=nil then
|
||||||
|
raise EInvalidOperation.CreateFmt(rsControlHasNoParentFormOrFrame, [Control.Name]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user