mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-12 10:39:08 +02:00
MG: fixed streaming visible=false
git-svn-id: trunk@3299 -
This commit is contained in:
parent
cab2573590
commit
a188d432fd
@ -305,10 +305,29 @@ end;
|
||||
function TJITForms.AddJITFormFromStream(BinStream:TStream):integer;
|
||||
// returns new index
|
||||
// -1 = invalid stream
|
||||
|
||||
procedure ApplyVisible;
|
||||
var
|
||||
i: integer;
|
||||
AControl: TControl;
|
||||
begin
|
||||
// The LCL has as default Visible=false. But for Delphi compatbility
|
||||
// loading control defaults to true.
|
||||
for i:=0 to FCurReadForm.ComponentCount-1 do begin
|
||||
AControl:=TControl(FCurReadForm.Components[i]);
|
||||
if (AControl is TControl) then begin
|
||||
if (not (csVisibleSetInLoading in AControl.ControlState)) then
|
||||
AControl.Visible:=true
|
||||
else
|
||||
AControl.ControlState:=
|
||||
AControl.ControlState-[csVisibleSetInLoading];
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
var
|
||||
Reader:TReader;
|
||||
NewClassName:shortstring;
|
||||
a:integer;
|
||||
NewName: string;
|
||||
begin
|
||||
Result:=-1;
|
||||
@ -361,12 +380,7 @@ begin
|
||||
{$IFDEF IDE_VERBOSE}
|
||||
writeln('[TJITForms.AddJITFormFromStream] 5');
|
||||
{$ENDIF}
|
||||
// MG: workaround til visible=true is default
|
||||
for a:=0 to FCurReadForm.ComponentCount-1 do begin
|
||||
if FCurReadForm.Components[a] is TControl then
|
||||
TControl(FCurReadForm.Components[a]).Visible:=true;
|
||||
end;
|
||||
// MG: end of workaround
|
||||
ApplyVisible;
|
||||
|
||||
{$IFDEF IDE_VERBOSE}
|
||||
writeln('[TJITForms.AddJITFormFromStream] 6');
|
||||
|
30
lcl/forms.pp
30
lcl/forms.pp
@ -415,10 +415,30 @@ function InitResourceComponent(Instance: TComponent;
|
||||
RootAncestor: TClass):Boolean;
|
||||
|
||||
function InitComponent(ClassType: TClass): Boolean;
|
||||
|
||||
procedure ApplyVisible;
|
||||
var
|
||||
i: integer;
|
||||
AControl: TControl;
|
||||
begin
|
||||
// The LCL has as default Visible=false. But for Delphi compatbility
|
||||
// loading control defaults to true.
|
||||
if Instance is TControl then
|
||||
for i:=0 to Instance.ComponentCount-1 do begin
|
||||
AControl:=TControl(Instance.Components[i]);
|
||||
if (AControl is TControl) then begin
|
||||
if (not (csVisibleSetInLoading in AControl.ControlState)) then
|
||||
AControl.Visible:=true
|
||||
else
|
||||
AControl.ControlState:=
|
||||
AControl.ControlState-[csVisibleSetInLoading];
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
var
|
||||
CompResource:TLResource;
|
||||
MemStream: TMemoryStream;
|
||||
a:integer;
|
||||
begin
|
||||
//writeln('[InitComponent] ',ClassType.Classname,' ',Instance<>nil);
|
||||
Result:=false;
|
||||
@ -444,13 +464,7 @@ function InitResourceComponent(Instance: TComponent;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
// MG: workaround til Visible=true is default
|
||||
if Instance is TControl then
|
||||
for a:=0 to Instance.ComponentCount-1 do
|
||||
if Instance.Components[a] is TControl then begin
|
||||
TControl(Instance.Components[a]).Visible:=true;
|
||||
end;
|
||||
// MG end of workaround
|
||||
ApplyVisible;
|
||||
MemStream.Free;
|
||||
end;
|
||||
Result:=true;
|
||||
|
Loading…
Reference in New Issue
Block a user