summaryrefslogtreecommitdiff
path: root/examples/gui/gridtest
diff options
context:
space:
mode:
Diffstat (limited to 'examples/gui/gridtest')
-rw-r--r--examples/gui/gridtest/gridtest.lpi7
-rw-r--r--examples/gui/gridtest/gridtest.lpr13
2 files changed, 17 insertions, 3 deletions
diff --git a/examples/gui/gridtest/gridtest.lpi b/examples/gui/gridtest/gridtest.lpi
index 06af36d7..a905d222 100644
--- a/examples/gui/gridtest/gridtest.lpi
+++ b/examples/gui/gridtest/gridtest.lpi
@@ -42,13 +42,18 @@
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
+ <Target>
+ <Filename Value="gridtest"/>
+ </Target>
+ <SearchPaths>
+ <UnitOutputDirectory Value="units"/>
+ </SearchPaths>
<Parsing>
<SyntaxOptions>
<UseAnsiStrings Value="False"/>
</SyntaxOptions>
</Parsing>
<Other>
- <CustomOptions Value="-FUunits"/>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
diff --git a/examples/gui/gridtest/gridtest.lpr b/examples/gui/gridtest/gridtest.lpr
index 9fbce666..173806e9 100644
--- a/examples/gui/gridtest/gridtest.lpr
+++ b/examples/gui/gridtest/gridtest.lpr
@@ -16,7 +16,8 @@ uses
fpg_button,
fpg_checkbox,
fpg_tab,
- fpg_edit;
+ fpg_edit,
+ fpg_dialogs;
type
@@ -42,6 +43,7 @@ type
chkSmoothScroll: TfpgCheckBox;
chkAlterColor: TfpgCheckBox;
{@VFD_HEAD_END: MainForm}
+ procedure StringGridHeaderClicked(Sender: TObject; ACol: Integer);
procedure StringGridDoubleClicked(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint);
procedure btnAddFiveClicked(Sender: TObject);
procedure btnAddOneClicked(Sender: TObject);
@@ -66,6 +68,11 @@ type
{ TMainForm }
+procedure TMainForm.StringGridHeaderClicked(Sender: TObject; ACol: Integer);
+begin
+ ShowMessage(Format('column %d clicked', [ACol]));
+end;
+
procedure TMainForm.StringGridDoubleClicked(Sender: TObject;
AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint);
var
@@ -92,7 +99,8 @@ end;
procedure TMainForm.btnDelRowClicked(Sender: TObject);
begin
- stringgrid.DeleteRow(stringgrid.FocusRow);
+ if StringGrid.RowCount > 0 then
+ stringgrid.DeleteRow(stringgrid.FocusRow);
end;
procedure TMainForm.chkDisabledChange(Sender: TObject);
@@ -247,6 +255,7 @@ begin
// Add custom painting
OnDrawCell := @StringGridDrawCell;
OnDoubleClick := @StringGridDoubleClicked;
+ OnHeaderClick := @StringGridHeaderClicked;
end;
chkShowHeader := TfpgCheckBox.Create(self);