From 5c830ed7e38ad9a2d525db586da948748bc44356 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Tue, 7 May 2013 17:38:36 +0100 Subject: grid demo: adds OnHeaderClick event handler test - also updated project file settings for Lazarus IDE usage. --- examples/gui/gridtest/gridtest.lpi | 18 ++++++++++++------ examples/gui/gridtest/gridtest.lpr | 10 +++++++++- 2 files changed, 21 insertions(+), 7 deletions(-) (limited to 'examples') 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 @@ - + @@ -9,11 +9,13 @@ - - + + + + @@ -39,15 +41,19 @@ - + + + + + + + - 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); -- cgit v1.2.3-70-g09d2