diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-05-26 12:05:32 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-05-26 12:05:32 +0000 |
commit | 44873cef25a619560b2ff5993fd6bd8b855c7def (patch) | |
tree | 060b8378441aaaf8362aa16665ab36fe006c3895 /examples/gui/panel | |
parent | a3d1ea22c42ed9bb4af11a301db195f67137f85e (diff) | |
download | fpGUI-44873cef25a619560b2ff5993fd6bd8b855c7def.tar.xz |
* TfpgPanel and TfpgGroupBox now also use the txtEnabled text flag.
* Updated the Panel example to show Enabled and Disabled states.
Diffstat (limited to 'examples/gui/panel')
-rw-r--r-- | examples/gui/panel/mainform.pas | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/examples/gui/panel/mainform.pas b/examples/gui/panel/mainform.pas index 8becb472..ba6fca4e 100644 --- a/examples/gui/panel/mainform.pas +++ b/examples/gui/panel/mainform.pas @@ -14,7 +14,8 @@ uses gui_label, gui_panel, gui_radiobutton, - gui_combobox; + gui_combobox, + gui_checkbox; type TfrmMain = class(TfpgForm) @@ -60,6 +61,8 @@ type Bt_Quit: TfpgButton; cbxShape: TfpgComboBox; cbxBorder: TfpgComboBox; + chkEnabled: TfpgCheckBox; + procedure chkEnabledChanged(Sender: TObject); procedure RB_LeftChange(Sender: TObject); procedure RB_CenterChange(Sender: TObject); procedure RB_RightChange(Sender: TObject); @@ -91,6 +94,13 @@ type implementation +procedure TfrmMain.chkEnabledChanged(Sender: TObject); +begin + P_Panel.Enabled := chkEnabled.Checked; + B_Bevel.Enabled := chkEnabled.Checked; + G_GroupBox.Enabled := chkEnabled.Checked; +end; + procedure TfrmMain.RB_LeftChange(Sender: TObject); begin P_Panel.Alignment := taLeftJustify; @@ -333,11 +343,15 @@ begin RB_Green := CreateRadioButton(B_TextColor, 20, 70, 'Text green'); RB_Green.OnChange := @RB_GreenChange; B_Style := CreateBevel(Self, 50, 500, 180, 80, bsBox, bsRaised); - RB_Raised := CreateRadioButton(B_Style, 20, 20, 'Raised'); + RB_Raised := CreateRadioButton(B_Style, 20, 10, 'Raised'); RB_Raised.OnChange := @RB_RaisedChange; RB_Raised.Checked := True; - RB_Lowered := CreateRadioButton(B_Style, 20, 40, 'Lowered'); + RB_Lowered := CreateRadioButton(B_Style, 20, 30, 'Lowered'); RB_Lowered.OnChange := @RB_LoweredChange; + chkEnabled := CreateCheckBox(B_Style, 20, 50, 'Enabled'); + chkEnabled.Checked := True; + chkEnabled.OnChange := @chkEnabledChanged; + Bt_Quit := CreateButton(Self, 250, 555, 100, 'Quit', @Bt_QuitClick); cbxShape := CreateComboBox(self, 250, 500, 100, nil); |