mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-21 18:29:34 +01:00
MG: JITForms now sets csDesigning before creation
git-svn-id: trunk@3475 -
This commit is contained in:
parent
c766beac19
commit
c7ad8d7fd2
@ -135,18 +135,6 @@ type
|
||||
|
||||
implementation
|
||||
|
||||
type
|
||||
//----------------------------------------------------------------------------
|
||||
// TJITForm is a template TForm descendent class that can be altered at
|
||||
// runtime
|
||||
TJITForm = class (TForm)
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
end;
|
||||
|
||||
TJITFormClass = class of TJITForm;
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
var
|
||||
MyFindGlobalComponentProc:function(const AName:AnsiString):TComponent of object;
|
||||
|
||||
@ -155,12 +143,45 @@ begin
|
||||
Result:=MyFindGlobalComponentProc(AName);
|
||||
end;
|
||||
|
||||
type
|
||||
//----------------------------------------------------------------------------
|
||||
// TJITForm is a template TForm descendent class that can be altered at
|
||||
// runtime
|
||||
TJITForm = class (TForm)
|
||||
protected
|
||||
class function NewInstance : TObject; override;
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
end;
|
||||
|
||||
TJITFormClass = class of TJITForm;
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
// Define a dummy component to set the csDesigning flag which can not set by a
|
||||
// TForm, because SetDesigning is protected.
|
||||
type
|
||||
TSetDesigningComponent = class(TComponent)
|
||||
public
|
||||
class procedure SetDesigningOfControl(AComponent: TComponent; Value: Boolean);
|
||||
end;
|
||||
|
||||
procedure TSetDesigningComponent.SetDesigningOfControl(
|
||||
AComponent: TComponent; Value: Boolean);
|
||||
begin
|
||||
AComponent.SetDesigning(Value);
|
||||
end;
|
||||
|
||||
{ TJITForm }
|
||||
|
||||
constructor TJITForm.Create(AOwner: TComponent);
|
||||
function TJITForm.NewInstance: TObject;
|
||||
begin
|
||||
SetDesigning(true);
|
||||
inherited Create(AOwner);
|
||||
Result:=inherited NewInstance;
|
||||
TSetDesigningComponent.SetDesigningOfControl(TComponent(Result),true);
|
||||
end;
|
||||
|
||||
constructor TJITForm.Create(TheOwner: TComponent);
|
||||
begin
|
||||
inherited Create(TheOwner);
|
||||
end;
|
||||
|
||||
{ TJITForms }
|
||||
@ -369,6 +390,7 @@ begin
|
||||
writeln('[TJITForms.AddJITFormFromStream] 4');
|
||||
{$ENDIF}
|
||||
InitReading;
|
||||
|
||||
Reader.ReadRootComponent(FCurReadForm);
|
||||
if FCurReadForm.Name='' then begin
|
||||
NewName:=FCurReadForm.ClassName;
|
||||
|
||||
@ -3820,6 +3820,8 @@ begin
|
||||
Width:=RightMarginComboBox.Width;
|
||||
Height:=RightMarginComboBox.Height;
|
||||
Items.BeginUpdate;
|
||||
Items.Add('40');
|
||||
Items.Add('35');
|
||||
Items.Add('30');
|
||||
Items.Add('25');
|
||||
Items.Add('20');
|
||||
|
||||
@ -676,8 +676,8 @@ end;
|
||||
{------------------------------------------------------------------------------}
|
||||
Procedure TCustomForm.SetWindowState(Value : TWindowState);
|
||||
Begin
|
||||
//TODO: Finish SETWINDOWSTATE
|
||||
FWindowState := Value;
|
||||
//TODO: Finish SETWINDOWSTATE
|
||||
FWindowState := Value;
|
||||
Assert(False, 'Trace:TODO: [TCustomForm.SetWindowState]');
|
||||
end;
|
||||
|
||||
@ -1135,6 +1135,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.61 2002/10/06 17:55:45 lazarus
|
||||
MG: JITForms now sets csDesigning before creation
|
||||
|
||||
Revision 1.60 2002/09/29 15:08:38 lazarus
|
||||
MWE: Applied patch from "Andrew Johnson" <aj_genius@hotmail.com>
|
||||
Patch includes:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user