summaryrefslogtreecommitdiff
path: root/examples/gui
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-08-02 13:39:22 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-08-02 13:39:22 +0200
commitd1a849d6d5cae1aed1896c145c3963c137e2f474 (patch)
tree4bd0f941abc797aa883f1af5f4ed5414da526ab1 /examples/gui
parent1be398ed4730d27d5401b4205ae1946760950702 (diff)
downloadfpGUI-d1a849d6d5cae1aed1896c145c3963c137e2f474.tar.xz
Grid Demo: Added Smooth Scrolling checkbox to demo.
Diffstat (limited to 'examples/gui')
-rw-r--r--examples/gui/gridtest/gridtest.lpi13
-rw-r--r--examples/gui/gridtest/gridtest.lpr45
2 files changed, 50 insertions, 8 deletions
diff --git a/examples/gui/gridtest/gridtest.lpi b/examples/gui/gridtest/gridtest.lpi
index 25664143..8d6de301 100644
--- a/examples/gui/gridtest/gridtest.lpi
+++ b/examples/gui/gridtest/gridtest.lpi
@@ -1,18 +1,18 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
- <PathDelim Value="/"/>
- <Version Value="6"/>
+ <Version Value="8"/>
<General>
<Flags>
<SaveOnlyProjectUnits Value="True"/>
+ <LRSInOutputDirectory Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<TargetFileExt Value=""/>
</General>
<VersionInfo>
- <ProjectVersion Value=""/>
+ <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
@@ -39,7 +39,12 @@
</Units>
</ProjectOptions>
<CompilerOptions>
- <Version Value="8"/>
+ <Version Value="9"/>
+ <Parsing>
+ <SyntaxOptions>
+ <UseAnsiStrings Value="False"/>
+ </SyntaxOptions>
+ </Parsing>
<Other>
<CustomOptions Value="-FUunits
"/>
diff --git a/examples/gui/gridtest/gridtest.lpr b/examples/gui/gridtest/gridtest.lpr
index 56afaa10..29a51b43 100644
--- a/examples/gui/gridtest/gridtest.lpr
+++ b/examples/gui/gridtest/gridtest.lpr
@@ -39,9 +39,9 @@ type
btnAddOne: TfpgButton;
btnFiveOnly: TfpgButton;
btnDelRow: TfpgButton;
+ chkSmoothScroll: TfpgCheckBox;
{@VFD_HEAD_END: MainForm}
- procedure StringGridDoubleClicked(Sender: TObject; AButton: TMouseButton;
- AShift: TShiftState; const AMousePos: TPoint);
+ procedure StringGridDoubleClicked(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint);
procedure btnAddFiveClicked(Sender: TObject);
procedure btnAddOneClicked(Sender: TObject);
procedure btnFiveOnlyClicked(Sender: TObject);
@@ -51,6 +51,7 @@ type
procedure chkShowHeaderChange(Sender: TObject);
procedure chkShowGridChange(Sender: TObject);
procedure chkHideFocusChange(Sender: TObject);
+ procedure chkSmoothScrollChange(Sender: TObject);
procedure btnQuitClick(Sender: TObject);
procedure stringgridDrawCell(Sender: TObject; const ARow, ACol: Integer;
const ARect: TfpgRect; const AFlags: TfpgGridDrawState; var ADefaultDrawing: boolean);
@@ -117,10 +118,19 @@ begin
if chkHideFocus.Checked then
stringgrid.Options := stringgrid.Options + [go_HideFocusRect]
else
- stringgrid.Options := [];
+ stringgrid.Options := stringgrid.Options - [go_HideFocusRect];
stringgrid.Invalidate;
end;
+procedure TMainForm.chkSmoothScrollChange(Sender: TObject);
+begin
+ if chkSmoothScroll.Checked then
+ stringgrid.Options := stringgrid.Options + [go_SmoothScroll]
+ else
+ stringgrid.Options := stringgrid.Options - [go_SmoothScroll];
+ stringgrid.Update;
+end;
+
procedure TMainForm.btnQuitClick(Sender: TObject);
begin
Close;
@@ -156,6 +166,7 @@ begin
Name := 'MainForm';
SetPosition(351, 214, 515, 350);
WindowTitle := 'Grid control test';
+ Hint := '';
WindowPosition := wpScreenCenter;
btnQuit := TfpgButton.Create(self);
@@ -168,6 +179,7 @@ begin
FontDesc := '#Label1';
Hint := '';
ImageName := 'stdimg.Quit';
+ TabOrder := 1;
OnClick := @btnQuitClick;
end;
@@ -182,7 +194,9 @@ begin
AddColumn('Numbers', 150, taRightJustify);
FontDesc := '#Grid';
HeaderFontDesc := '#GridHeader';
+ Hint := '';
RowCount := 17;
+ RowSelect := False;
TabOrder := 1;
AddColumn('Column 0', 65);
// Alignment test
@@ -213,6 +227,7 @@ begin
Anchors := [anRight,anTop];
Checked := True;
FontDesc := '#Label1';
+ Hint := '';
TabOrder := 2;
Text := 'Show Header';
OnChange := @chkShowHeaderChange;
@@ -226,6 +241,7 @@ begin
Anchors := [anRight,anTop];
Checked := True;
FontDesc := '#Label1';
+ Hint := '';
TabOrder := 3;
Text := 'Show Grid';
OnChange := @chkShowGridChange;
@@ -238,6 +254,7 @@ begin
SetPosition(394, 60, 116, 24);
Anchors := [anRight,anTop];
FontDesc := '#Label1';
+ Hint := '';
TabOrder := 4;
Text := 'Row Select';
OnChange := @chkRowSelectChange;
@@ -250,6 +267,7 @@ begin
SetPosition(394, 84, 116, 24);
Anchors := [anRight,anTop];
FontDesc := '#Label1';
+ Hint := '';
TabOrder := 5;
Text := 'Disabled';
OnChange := @chkDisabledChange;
@@ -262,6 +280,7 @@ begin
SetPosition(394, 108, 120, 20);
Anchors := [anRight,anTop];
FontDesc := '#Label1';
+ Hint := '';
TabOrder := 6;
Text := 'Hide Focus';
OnChange := @chkHideFocusChange;
@@ -271,8 +290,12 @@ begin
with edtTopRow do
begin
Name := 'edtTopRow';
- SetPosition(12, 280, 56, 22);
+ SetPosition(12, 280, 56, 24);
Anchors := [anLeft,anBottom];
+ Hint := '';
+ TabOrder := 8;
+ FontDesc := '#Edit1';
+ Value := 0;
end;
btnTopRow := TfpgButton.Create(self);
@@ -336,6 +359,7 @@ begin
begin
Name := 'btnDelRow';
SetPosition(168, 308, 80, 23);
+ Anchors := [anLeft,anBottom];
Text := 'Delete Row';
FontDesc := '#Label1';
Hint := '';
@@ -344,6 +368,19 @@ begin
OnClick := @btnDelRowClicked;
end;
+ chkSmoothScroll := TfpgCheckBox.Create(self);
+ with chkSmoothScroll do
+ begin
+ Name := 'chkSmoothScroll';
+ SetPosition(394, 128, 120, 20);
+ Anchors := [anRight,anTop];
+ FontDesc := '#Label1';
+ Hint := '';
+ TabOrder := 14;
+ Text := 'Smooth Scroll';
+ OnChange := @chkSmoothScrollChange;
+ end;
+
{@VFD_BODY_END: MainForm}
for r := 0 to stringgrid.RowCount-1 do