mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-24 11:49:30 +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
|
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
|
var
|
||||||
MyFindGlobalComponentProc:function(const AName:AnsiString):TComponent of object;
|
MyFindGlobalComponentProc:function(const AName:AnsiString):TComponent of object;
|
||||||
|
|
||||||
@ -155,12 +143,45 @@ begin
|
|||||||
Result:=MyFindGlobalComponentProc(AName);
|
Result:=MyFindGlobalComponentProc(AName);
|
||||||
end;
|
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 }
|
{ TJITForm }
|
||||||
|
|
||||||
constructor TJITForm.Create(AOwner: TComponent);
|
function TJITForm.NewInstance: TObject;
|
||||||
begin
|
begin
|
||||||
SetDesigning(true);
|
Result:=inherited NewInstance;
|
||||||
inherited Create(AOwner);
|
TSetDesigningComponent.SetDesigningOfControl(TComponent(Result),true);
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TJITForm.Create(TheOwner: TComponent);
|
||||||
|
begin
|
||||||
|
inherited Create(TheOwner);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TJITForms }
|
{ TJITForms }
|
||||||
@ -369,6 +390,7 @@ begin
|
|||||||
writeln('[TJITForms.AddJITFormFromStream] 4');
|
writeln('[TJITForms.AddJITFormFromStream] 4');
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
InitReading;
|
InitReading;
|
||||||
|
|
||||||
Reader.ReadRootComponent(FCurReadForm);
|
Reader.ReadRootComponent(FCurReadForm);
|
||||||
if FCurReadForm.Name='' then begin
|
if FCurReadForm.Name='' then begin
|
||||||
NewName:=FCurReadForm.ClassName;
|
NewName:=FCurReadForm.ClassName;
|
||||||
|
|||||||
@ -3820,6 +3820,8 @@ begin
|
|||||||
Width:=RightMarginComboBox.Width;
|
Width:=RightMarginComboBox.Width;
|
||||||
Height:=RightMarginComboBox.Height;
|
Height:=RightMarginComboBox.Height;
|
||||||
Items.BeginUpdate;
|
Items.BeginUpdate;
|
||||||
|
Items.Add('40');
|
||||||
|
Items.Add('35');
|
||||||
Items.Add('30');
|
Items.Add('30');
|
||||||
Items.Add('25');
|
Items.Add('25');
|
||||||
Items.Add('20');
|
Items.Add('20');
|
||||||
|
|||||||
@ -676,8 +676,8 @@ end;
|
|||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
Procedure TCustomForm.SetWindowState(Value : TWindowState);
|
Procedure TCustomForm.SetWindowState(Value : TWindowState);
|
||||||
Begin
|
Begin
|
||||||
//TODO: Finish SETWINDOWSTATE
|
//TODO: Finish SETWINDOWSTATE
|
||||||
FWindowState := Value;
|
FWindowState := Value;
|
||||||
Assert(False, 'Trace:TODO: [TCustomForm.SetWindowState]');
|
Assert(False, 'Trace:TODO: [TCustomForm.SetWindowState]');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1135,6 +1135,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$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
|
Revision 1.60 2002/09/29 15:08:38 lazarus
|
||||||
MWE: Applied patch from "Andrew Johnson" <aj_genius@hotmail.com>
|
MWE: Applied patch from "Andrew Johnson" <aj_genius@hotmail.com>
|
||||||
Patch includes:
|
Patch includes:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user