summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-06-03 13:35:33 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-06-03 13:35:33 +0000
commit4a9a4f473bfa109a03443921891a0ac150ad69ef (patch)
tree517310f9f88ab49e910ccf4607c61cbb216d0177 /examples
parent4d3dbec5a9fdaa97792c107073083e7489ea605e (diff)
downloadfpGUI-4a9a4f473bfa109a03443921891a0ac150ad69ef.tar.xz
Applied partial parts of patch [ 1979341 ] gui_editCombo from Jean-Marc.
* Updated the combobox demo.
Diffstat (limited to 'examples')
-rw-r--r--examples/gui/combobox/frm_main.pas64
1 files changed, 61 insertions, 3 deletions
diff --git a/examples/gui/combobox/frm_main.pas b/examples/gui/combobox/frm_main.pas
index b0be0713..c4ca0b97 100644
--- a/examples/gui/combobox/frm_main.pas
+++ b/examples/gui/combobox/frm_main.pas
@@ -16,6 +16,7 @@ type
TMainForm = class(TfpgForm)
private
+ procedure rbChanged(Sender: TObject);
procedure cbAutoCompleteChanged(Sender: TObject);
procedure cbAutoDropDownChanged(Sender: TObject);
procedure cbAllowNewChanged(Sender: TObject);
@@ -38,6 +39,10 @@ type
lblName3: TfpgLabel;
lblName4: TfpgLabel;
cbAllowNew: TfpgComboBox;
+ grpBox: TfpgGroupBox;
+ rbName1: TfpgRadioButton;
+ rbName2: TfpgRadioButton;
+ rbName3: TfpgRadioButton;
{@VFD_HEAD_END: MainForm}
constructor Create(AOwner: TComponent); override;
procedure AfterCreate; override;
@@ -52,6 +57,15 @@ uses
{@VFD_NEWFORM_IMPL}
+procedure TMainForm.rbChanged(Sender: TObject);
+begin
+ if Sender is TfpgRadioButton then
+ begin
+ Combo1.DropDownCount := TfpgRadioButton(Sender).Tag;
+ EditCombo1.DropDownCount := TfpgRadioButton(Sender).Tag;
+ end;
+end;
+
procedure TMainForm.cbAutoCompleteChanged(Sender: TObject);
begin
EditCombo1.AutoCompletion := cbAutoComplete.Checked;
@@ -126,7 +140,7 @@ procedure TMainForm.AfterCreate;
begin
{@VFD_BODY_BEGIN: MainForm}
Name := 'MainForm';
- SetPosition(345, 220, 344, 260);
+ SetPosition(345, 220, 484, 260);
WindowTitle := 'ComboBox test';
WindowPosition := wpScreenCenter;
@@ -193,7 +207,7 @@ begin
with Combo1 do
begin
Name := 'Combo1';
- SetPosition(8, 24, 168, 21);
+ SetPosition(8, 24, 168, 22);
FontDesc := '#List';
TabOrder := 6;
end;
@@ -256,7 +270,7 @@ begin
with cbAllowNew do
begin
Name := 'cbAllowNew';
- SetPosition(220, 212, 100, 21);
+ SetPosition(220, 212, 100, 22);
FontDesc := '#List';
Items.Add('anNo');
Items.Add('anYes');
@@ -266,6 +280,50 @@ begin
FocusItem := 0;
end;
+ grpBox := TfpgGroupBox.Create(self);
+ with grpBox do
+ begin
+ Name := 'grpBox';
+ SetPosition(328, 28, 144, 108);
+ Text := 'Dropdown Count:';
+ end;
+
+ rbName1 := TfpgRadioButton.Create(grpBox);
+ with rbName1 do
+ begin
+ Name := 'rbName1';
+ SetPosition(16, 24, 80, 20);
+ FontDesc := '#Label1';
+ Text := '8 items';
+ Tag := 8;
+ Checked := True;
+ OnChange := @rbChanged;
+ end;
+
+ rbName2 := TfpgRadioButton.Create(grpBox);
+ with rbName2 do
+ begin
+ Name := 'rbName2';
+ SetPosition(16, 44, 80, 20);
+ FontDesc := '#Label1';
+ TabOrder := 1;
+ Text := '12 items';
+ Tag := 12;
+ OnChange := @rbChanged;
+ end;
+
+ rbName3 := TfpgRadioButton.Create(grpBox);
+ with rbName3 do
+ begin
+ Name := 'rbName3';
+ SetPosition(16, 64, 80, 20);
+ FontDesc := '#Label1';
+ TabOrder := 2;
+ Text := '25 items';
+ Tag := 25;
+ OnChange := @rbChanged;
+ end;
+
{@VFD_BODY_END: MainForm}
end;