From c4f45a9aad312dac874cc0bbe8d47c053720e35e Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Mon, 7 Feb 2011 16:48:18 +0200 Subject: 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. --- src/gui/fpg_combobox.pas | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/gui/fpg_combobox.pas') 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; -- cgit v1.2.3-70-g09d2