diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-01-28 13:39:51 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-01-28 13:39:51 +0000 |
commit | ef34b0317d543a5c06db61860516bee181db6e0f (patch) | |
tree | 4e516b9b490c0cc273a851ee831e65ff6f10104a /src/gui/gui_radiobutton.pas | |
parent | 1196a73c40a0e21b16107486172cc072a76143e2 (diff) | |
download | fpGUI-ef34b0317d543a5c06db61860516bee181db6e0f.tar.xz |
* Applied Jean-Marc memo patch adding TextColor and BackgroundColor properties.
* Renamed the Color property to TextColor for RadioButton, Memo, DBLabel, Label, Edit and CheckBox. It's less confusing.
Diffstat (limited to 'src/gui/gui_radiobutton.pas')
-rw-r--r-- | src/gui/gui_radiobutton.pas | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/gui/gui_radiobutton.pas b/src/gui/gui_radiobutton.pas index e091167a..2b847e14 100644 --- a/src/gui/gui_radiobutton.pas +++ b/src/gui/gui_radiobutton.pas @@ -36,7 +36,7 @@ type private FBackgroundColor: TfpgColor; FChecked: boolean; - FColor: TfpgColor; + FTextColor: TfpgColor; FFont: TfpgFont; FGroupIndex: integer; FOnChange: TNotifyEvent; @@ -46,7 +46,7 @@ type function GetFontDesc: string; procedure SetBackgroundColor(const AValue: TfpgColor); procedure SetChecked(const AValue: boolean); - procedure SetColor(const AValue: TfpgColor); + procedure SetTextColor(const AValue: TfpgColor); procedure SetFontDesc(const AValue: string); procedure SetText(const AValue: string); protected @@ -61,10 +61,10 @@ type published property BackgroundColor: TfpgColor read FBackgroundColor write SetBackgroundColor default clWindowBackground; property Checked: boolean read FChecked write SetChecked default False; - property Color: TfpgColor read FColor write SetColor default clText1; property FontDesc: string read GetFontDesc write SetFontDesc; property GroupIndex: integer read FGroupIndex write FGroupIndex; property Text: string read FText write SetText; + property TextColor: TfpgColor read FTextColor write SetTextColor default clText1; property OnChange: TNotifyEvent read FOnChange write FOnChange; end; @@ -123,12 +123,13 @@ begin RePaint; end; -procedure TfpgRadioButton.SetColor(const AValue: TfpgColor); +procedure TfpgRadioButton.SetTextColor(const AValue: TfpgColor); begin - if FColor = AValue then - Exit; - FColor := AValue; - Repaint; + if FTextColor <> AValue then + begin + FTextColor := AValue; + Repaint; + end; end; procedure TfpgRadioButton.SetFontDesc(const AValue: string); @@ -193,7 +194,7 @@ begin ty := (Height div 2) - (Font.Height div 2); if ty < 0 then ty := 0; - Canvas.SetTextColor(FColor); + Canvas.SetTextColor(FTextColor); fpgStyle.DrawString(Canvas, tx, ty, FText, Enabled); Canvas.EndDraw; @@ -241,11 +242,11 @@ end; constructor TfpgRadioButton.Create(AOwner: TComponent); begin inherited Create(AOwner); - FText := 'RadioButton'; - FFont := fpgGetFont('#Label1'); - FHeight := FFont.Height + 4; - FWidth := 120; - + FText := 'RadioButton'; + FFont := fpgGetFont('#Label1'); + FHeight := FFont.Height + 4; + FWidth := 120; + FTextColor := clText1; FBackgroundColor := clWindowBackground; FFocusable := True; FBoxSize := 12; |