diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-02-07 16:48:18 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-02-07 16:48:18 +0200 |
commit | c4f45a9aad312dac874cc0bbe8d47c053720e35e (patch) | |
tree | 19b77a1e7dff40245bba567ca931928c91845d50 | |
parent | 13073ffeaf198bc1244218088878b0eebcae6510 (diff) | |
download | fpGUI-c4f45a9aad312dac874cc0bbe8d47c053720e35e.tar.xz |
ComboBox: text position is now the same as TfpgEdit.
We now use Canvas.DrawString() to auto calculate the text position
based on the text flags passed in. This is now the same as TfpgEdit does.
-rw-r--r-- | src/gui/fpg_combobox.pas | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/fpg_combobox.pas b/src/gui/fpg_combobox.pas index 1153e94c..5cbccc10 100644 --- a/src/gui/fpg_combobox.pas +++ b/src/gui/fpg_combobox.pas @@ -584,14 +584,19 @@ begin end; procedure TfpgBaseStaticCombo.DoDrawText(const ARect: TfpgRect); +var + flags: TFTextFlags; begin // Draw select item's text + flags := [txtLeft, txtVCenter]; + if not Enabled then + flags += [txtDisabled]; if HasText then - fpgStyle.DrawString(Canvas, FMargin+1, FMargin, Text, Enabled) + Canvas.DrawText(ARect, Text, flags) else begin Canvas.SetTextColor(clShadow1); - fpgStyle.DrawString(Canvas, FMargin+1, FMargin, ExtraHint, Enabled); + Canvas.DrawText(ARect, ExtraHint, flags); end; end; |