diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-03-08 10:39:51 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-03-08 10:39:51 +0200 |
commit | 972da100dc95538b12876c7bc3081efe97a0924c (patch) | |
tree | 5497f2834cec34556b5d2e6e05d0a8695fed2eb0 /src | |
parent | d68d7a267cc4bbc17a566016591e5ddaec804581 (diff) | |
download | fpGUI-972da100dc95538b12876c7bc3081efe97a0924c.tar.xz |
Calendar Check Combo did not paint date text in correct position.
Now it takes into account the height of the component and calculates the
text position accordingly.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/fpg_popupcalendar.pas | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/fpg_popupcalendar.pas b/src/gui/fpg_popupcalendar.pas index ea6eb617..a0eb0f72 100644 --- a/src/gui/fpg_popupcalendar.pas +++ b/src/gui/fpg_popupcalendar.pas @@ -1509,10 +1509,15 @@ end; procedure TfpgCalendarCheckCombo.DoDrawText(const ARect: TfpgRect); var lRect: TfpgRect; +var + flags: TFTextFlags; begin lRect := ARect; lRect.Left := lRect.Left+FCheckBoxRect.Width + 1; - lRect.Width := lRect.Width - (FCheckBoxRect.Width + 1) - FMargin; + lRect.Width := lRect.Width - (FCheckBoxRect.Width + 1); + flags := [txtLeft, txtVCenter]; + if not Enabled then + flags += [txtDisabled]; if HasText then begin if not FChecked then @@ -1524,12 +1529,12 @@ begin else Canvas.SetTextColor(TextColor); end; - fpgStyle.DrawString(Canvas, lRect.Left {FMargin+1}, {lRect.Top }FMargin, Text, Enabled); + Canvas.DrawText(lRect, Text, flags) end else begin Canvas.SetTextColor(clShadow1); - fpgStyle.DrawString(Canvas, lRect.Left {FMargin+1}, {lRect.Top} FMargin, ExtraHint, Enabled); + Canvas.DrawText(lRect, ExtraHint, flags); end; end; |