From 1e7af73a67cff669d2b5801f5097e71b30673adc Mon Sep 17 00:00:00 2001 From: graemeg Date: Fri, 7 Sep 2007 14:56:47 +0000 Subject: GFX: Added support for handle component creation at runtime correct while the parent component is already visible. * GUI: Introduced the usage of ComponentState so that the components react correctly in the GUI Designer. Not all components are tested yet. * GUI Designer almost paints the designed form correctly. When placing a component, they are invisible, but as soon as you resize them, they are painted correctly. This is still work --- src/corelib/gfx_widget.pas | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/corelib') diff --git a/src/corelib/gfx_widget.pas b/src/corelib/gfx_widget.pas index c777c496..7637deb7 100644 --- a/src/corelib/gfx_widget.pas +++ b/src/corelib/gfx_widget.pas @@ -190,6 +190,7 @@ end; constructor TfpgWidget.Create(AOwner: TComponent); begin + Include(ComponentState, csLoading); FOnScreen := False; FVisible := True; FActiveWidget := nil; @@ -211,6 +212,13 @@ begin FWindowType := wtChild; inherited; + + // This is for components that are create at runtime, after it's + // parent has already been shown. + if (Parent <> nil) and (Parent.HasHandle) then + HandleShow; + + Exclude(ComponentState, csLoading); end; destructor TfpgWidget.Destroy; -- cgit v1.2.3-70-g09d2