diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-05-26 10:16:51 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-05-26 10:16:51 +0000 |
commit | a3d1ea22c42ed9bb4af11a301db195f67137f85e (patch) | |
tree | e712cf38fd1e3ddf6db762e9996a88d7a2aa8687 /src/gui/gui_tab.pas | |
parent | 5e4d176d195b6cc666c48c5cd69aeb3030909324 (diff) | |
download | fpGUI-a3d1ea22c42ed9bb4af11a301db195f67137f85e.tar.xz |
* TextFlagsDflt now contains txtEnabled
* DrawText now takes the txtEnabled flag into account. Before it always
assumed Enabled = True.
* gui_tab now uses Canvas.DrawText instead of Canvas.DrawString
* gui_label now paints disabled text correctly.
Diffstat (limited to 'src/gui/gui_tab.pas')
-rw-r--r-- | src/gui/gui_tab.pas | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/gui_tab.pas b/src/gui/gui_tab.pas index 52bd8885..adda9f58 100644 --- a/src/gui/gui_tab.pas +++ b/src/gui/gui_tab.pas @@ -463,6 +463,7 @@ var lp: integer; toffset: integer; dx: integer; + lTxtFlags: TFTextFlags; begin if not HasHandle then Exit; //==> @@ -475,6 +476,9 @@ begin Exit; Canvas.BeginDraw; Canvas.SetTextColor(TextColor); + lTxtFlags := TextFlagsDflt; + if not Enabled then + Exclude(lTxtFlags, txtEnabled); case TabPosition of tpBottom: @@ -610,9 +614,9 @@ begin r2.Width := ButtonWidth(h.Text); r3 := DrawTab(r2, h = ActivePage); - // paint text + // paint text on non-active tabs if h <> ActivePage then - Canvas.DrawString(lp + (ButtonWidth(h.Text) div 2) - FFont.TextWidth(GetTabText(h.Text)) div 2, FMargin+toffset, GetTabText(h.Text)); + Canvas.DrawText(lp + (ButtonWidth(h.Text) div 2) - FFont.TextWidth(GetTabText(h.Text)) div 2, FMargin+toffset, GetTabText(h.Text), lTxtFlags); r2.Left := r2.Left + r2.Width; lp := lp + ButtonWidth(h.Text); @@ -630,7 +634,7 @@ begin // Draw text of ActivePage, because we didn't before. DrawTab(r3, false, 2); - Canvas.DrawText(r3.Left+4, r3.Top+3, r3.Width, r3.Height, ActivePage.Text, [txtLeft, txtTop]); + Canvas.DrawText(r3.Left+4, r3.Top+3, r3.Width, r3.Height, ActivePage.Text, lTxtFlags); end; end; |