diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2010-09-11 13:24:19 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2010-09-11 13:24:19 +0200 |
commit | 822862fb6a875e994b712d443e627e1d904b5eea (patch) | |
tree | c60bf37bdb20418f398f79aedc397ad87a9b3af1 /examples | |
parent | ee174a54a4229d9d0522bee72ba06319086bc9de (diff) | |
download | fpGUI-822862fb6a875e994b712d443e627e1d904b5eea.tar.xz |
Grid Example: Added new Alternative Row Color checkbox.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/gui/gridtest/gridtest.lpr | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/examples/gui/gridtest/gridtest.lpr b/examples/gui/gridtest/gridtest.lpr index 29a51b43..fe7de916 100644 --- a/examples/gui/gridtest/gridtest.lpr +++ b/examples/gui/gridtest/gridtest.lpr @@ -40,6 +40,7 @@ type btnFiveOnly: TfpgButton; btnDelRow: TfpgButton; chkSmoothScroll: TfpgCheckBox; + chkAlterColor: TfpgCheckBox; {@VFD_HEAD_END: MainForm} procedure StringGridDoubleClicked(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); procedure btnAddFiveClicked(Sender: TObject); @@ -52,6 +53,7 @@ type procedure chkShowGridChange(Sender: TObject); procedure chkHideFocusChange(Sender: TObject); procedure chkSmoothScrollChange(Sender: TObject); + procedure chkAlterColorChange(Sender: TObject); procedure btnQuitClick(Sender: TObject); procedure stringgridDrawCell(Sender: TObject; const ARow, ACol: Integer; const ARect: TfpgRect; const AFlags: TfpgGridDrawState; var ADefaultDrawing: boolean); @@ -131,6 +133,15 @@ begin stringgrid.Update; end; +procedure TMainForm.chkAlterColorChange(Sender: TObject); +begin + if chkAlterColor.Checked then + stringgrid.Options := stringgrid.Options + [go_AlternativeColor] + else + stringgrid.Options := stringgrid.Options - [go_AlternativeColor]; + stringgrid.Invalidate; +end; + procedure TMainForm.btnQuitClick(Sender: TObject); begin Close; @@ -277,7 +288,7 @@ begin with chkHideFocus do begin Name := 'chkHideFocus'; - SetPosition(394, 108, 120, 20); + SetPosition(394, 108, 120, 24); Anchors := [anRight,anTop]; FontDesc := '#Label1'; Hint := ''; @@ -372,7 +383,7 @@ begin with chkSmoothScroll do begin Name := 'chkSmoothScroll'; - SetPosition(394, 128, 120, 20); + SetPosition(394, 132, 120, 24); Anchors := [anRight,anTop]; FontDesc := '#Label1'; Hint := ''; @@ -381,6 +392,18 @@ begin OnChange := @chkSmoothScrollChange; end; + chkAlterColor := TfpgCheckBox.Create(self); + with chkAlterColor do + begin + Name := 'chkAlterColor'; + SetPosition(394, 156, 120, 24); + FontDesc := '#Label1'; + Hint := ''; + TabOrder := 15; + Text := 'Alternate Color'; + OnChange := @chkAlterColorChange; + end; + {@VFD_BODY_END: MainForm} for r := 0 to stringgrid.RowCount-1 do |