diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-08-23 13:26:22 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-08-23 13:26:22 +0000 |
commit | 43abf2a3cc1e8467a969c20789adad242528c23d (patch) | |
tree | 6687e57890a252ade6c8adc7138f3ce3a8bdd19e /examples/gui/gridtest | |
parent | 220f4bb067887a8c7dadcf2c56ee1aa24032b195 (diff) | |
download | fpGUI-43abf2a3cc1e8467a969c20789adad242528c23d.tar.xz |
* Grid cells in disabled state are not painting in 3D text effect.
* Minor changes to TfpgCustomGrid to make it more flexible for descendants
* Rewrote the TfpgCustomStringGrid basing the design on TfpgCustomGrid
* Extended the GridTest example to exercise both grids.
Diffstat (limited to 'examples/gui/gridtest')
-rw-r--r-- | examples/gui/gridtest/gridtest.lpr | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/examples/gui/gridtest/gridtest.lpr b/examples/gui/gridtest/gridtest.lpr index 66802e7c..a5f1d731 100644 --- a/examples/gui/gridtest/gridtest.lpr +++ b/examples/gui/gridtest/gridtest.lpr @@ -46,21 +46,25 @@ type procedure TMainForm.chkDisabledChange(Sender: TObject); begin grdMain.Enabled := not chkDisabled.Checked; + stringgrid.Enabled := grdMain.Enabled; end; procedure TMainForm.chkRowSelectChange(Sender: TObject); begin grdMain.RowSelect := chkRowSelect.Checked; + stringgrid.RowSelect := grdMain.RowSelect; end; procedure TMainForm.chkShowHeaderChange(Sender: TObject); begin grdMain.ShowHeader := chkShowHeader.Checked; + stringgrid.ShowHeader := grdMain.ShowHeader; end; procedure TMainForm.chkShowGridChange(Sender: TObject); begin grdMain.ShowGrid := chkShowGrid.Checked; + stringgrid.ShowGrid := grdMain.ShowGrid; end; procedure TMainForm.btnQuitClick(Sender: TObject); @@ -100,20 +104,21 @@ begin for c := 1 to grdMain.ColumnCount do grdMain.Columns[c-1].Title := 'Title ' + IntToStr(c); - tsTab2 := pagecontrol.AppendTabSheet('String Grid'); stringgrid := TfpgStringGrid.Create(tsTab2); stringgrid.SetPosition(10, 10, Width-50, 250); - stringgrid.ColumnCount := 2; - stringgrid.RowCount := 5; - stringgrid.Cells[2, 1] := 'hello'; - stringgrid.Cells[5, 2] := 'hello'; + // change row and column count to something different that the default + stringgrid.ColumnCount := 2; + stringgrid.RowCount := 3; + // add and change a column + stringgrid.AddColumn('Extra', 100); + stringgrid.ColumnWidth[3] := 150; + // changes header text in different ways stringgrid.ColumnTitle[1] := 'Column 1'; -// stringgrid.Columns[1].Title := 'Column 1'; -// stringgrid.Columns[2].Title := 'Col2'; - //for r := 1 to stringgrid.RowCount do - //for c := 1 to stringgrid.ColumnCount do - //stringgrid.Cells[r, c] := IntToStr(r) + ',' + IntToStr(c); + stringgrid.Columns[2].Title := 'Col 2'; + // add some text + stringgrid.Cells[2, 3] := 'Hello'; + stringgrid.Cells[3, 1] := '(r1,c3)'; // stringgrid.Anchors := [anLeft, anTop, anRight, anBottom]; pagecontrol.ActivePageIndex := 0; |