diff options
Diffstat (limited to 'examples/gui/filegrid/filegrid.lpr')
-rw-r--r-- | examples/gui/filegrid/filegrid.lpr | 32 |
1 files changed, 30 insertions, 2 deletions
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; |