diff options
Diffstat (limited to 'examples/gui')
-rw-r--r-- | examples/gui/filegrid/filegrid.lpi | 7 | ||||
-rw-r--r-- | examples/gui/filegrid/filegrid.lpr | 32 |
2 files changed, 33 insertions, 6 deletions
diff --git a/examples/gui/filegrid/filegrid.lpi b/examples/gui/filegrid/filegrid.lpi index a2420bb4..c02230ec 100644 --- a/examples/gui/filegrid/filegrid.lpi +++ b/examples/gui/filegrid/filegrid.lpi @@ -1,7 +1,7 @@ <?xml version="1.0"?> <CONFIG> <ProjectOptions> - <PathDelim Value="\"/> + <PathDelim Value="/"/> <Version Value="5"/> <General> <Flags> @@ -9,7 +9,7 @@ </Flags> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> - <IconPath Value=".\"/> + <IconPath Value="./"/> <TargetFileExt Value=""/> </General> <VersionInfo> @@ -23,7 +23,7 @@ <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"> @@ -42,7 +42,6 @@ </ProjectOptions> <CompilerOptions> <Version Value="5"/> - <PathDelim Value="\"/> <CodeGeneration> <Generate Value="Faster"/> </CodeGeneration> diff --git a/examples/gui/filegrid/filegrid.lpr b/examples/gui/filegrid/filegrid.lpr index 1f8fda95..cd8f68ea 100644 --- a/examples/gui/filegrid/filegrid.lpr +++ b/examples/gui/filegrid/filegrid.lpr @@ -8,19 +8,37 @@ uses {$ENDIF}{$ENDIF} Classes, fpgfx, + gfxbase, gui_form, - gui_grid; + gui_grid, + gui_checkbox, + gui_button; type TMainForm = class(TfpgForm) private FGrid: TfpgFileGrid; + chkShowHidden: TfpgCheckBox; + btnQuit: TfpgButton; + procedure chkShowHiddenChanged(Sender: TObject); + procedure btnQuitClicked(Sender: TObject); public constructor Create(AOwner: TComponent); override; end; { TMainForm } +procedure TMainForm.chkShowHiddenChanged(Sender: TObject); +begin + FGrid.FileList.ReadDirectory('*', chkShowHidden.Checked); + fpgSendMessage(self, FGrid, FPGM_PAINT); +end; + +procedure TMainForm.btnQuitClicked(Sender: TObject); +begin + Close; +end; + constructor TMainForm.Create(AOwner: TComponent); begin inherited Create(AOwner); @@ -28,9 +46,19 @@ begin SetPosition(100, 100, 620, 400); FGrid := TfpgFileGrid.Create(self); - FGrid.SetPosition(8, 8, 600, 370); + FGrid.SetPosition(8, 8, 600, 360); FGrid.FileList.ReadDirectory('*', True); FGrid.Anchors := [anLeft, anTop, anBottom, anRight]; + + chkShowHidden := CreateCheckBox(self, 8, Height - 25, 'Show Hidden'); + chkShowHidden.Checked := True; + chkShowHidden.OnChange := @chkShowHiddenChanged; + chkShowHidden.Anchors := [anLeft, anBottom]; + + btnQuit := CreateButton(self, Width - 88, Height - 30, 80, 'Quit', @btnQuitClicked); + btnQuit.ImageName := 'stdimg.Quit'; + btnQuit.ShowImage := True; + btnQuit.Anchors := [anRight, anBottom]; end; |