diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-12-10 17:16:28 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-12-10 17:16:28 +0200 |
commit | 37ae664ae2cd4c83b3e3d6da24500ab7493bb02a (patch) | |
tree | aca64222573353a3067a6b8a13f35cee3be594ee /src/corelib/fpg_widget.pas | |
parent | 84f3c92fd1bd368471b9fa53779ddfc13c7ca7c4 (diff) | |
download | fpGUI-37ae664ae2cd4c83b3e3d6da24500ab7493bb02a.tar.xz |
When forms are embedded, don't show popup-menu components when the rest are shown.
* I don't like the implementation dependency on fpg_menu though. I'll
try and see if there is some better way of doing this.
Diffstat (limited to 'src/corelib/fpg_widget.pas')
-rw-r--r-- | src/corelib/fpg_widget.pas | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/corelib/fpg_widget.pas b/src/corelib/fpg_widget.pas index f906b8bc..aaa810ad 100644 --- a/src/corelib/fpg_widget.pas +++ b/src/corelib/fpg_widget.pas @@ -172,7 +172,8 @@ implementation uses fpg_constants, - fpg_hint; + fpg_hint, + fpg_menu; var @@ -249,9 +250,13 @@ begin FVisible := AValue; if FOnScreen then if FVisible then - HandleShow + begin +// writeln('DEBUG: TfpgWidget.SetVisible - handleshow'); + HandleShow; + end else begin +// writeln('DEBUG: TfpgWidget.SetVisible - handlehide'); HandleHide; FOnScreen := True; end; @@ -429,7 +434,7 @@ end; destructor TfpgWidget.Destroy; begin {$IFDEF DEBUG} - writeln('TfpgWidget.Destroy [', Classname, ']'); + writeln('TfpgWidget.Destroy [', Classname, '.', Name, ']'); {$ENDIF} HandleHide; inherited; @@ -693,19 +698,21 @@ var n: integer; c: TComponent; begin -// writeln('Widget.HandleShow - ', ClassName, ' x:', Left, ' y:', Top, ' w:', Width, ' h:', Height); FOnScreen := True; -// FVisible := True; - AllocateWindowHandle; DoSetWindowVisible(FVisible); for n := 0 to ComponentCount - 1 do begin c := Components[n]; - if (c is TfpgWidget) and (TfpgWidget(c).Parent = self) and - (TfpgWidget(c).FOnScreen = False) then - TfpgWidget(c).HandleShow; + if (c is TfpgWidget) and (TfpgWidget(c).Parent = self) then + begin + if not (c is TfpgPopupMenu) then // these should not be created yet + begin + TfpgWidget(c).Visible := FVisible; + TfpgWidget(c).HandleShow; + end; + end; end; end; |