summaryrefslogtreecommitdiff
path: root/examples/gui/widgettest
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@users.sourceforge.net>2007-04-17 23:26:16 +0000
committerGraeme Geldenhuys <graemeg@users.sourceforge.net>2007-04-17 23:26:16 +0000
commita10b18b3ee0948ae0cbc4d10e8d74d82e15c0112 (patch)
tree13775772c19aa271c6615803480cc23c5cf08e28 /examples/gui/widgettest
parentf37ea39ad0282dfb4e27a777e0adb880e81331fe (diff)
downloadfpGUI-a10b18b3ee0948ae0cbc4d10e8d74d82e15c0112.tar.xz
* Applied TFEdit patch from Maciej Kaczkowski enabling the
text to scroll. Also implemented BorderStyle property. * I made minor changes to Maciej patch. * Updated the WidgetTest demo to showcase the new features.
Diffstat (limited to 'examples/gui/widgettest')
-rw-r--r--examples/gui/widgettest/editform.frm159
-rw-r--r--examples/gui/widgettest/widgettest.lpi7
-rw-r--r--examples/gui/widgettest/widgettest.pas18
3 files changed, 107 insertions, 77 deletions
diff --git a/examples/gui/widgettest/editform.frm b/examples/gui/widgettest/editform.frm
index d3c9130c..9051a927 100644
--- a/examples/gui/widgettest/editform.frm
+++ b/examples/gui/widgettest/editform.frm
@@ -1,74 +1,85 @@
-object EditForm: TEditForm
- BorderWidth = 8
- Text = 'Edit field test'
- object Grid: TFGridLayout
- ColCount = 3
- RowCount = 4
- GridPositions = <
- item
- Widget = Label1
- end
- item
- x = 1
- Widget = Edit1
- end
- item
- x = 2
- Widget = GrayCheckBox1
- end
- item
- y = 1
- width = 3
- Widget = Separator
- end
- item
- y = 2
- Widget = Label2
- end
- item
- x = 1
- y = 2
- Widget = Edit2
- end
- item
- x = 2
- y = 2
- Widget = GrayCheckBox2
- end
- item
- x = 1
- y = 3
- Widget = PasswordDisplay
- end>
- object Label1: TFLabel
- Text = 'Normal edit field:'
- CanExpandWidth = False
- end
- object Edit1: TFEdit
- Text = 'Edit1'
- end
- object GrayCheckBox1: TFCheckBox
- Text = 'Disabled'
- OnClick = GrayCheckBox1Click
- end
- object Separator: TSeparator
- end
- object Label2: TFLabel
- Text = 'Password edit field:'
- CanExpandWidth = False
- end
- object Edit2: TFEdit
- PasswordChar = '*'
- Text = 'Edit2'
- OnChange = Edit2Change
- end
- object GrayCheckBox2: TFCheckBox
- Text = 'Disabled'
- OnClick = GrayCheckBox2Click
- end
- object PasswordDisplay: TFLabel
- Text = '(Password field)'
- CanExpandWidth = False
- end
- end
-end
+object EditForm: TEditForm
+ BorderWidth = 8
+ Text = 'Edit field test'
+ object Grid: TFGridLayout
+ ColCount = 3
+ RowCount = 5
+ GridPositions = <
+ item
+ Widget = Label1
+ end
+ item
+ x = 1
+ Widget = Edit1
+ end
+ item
+ x = 2
+ Widget = GrayCheckBox1
+ end
+ item
+ y = 1
+ width = 3
+ Widget = Separator
+ end
+ item
+ y = 2
+ Widget = Label2
+ end
+ item
+ x = 1
+ y = 2
+ Widget = Edit2
+ end
+ item
+ x = 2
+ y = 2
+ Widget = GrayCheckBox2
+ end
+ item
+ x = 1
+ y = 3
+ Widget = PasswordDisplay
+ end
+ item
+ Widget = cbBorderStyle
+ x = 0
+ y = 4
+ Width = 3
+ Height = 1
+ end>
+ object Label1: TFLabel
+ Text = 'Normal edit field:'
+ CanExpandWidth = False
+ end
+ object Edit1: TFEdit
+ Text = 'Edit1'
+ end
+ object GrayCheckBox1: TFCheckBox
+ Text = 'Disabled'
+ OnClick = GrayCheckBox1Click
+ end
+ object Separator: TSeparator
+ end
+ object Label2: TFLabel
+ Text = 'Password edit field:'
+ CanExpandWidth = False
+ end
+ object Edit2: TFEdit
+ PasswordChar = '*'
+ Text = 'Edit2'
+ OnChange = Edit2Change
+ end
+ object GrayCheckBox2: TFCheckBox
+ Text = 'Disabled'
+ OnClick = GrayCheckBox2Click
+ end
+ object PasswordDisplay: TFLabel
+ Text = '(Password field)'
+ CanExpandWidth = False
+ end
+ object cbBorderStyle: TFButton
+ Text = 'Alternate Border Style'
+ OnClick = cbBorderStyleClick
+ end
+ end
+end \ No newline at end of file
diff --git a/examples/gui/widgettest/widgettest.lpi b/examples/gui/widgettest/widgettest.lpi
index be425d5c..711d2936 100644
--- a/examples/gui/widgettest/widgettest.lpi
+++ b/examples/gui/widgettest/widgettest.lpi
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
- <PathDelim Value="/"/>
+ <PathDelim Value="\"/>
<Version Value="5"/>
<General>
<Flags>
@@ -9,7 +9,7 @@
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
- <IconPath Value="./"/>
+ <IconPath Value=".\"/>
<TargetFileExt Value=""/>
</General>
<PublishOptions>
@@ -20,7 +20,7 @@
<RunParams>
<local>
<FormatVersion Value="1"/>
- <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
+ <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="1">
@@ -39,6 +39,7 @@
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
+ <PathDelim Value="\"/>
<Parsing>
<SyntaxOptions>
<IncludeAssertionCode Value="True"/>
diff --git a/examples/gui/widgettest/widgettest.pas b/examples/gui/widgettest/widgettest.pas
index a7a3dd93..8dea18a2 100644
--- a/examples/gui/widgettest/widgettest.pas
+++ b/examples/gui/widgettest/widgettest.pas
@@ -112,6 +112,8 @@ type
end;
+ { TEditForm }
+
TEditForm = class(TTestForm)
Grid: TFGridLayout;
VertBox, HorzBox1, HorzBox2: TFBoxLayout;
@@ -119,8 +121,10 @@ type
Edit1, Edit2: TFEdit;
GrayCheckBox1, GrayCheckBox2: TFCheckbox;
Separator: TSeparator;
+ cbBorderStyle: TFButton;
procedure GrayCheckBox1Click(Sender: TObject);
procedure GrayCheckBox2Click(Sender: TObject);
+ procedure cbBorderStyleClick(Sender: TObject);
procedure Edit2Change(Sender: TObject);
public
constructor Create(AOwner: TComponent); override;
@@ -653,6 +657,20 @@ begin
Edit2.Enabled := not GrayCheckBox2.Checked;
end;
+procedure TEditForm.cbBorderStyleClick(Sender: TObject);
+begin
+ if Edit1.BorderStyle = bsNone then
+ begin
+ Edit1.BorderStyle := bsSingle;
+ Edit2.BorderStyle := bsSingle;
+ end
+ else
+ begin
+ Edit1.BorderStyle := bsNone;
+ Edit2.BorderStyle := bsNone;
+ end;
+end;
+
procedure TEditForm.Edit2Change(Sender: TObject);
begin