diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-03-24 17:23:46 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-03-24 17:23:46 +0200 |
commit | 704f5acdcabaddd7567c3eb3d3506b2516bba301 (patch) | |
tree | b25b8fe5f5129aad7842c46406240ae1b2329101 /src/gui/fpg_tab.pas | |
parent | be0c4232d10d02c6cdbb7dad1363f38c1093b90f (diff) | |
download | fpGUI-704f5acdcabaddd7567c3eb3d3506b2516bba301.tar.xz |
tabs: populate tabsheet.Text for UI Designer.
This only occurs in the UI Designer. tabsheet.text will be the same value
as the component Name property.
Diffstat (limited to 'src/gui/fpg_tab.pas')
-rw-r--r-- | src/gui/fpg_tab.pas | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/fpg_tab.pas b/src/gui/fpg_tab.pas index c79c5930..8f3e39af 100644 --- a/src/gui/fpg_tab.pas +++ b/src/gui/fpg_tab.pas @@ -60,6 +60,7 @@ type procedure SetPageControl(APageControl: TfpgPageControl); protected procedure HandlePaint; override; + procedure SetName(const NewName: TComponentName); override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -205,6 +206,19 @@ begin Canvas.Clear(FBackgroundColor); end; +procedure TfpgTabSheet.SetName(const NewName: TComponentName); +var + old: String; +begin + old := NewName; + inherited SetName(NewName); + if (csDesigning in ComponentState) then + begin + if (Text = '') or (Text = old) then + Text := NewName; + end; +end; + constructor TfpgTabSheet.Create(AOwner: TComponent); begin inherited Create(AOwner); |