summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/gui/filegrid/filegrid.lpr17
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;