diff options
author | Graeme Geldenhuys <graemeg@users.sourceforge.net> | 2007-03-07 10:14:45 +0000 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@users.sourceforge.net> | 2007-03-07 10:14:45 +0000 |
commit | a78f65fa1c1dc35922205e7cf88ac431aee59bb6 (patch) | |
tree | 9d39771e1138d8efec2d267ff3f3de2e0709185f /examples/gui | |
parent | 835b1aaa20d62437be9f2d552d0e2eebc9256286 (diff) | |
download | fpGUI-a78f65fa1c1dc35922205e7cf88ac431aee59bb6.tar.xz |
* Added more debug events.
* Implemented a very basic TPopupMenu
* Modified the WidgetTest demo to show the basic popup menu (still needs work).
Diffstat (limited to 'examples/gui')
-rw-r--r-- | examples/gui/widgettest/widgettest.lpi | 2 | ||||
-rw-r--r-- | examples/gui/widgettest/widgettest.pas | 15 |
2 files changed, 15 insertions, 2 deletions
diff --git a/examples/gui/widgettest/widgettest.lpi b/examples/gui/widgettest/widgettest.lpi index efbb9314..19413c4a 100644 --- a/examples/gui/widgettest/widgettest.lpi +++ b/examples/gui/widgettest/widgettest.lpi @@ -52,7 +52,7 @@ <Generate Value="Faster"/> </CodeGeneration> <Other> - <CustomOptions Value="-FUunits -dTraceEventsX -dDebugX + <CustomOptions Value="-FUunits -dTraceEventsX -dDebug "/> <CompilerPath Value="$(CompPath)"/> </Other> diff --git a/examples/gui/widgettest/widgettest.pas b/examples/gui/widgettest/widgettest.pas index 0e144ae1..4c4f4a32 100644 --- a/examples/gui/widgettest/widgettest.pas +++ b/examples/gui/widgettest/widgettest.pas @@ -191,6 +191,7 @@ type TMenuForm = class(TTestForm) private procedure CloseMenuClicked(Sender: TObject); + procedure AboutMenuClicked(Sender: TObject); public constructor Create(AOwner: TComponent); override; published @@ -264,7 +265,16 @@ begin Close; end; +procedure TMenuForm.AboutMenuClicked(Sender: TObject); +begin + writeln('...About menu clicked from <' + Sender.ClassName + '>'); + if Sender is TMenuItem then + writeln('From: ' + TMenuItem(Sender).Text); +end; + constructor TMenuForm.Create(AOwner: TComponent); +var + lMenuItem: TMenuItem; begin inherited Create(AOwner); Name := 'MenuForm'; @@ -281,7 +291,10 @@ begin MainMenu.AddMenu('Edit'); MainMenu.AddMenu('Options'); MainMenu.AddMenu('Windows'); - MainMenu.AddMenu('Help'); + lMenuItem := MainMenu.AddMenu('Help'); + lMenuItem.SubMenu.AddMenu('Online Help'); + lMenuItem.SubMenu.AddMenu('Tutorials'); + lMenuItem.SubMenu.AddMenu('About', '', @AboutMenuClicked); Title := TLabel.Create(self); Title.CanExpandWidth := True; |