summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2013-05-07 17:38:36 +0100
committerGraeme Geldenhuys <graemeg@gmail.com>2013-05-07 17:38:36 +0100
commit5c830ed7e38ad9a2d525db586da948748bc44356 (patch)
tree1bd19213d4b69a4ba25315e2299443321e887b13 /examples
parentc46fcdb5f0afd760c3f1653f5182bb21713f0219 (diff)
downloadfpGUI-5c830ed7e38ad9a2d525db586da948748bc44356.tar.xz
grid demo: adds OnHeaderClick event handler test
- also updated project file settings for Lazarus IDE usage.
Diffstat (limited to 'examples')
-rw-r--r--examples/gui/gridtest/gridtest.lpi18
-rw-r--r--examples/gui/gridtest/gridtest.lpr10
2 files changed, 21 insertions, 7 deletions
diff --git a/examples/gui/gridtest/gridtest.lpi b/examples/gui/gridtest/gridtest.lpi
index 8d6de301..a905d222 100644
--- a/examples/gui/gridtest/gridtest.lpi
+++ b/examples/gui/gridtest/gridtest.lpi
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
- <Version Value="8"/>
+ <Version Value="9"/>
<General>
<Flags>
<SaveOnlyProjectUnits Value="True"/>
@@ -9,11 +9,13 @@
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
- <TargetFileExt Value=""/>
</General>
<VersionInfo>
- <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/>
+ <StringTable ProductVersion=""/>
</VersionInfo>
+ <BuildModes Count="1">
+ <Item1 Name="default" Default="True"/>
+ </BuildModes>
<PublishOptions>
<Version Value="2"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
@@ -39,15 +41,19 @@
</Units>
</ProjectOptions>
<CompilerOptions>
- <Version Value="9"/>
+ <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 f2c0b017..4c2c0e16 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
@@ -245,6 +252,7 @@ begin
// Add custom painting
OnDrawCell := @StringGridDrawCell;
OnDoubleClick := @StringGridDoubleClicked;
+ OnHeaderClick := @StringGridHeaderClicked;
end;
chkShowHeader := TfpgCheckBox.Create(self);