diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-09-20 11:07:00 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-09-20 11:07:00 +0200 |
commit | 7fdb64b3d30f2efa05b69f860802a24c947b3d0d (patch) | |
tree | 12ae7f2dba0732d338d05c90f69d0fce90ab0666 /src/gui | |
parent | 76adf3bc4158a3785980d5c1c66ec7a6702001f1 (diff) | |
download | fpGUI-7fdb64b3d30f2efa05b69f860802a24c947b3d0d.tar.xz |
TfpgMessageBox now supports font selection
* we can now adjust the font used via the FontDesc property.
This is handy when using fixed width fonts and displaying
quick keyboard shortcut help.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/fpg_dialogs.pas | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/fpg_dialogs.pas b/src/gui/fpg_dialogs.pas index 074f0a4c..0b5fd01c 100644 --- a/src/gui/fpg_dialogs.pas +++ b/src/gui/fpg_dialogs.pas @@ -94,12 +94,15 @@ type procedure FormPaint(Sender: TObject); procedure FormShow(Sender: TObject); procedure FormKeyPressed(Sender: TObject; var KeyCode: word; var ShiftState: TShiftState; var Consumed: boolean); + function GetFontDesc: string; + procedure SetFontDesc(const AValue: string); public constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure AfterCreate; override; procedure SetMessage(AMessage: string); property CentreText: Boolean read FCentreText write FCentreText default False; + property FontDesc: string read GetFontDesc write SetFontDesc; end; @@ -450,6 +453,18 @@ begin end; end; +function TfpgMessageBox.GetFontDesc: string; +begin + Result := FFont.FontDesc; +end; + +procedure TfpgMessageBox.SetFontDesc(const AValue: string); +begin + FFont.Free; + FFont := fpgGetFont(AValue); + RePaint; +end; + constructor TfpgMessageBox.Create(AOwner: TComponent); begin inherited Create(AOwner); |