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 /src/gui/gui_panel.pas | |
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 'src/gui/gui_panel.pas')
-rw-r--r-- | src/gui/gui_panel.pas | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/gui/gui_panel.pas b/src/gui/gui_panel.pas index 463aaa32..d25271a6 100644 --- a/src/gui/gui_panel.pas +++ b/src/gui/gui_panel.pas @@ -440,6 +440,9 @@ begin Canvas.SetFont(Font); lTxtFlags:= []; + if Enabled then + Include(lTxtFlags, txtEnabled); + if FWrapText then Include(lTxtFlags, txtWrap); case FAlignment of @@ -539,6 +542,7 @@ procedure TfpgGroupBox.HandlePaint; var r: TfpgRect; w: integer; + lTxtFlags: TFTextFlags; begin inherited HandlePaint; @@ -547,6 +551,11 @@ begin r.SetRect(0, 5, Width, Height); Canvas.SetClipRect(r); Canvas.Clear(FBackgroundColor); + + lTxtFlags := TextFlagsDflt; + if not Enabled then + Exclude(lTxtFlags, txtEnabled); + // Canvas.ClearClipRect; // Canvas.SetLineStyle(2, lsSolid); @@ -614,7 +623,7 @@ begin Canvas.SetColor(clHilite2); Canvas.DrawLine(w + 5, 0, w + 5, 6); - Canvas.DrawText(FMargin + 5, 0, FText); + Canvas.DrawText(FMargin + 5, 0, FText, lTxtFlags); end; taRightJustify: begin @@ -645,7 +654,7 @@ begin Canvas.SetColor(clHilite2); Canvas.DrawLine(Width - 6, 0, Width - 6, 6); - Canvas.DrawText(Width - FFont.TextWidth(FText) - FMargin - 5, 0, FText); + Canvas.DrawText(Width - FFont.TextWidth(FText) - FMargin - 5, 0, FText, lTxtFlags); end; taCenter: begin @@ -676,7 +685,7 @@ begin Canvas.SetColor(clHilite2); Canvas.DrawLine(w + FFont.TextWidth(FText) + FMargin * 2 - 1, 0, w + FFont.TextWidth(FText) + FMargin * 2 - 1, 6); - Canvas.DrawText(w + FMargin, 0, FText); + Canvas.DrawText(w + FMargin, 0, FText, lTxtFlags); end; end; end; |