diff options
author | drewski207 <drewski207@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-03-22 21:05:38 +0000 |
---|---|---|
committer | drewski207 <drewski207@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-03-22 21:05:38 +0000 |
commit | 49e51459783e1de062551fe86ae7030582c81aa7 (patch) | |
tree | 3d68f87d9942df98799b8eb28df53c63bba67896 /examples | |
parent | bba6d008d8b9bb7a8129fa23d0edea0bfde2e059 (diff) | |
download | fpGUI-49e51459783e1de062551fe86ae7030582c81aa7.tar.xz |
* Increased double buffer on x11 efficiency
* Fixed a bug on listbox that allowed Item 0 to be selected with the mouse
* Fixed a possible bug for TfpgTimer that possibly could allow
timers to be skipped if timer(s) were destroyed during the callback
Diffstat (limited to 'examples')
-rw-r--r-- | examples/gui/filegrid/filegrid.lpr | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/gui/filegrid/filegrid.lpr b/examples/gui/filegrid/filegrid.lpr index 70fc6e8b..f8cadada 100644 --- a/examples/gui/filegrid/filegrid.lpr +++ b/examples/gui/filegrid/filegrid.lpr @@ -7,6 +7,7 @@ uses cthreads, {$ENDIF}{$ENDIF} Classes, + SysUtils, fpgfx, gfxbase, gui_form, @@ -15,6 +16,9 @@ uses gui_button; type + + { TMainForm } + TMainForm = class(TfpgForm) private FGrid: TfpgFileGrid; @@ -22,6 +26,7 @@ type btnQuit: TfpgButton; procedure chkShowHiddenChanged(Sender: TObject); procedure btnQuitClicked(Sender: TObject); + procedure GridDblClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); public constructor Create(AOwner: TComponent); override; end; @@ -40,6 +45,17 @@ begin Close; end; +procedure TMainForm.GridDblClick(Sender: TObject; AButton: TMouseButton; + AShift: TShiftState; const AMousePos: TPoint); +begin + if (FGrid.CurrentEntry.Attributes and faDirectory) = 0 then + Exit; //==> + + FGrid.FileList.ReadDirectory(FGrid.FileList.DirectoryName + FGrid.CurrentEntry.Name); + WindowTitle := FGrid.FileList.DirectoryName; + FGrid.Update; +end; + constructor TMainForm.Create(AOwner: TComponent); begin inherited Create(AOwner); @@ -51,6 +67,7 @@ begin FGrid.FileList.ShowHidden := True; FGrid.FileList.ReadDirectory(''); FGrid.Anchors := [anLeft, anTop, anBottom, anRight]; + FGrid.OnDoubleClick := @GridDblClick; chkShowHidden := CreateCheckBox(self, 8, Height - 25, 'Show Hidden'); chkShowHidden.Checked := True; |