summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-05-09 10:32:29 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-05-09 10:32:29 +0000
commit1805b503d2f564c8c7fc95478827a6d5b0aad4e8 (patch)
treeb71aed46809b085e2659f659568b8b92e1c47247
parenta461d3206b5625fb7a45cafa218495ea59868927 (diff)
downloadfpGUI-1805b503d2f564c8c7fc95478827a6d5b0aad4e8.tar.xz
* Fixed bug where program crashed if MainMenu contains no items and you click on it.
* Fixed bug where components can't be created and Visible = False.
-rw-r--r--src/corelib/gfx_widget.pas9
-rw-r--r--src/corelib/x11/gfx_x11.pas3
-rw-r--r--src/gui/gui_form.pas1
-rw-r--r--src/gui/gui_menu.pas3
4 files changed, 10 insertions, 6 deletions
diff --git a/src/corelib/gfx_widget.pas b/src/corelib/gfx_widget.pas
index 72014f3c..24d69381 100644
--- a/src/corelib/gfx_widget.pas
+++ b/src/corelib/gfx_widget.pas
@@ -261,7 +261,7 @@ begin
inherited Create(AOwner);
- // This is for components that are create at runtime, after it's
+ // This is for components that are created at runtime, after it's
// parent has already been shown.
if (Parent <> nil) and (Parent.HasHandle) then
begin
@@ -532,15 +532,16 @@ var
c: TComponent;
begin
FOnScreen := True;
- FVisible := True;
+// FVisible := True;
AllocateWindowHandle;
- DoSetWindowVisible(True);
+ DoSetWindowVisible(FVisible);
for n := 0 to ComponentCount - 1 do
begin
c := Components[n];
- if (c is TfpgWidget) and (TfpgWidget(c).Parent = self) then
+ if (c is TfpgWidget) and (TfpgWidget(c).Parent = self) and
+ (TfpgWidget(c).FOnScreen = False) then
TfpgWidget(c).HandleShow;
end;
end;
diff --git a/src/corelib/x11/gfx_x11.pas b/src/corelib/x11/gfx_x11.pas
index cb29ffaf..d507ecb5 100644
--- a/src/corelib/x11/gfx_x11.pas
+++ b/src/corelib/x11/gfx_x11.pas
@@ -1314,7 +1314,7 @@ begin
if HandleIsValid then
Exit; //==>
- if aparent <> nil then
+ if AParent <> nil then
pwh := TfpgWindowImpl(AParent).WinHandle
else
pwh := xapplication.RootWindow;
@@ -1328,7 +1328,6 @@ begin
end;
AdjustWindowStyle;
-
wh := XCreateWindow(xapplication.Display, pwh,
FLeft, FTop, FWidth, FHeight, 0,
CopyFromParent,
diff --git a/src/gui/gui_form.pas b/src/gui/gui_form.pas
index a284ae54..4ac0ac63 100644
--- a/src/gui/gui_form.pas
+++ b/src/gui/gui_form.pas
@@ -242,6 +242,7 @@ begin
ModalResult := 0;
Show;
+
// processing messages until this form ends.
// delivering the remaining messages
fpgApplication.ProcessMessages;
diff --git a/src/gui/gui_menu.pas b/src/gui/gui_menu.pas
index 7d665e93..bd6f10a2 100644
--- a/src/gui/gui_menu.pas
+++ b/src/gui/gui_menu.pas
@@ -418,6 +418,9 @@ var
newf: integer;
begin
inherited HandleLMouseDown(x, y, shiftstate);
+
+ if ComponentCount = 0 then
+ Exit; // We have no menu items in MainMenu.
if not Focused then
ActivateMenu;