summaryrefslogtreecommitdiff
path: root/src/gui
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 /src/gui
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.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui_form.pas1
-rw-r--r--src/gui/gui_menu.pas3
2 files changed, 4 insertions, 0 deletions
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;