diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-05-23 22:21:26 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-05-23 22:21:26 +0000 |
commit | 5fd1d1516c9e83957f5ed0d51528304320b8ab0d (patch) | |
tree | a52ae09db9cc0062263376b210ef4d9bd269bb6e /examples | |
parent | e29573ef760662063079065e735b2b9047a60eb7 (diff) | |
download | fpGUI-5fd1d1516c9e83957f5ed0d51528304320b8ab0d.tar.xz |
* Minor changes to the Widgettest Edit Form.
* Implemented a very basic TFMemo component. Lots of things
are still outstanding. This is just the beginnings of the
component.
* Updated the WidgetTest example to include a Memo Form
Diffstat (limited to 'examples')
-rw-r--r-- | examples/gui/widgettest/editform.frm | 8 | ||||
-rw-r--r-- | examples/gui/widgettest/mainform.frm | 5 | ||||
-rw-r--r-- | examples/gui/widgettest/widgettest.pas | 68 |
3 files changed, 77 insertions, 4 deletions
diff --git a/examples/gui/widgettest/editform.frm b/examples/gui/widgettest/editform.frm index 9051a927..8e8c97de 100644 --- a/examples/gui/widgettest/editform.frm +++ b/examples/gui/widgettest/editform.frm @@ -42,9 +42,9 @@ object EditForm: TEditForm end
item
Widget = cbBorderStyle
- x = 0
+ x = 2
y = 4
- Width = 3
+ Width = 1
Height = 1
end>
object Label1: TFLabel
@@ -70,7 +70,7 @@ object EditForm: TEditForm OnChange = Edit2Change
end
object GrayCheckBox2: TFCheckBox
- Text = 'Disabled'
+ Text = 'Show Text'
OnClick = GrayCheckBox2Click
end
object PasswordDisplay: TFLabel
@@ -82,4 +82,4 @@ object EditForm: TEditForm OnClick = cbBorderStyleClick
end
end
-end
\ No newline at end of file +end diff --git a/examples/gui/widgettest/mainform.frm b/examples/gui/widgettest/mainform.frm index ce0f8ae6..bf91f0fd 100644 --- a/examples/gui/widgettest/mainform.frm +++ b/examples/gui/widgettest/mainform.frm @@ -70,6 +70,11 @@ object MainForm: TMainForm Text = 'Progress Bar'
OnClick = ProgressBarBtnClick
end
+ object MemoBtn: TFButton
+ CanExpandWidth = True
+ Text = 'Memo widget'
+ OnClick = MemoBtnClick
+ end
object ShowMessageBtn: TFButton
CanExpandWidth = True
Text = 'ShowMessage()'
diff --git a/examples/gui/widgettest/widgettest.pas b/examples/gui/widgettest/widgettest.pas index 2435200e..22a70a89 100644 --- a/examples/gui/widgettest/widgettest.pas +++ b/examples/gui/widgettest/widgettest.pas @@ -22,6 +22,7 @@ type TMenuForm = class; TPanelForm = class; TProgressBarForm = class; + TMemoForm = class; { TMainForm } @@ -39,6 +40,7 @@ type _frmMenu: TMenuForm; _frmPanel: TPanelForm; _frmProgressBar: TProgressBarForm; + _frmMemo: TMemoForm; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -57,6 +59,7 @@ type MenuBtn: TFButton; PanelBtn: TFButton; ProgressBarBtn: TFButton; + MemoBtn: TFButton; ShowMessageBtn: TFButton; Separator: TSeparator; ExitBtn: TFButton; @@ -73,6 +76,7 @@ type procedure MenuBtnClick(Sender: TObject); procedure PanelBtnClick(Sender: TObject); procedure ProgressBarBtnClick(Sender: TObject); + procedure MemoBtnClick(Sender: TObject); procedure ShowMessageBtnClick(Sender: TObject); end; @@ -247,6 +251,61 @@ type Separator: TSeparator; btnRandom: TFButton; end; + + + { TMemoForm } + + TMemoForm = class(TTestForm) + private + BoxLayout: TFBoxLayout; + Memo: TFMemo; + lblTitle: TFLabel; + public + constructor Create(AOwner: TComponent); override; + end; + +{ TMemoForm } + +constructor TMemoForm.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + Name := 'MemoForm'; + Text := 'Memo Test'; + BorderWidth := 8; + + BoxLayout := TFBoxLayout.Create(self); + BoxLayout.Orientation := Vertical; + self.InsertChild(BoxLayout); + + lblTitle := TFLabel.Create('Work in progress! No mouse or cursor support yet.', self); + lblTitle.FontColor := clBlue; + lblTitle.CanExpandWidth := True; + BoxLayout.InsertChild(lblTitle); + + Memo := TFMemo.Create(self); + BoxLayout.InsertChild(Memo); + + Memo.Lines.Text := + 'constructor TMemoForm.Create(AOwner: TComponent); ' + #10 + + 'begin ' + #10 + + ' inherited Create(AOwner); ' + #10 + + ' Name := ''MemoForm''; ' + #10 + + ' Text := ''Memo Test''; ' + #10 + + ' BorderWidth := 8; ' + #10 + + ' ' + #10 + + ' BoxLayout := TFBoxLayout.Create(self); ' + #10 + + ' BoxLayout.Orientation := Vertical; ' + #10 + + ' self.InsertChild(BoxLayout); ' + #10 + + ' ' + #10 + + ' lblTitle := TFLabel.Create(''Work in progress!'', self); ' + #10 + + ' lblTitle.FontColor := clBlue; ' + #10 + + ' lblTitle.CanExpandWidth := True; ' + #10 + + ' BoxLayout.InsertChild(lblTitle); ' + #10 + + ' ' + #10 + + ' Memo := TFMemo.Create(self); ' + #10 + + ' BoxLayout.InsertChild(Memo); '; +end; + { TListBoxForm } @@ -480,6 +539,7 @@ begin _frmMenu.Free; _frmPanel.Free; _frmProgressBar.Free; + _frmMemo.Free; inherited Destroy; end; @@ -586,6 +646,14 @@ begin _frmProgressBar.SetPosition(Point(Left + Width + 5, FindForm.Top)); end; +procedure TMainForm.MemoBtnClick(Sender: TObject); +begin + if not Assigned(_frmMemo) then + _frmMemo := TMemoForm.Create(self); + _frmMemo.Show; + _frmMemo.SetPosition(Point(Left + Width + 5, FindForm.Top)); +end; + procedure TMainForm.ShowMessageBtnClick(Sender: TObject); begin ShowMessage('Hello World!'); |