summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-03-16 10:23:07 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-03-16 10:23:07 +0200
commit9b4c6e7ed6237f74b8612fea6d4c42d61fa27177 (patch)
treec84eb2fc3c54f5f077e986070dc22c70c9309eee
parentd22090ffa0a1684d54b5400ccef1641580be6daa (diff)
downloadfpGUI-9b4c6e7ed6237f74b8612fea6d4c42d61fa27177.tar.xz
Fixed visibility handling of components created at runtime.
We used to force all components to Visible = False, and iterated this to child components. Now all components default to Visible = True (just like the global default), and hiding child components, you only need to hide the parent (visible = False) - no iteration needed.
-rw-r--r--src/corelib/fpg_widget.pas7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/corelib/fpg_widget.pas b/src/corelib/fpg_widget.pas
index fe19a4e3..322a6217 100644
--- a/src/corelib/fpg_widget.pas
+++ b/src/corelib/fpg_widget.pas
@@ -405,6 +405,8 @@ begin
FBackgroundColor := clWindowBackground;
FTextColor := clText1;
+ inherited Create(AOwner);
+
if (AOwner <> nil) and (AOwner is TfpgWidget) then
begin
Parent := TfpgWidget(AOwner);
@@ -419,8 +421,6 @@ begin
FShowHint := Parent.ShowHint;
end;
- inherited Create(AOwner);
-
// This is for components that are created at runtime, after it's
// parent has already been shown.
if (Parent <> nil) and (Parent.HasHandle) then
@@ -718,9 +718,8 @@ end;
procedure TfpgWidget.InternalHandleShow;
begin
FOnScreen := True;
- FVisible := False;
AllocateWindowHandle;
- DoSetWindowVisible(False);
+ DoSetWindowVisible(FVisible);
end;
procedure TfpgWidget.HandleHide;