diff options
author | Graeme Geldenhuys <graemeg@users.sourceforge.net> | 2007-01-23 14:48:31 +0000 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@users.sourceforge.net> | 2007-01-23 14:48:31 +0000 |
commit | c0fe0b96fa12d2ce8b7ff0d2d929c5b2181135f7 (patch) | |
tree | 59e9a7de4871633cafdfaf77e442c0d656d582ce /examples/gui | |
parent | 07a6706d95e5a97e610eba483b13217367a193d3 (diff) | |
download | fpGUI-c0fe0b96fa12d2ce8b7ff0d2d929c5b2181135f7.tar.xz |
* MouseLeaveCheck no fires off a MouseEnter and MouseLeave event for widgets.
This makes writing other widgets easier.
* Fixed the button size of the TComboBox widget.
* Fixed the examples/gui/helloworld application.
* Added a extras directory where we can store all kinds of stuff. Currently I
added a Lazarus code template for creating a new fpGUI application.
* Fixed a bug in fpGFX/X11 where the OnEnter event was checked when in actual
fact the OnLeave event occured.
* Fixed up some code to start Xft support for Linux again.
* Internal or composite widgets like the Button in the ComboBox are now named
with a hash and then the name.
Diffstat (limited to 'examples/gui')
-rw-r--r-- | examples/gui/helloworld/helloworld.lpi | 9 | ||||
-rw-r--r-- | examples/gui/helloworld/helloworld.pas | 56 | ||||
-rw-r--r-- | examples/gui/utfdemo/utfdemo.lpr | 1 | ||||
-rw-r--r-- | examples/gui/widgettest/widgettest.lpi | 1 |
4 files changed, 51 insertions, 16 deletions
diff --git a/examples/gui/helloworld/helloworld.lpi b/examples/gui/helloworld/helloworld.lpi index c180f8dc..e0302f2b 100644 --- a/examples/gui/helloworld/helloworld.lpi +++ b/examples/gui/helloworld/helloworld.lpi @@ -1,7 +1,7 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="\"/> + <PathDelim Value="/"/> <Version Value="5"/> <General> <Flags> @@ -14,15 +14,13 @@ </General> <PublishOptions> <Version Value="2"/> - <DestinationDirectory Value="$(TestDir)\publishedproject\"/> - <IgnoreBinaries Value="False"/> <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> </PublishOptions> <RunParams> <local> <FormatVersion Value="1"/> - <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> </local> </RunParams> <RequiredPackages Count="1"> @@ -40,9 +38,8 @@ </ProjectOptions> <CompilerOptions> <Version Value="5"/> - <PathDelim Value="\"/> <SearchPaths> - <OtherUnitFiles Value="..\..\src\"/> + <OtherUnitFiles Value="../../src/"/> </SearchPaths> <Parsing> <SyntaxOptions> diff --git a/examples/gui/helloworld/helloworld.pas b/examples/gui/helloworld/helloworld.pas index b9921756..b09ec498 100644 --- a/examples/gui/helloworld/helloworld.pas +++ b/examples/gui/helloworld/helloworld.pas @@ -3,20 +3,60 @@ program HelloWorld; {$mode objfpc}{$h+} uses - fpGUI, fpguipackage; + fpGUI + ,fpGFX { GFApplication } + ,gfxBase + ; type TMainForm = class(TForm) - TextLabel: TLabel; - lblClose: TLabel; + private + BoxLayout: TBoxLayout; + btnHello: TButton; + public + procedure AfterConstruction; override; end; + +{ TMainForm } + +procedure TMainForm.AfterConstruction; var - MainForm: TMainForm; + lSize: TSize; +begin + inherited AfterConstruction; + Name := 'MainForm'; + BorderWidth := 8; + Text := 'fpGUI Application'; + + { every fpGUI app needs a layout manager } + BoxLayout := TBoxLayout.Create(self); + BoxLayout.Spacing := 8; + BoxLayout.VertAlign := vertFill; + InsertChild(BoxLayout); + + { create our button } + btnHello := TButton.Create('Hello World!', self); + btnHello.CanExpandWidth := True; + btnHello.CanExpandHeight := True; + BoxLayout.InsertChild(btnHello); + { set a min and max size } + lSize.cx := 150; + lSize.cy := 100; + Wnd.SetMinMaxClientSize(lSize, lSize); +end; + + +var + MainForm: TMainForm; begin - Application.CreateForm(TMainForm, MainForm); - - Application.Run; - MainForm.Free; + GFApplication.Initialize; + MainForm := TMainForm.Create(GFApplication); + try + MainForm.Show; + GFApplication.Run; + finally + MainForm.Free; + end; end. diff --git a/examples/gui/utfdemo/utfdemo.lpr b/examples/gui/utfdemo/utfdemo.lpr index c3c7ba6c..b59f7f96 100644 --- a/examples/gui/utfdemo/utfdemo.lpr +++ b/examples/gui/utfdemo/utfdemo.lpr @@ -63,7 +63,6 @@ begin GFApplication.Initialize; MainForm := TMainForm.Create(GFApplication); try - GFApplication.AddWindow(MainForm.Wnd); { I don't like this! } MainForm.Show; GFApplication.Run; finally diff --git a/examples/gui/widgettest/widgettest.lpi b/examples/gui/widgettest/widgettest.lpi index 0fe05a78..efbb9314 100644 --- a/examples/gui/widgettest/widgettest.lpi +++ b/examples/gui/widgettest/widgettest.lpi @@ -6,7 +6,6 @@ <General> <Flags> <SaveOnlyProjectUnits Value="True"/> - <AlwaysBuild Value="False"/> </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> |