From 34400c5c356449c0e6a13f1417a99edcc446d605 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Mon, 7 Feb 2011 16:50:56 +0200 Subject: ComboBox: New Margin default 3 -> 1. The Margin is how many pixels from the internal background the text must appear. Later we will replace this with SideMargin and HeightMargin properties. --- src/gui/fpg_combobox.pas | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/fpg_combobox.pas b/src/gui/fpg_combobox.pas index 5cbccc10..19028530 100644 --- a/src/gui/fpg_combobox.pas +++ b/src/gui/fpg_combobox.pas @@ -28,7 +28,7 @@ unit fpg_combobox; { TODO: Implement .BeginUpdate and .EndUpdate methods so we know when to refresh the items list. } -{ TODO: Introduce SideMargin and TopMargin like TfpgEdit, instead of just +{ TODO: Introduce SideMargin and HeightMargin like TfpgEdit, instead of just the single Margin property. } { @@ -104,7 +104,7 @@ type property FontDesc: string read GetFontDesc write SetFontDesc; property Items: TStringList read FItems; {$Note Make this read/write } property Options: TfpgComboOptions read FOptions write FOptions; - property Margin: integer read FMargin write SetMargin default 3; + property Margin: integer read FMargin write SetMargin default 1; property OnChange: TNotifyEvent read FOnChange write FOnChange; property OnCloseUp: TNotifyEvent read FOnCloseUp write FOnCloseUp; property OnDropDown: TNotifyEvent read FOnDropDown write FOnDropDown; @@ -423,7 +423,7 @@ begin FHeight := 24; FAutoSize := False; FDropDownCount := 8; - FMargin := 3; + FMargin := 1; FFocusItem := -1; // nothing is selected FItems := TStringList.Create; FItems.OnChange := @InternalItemsChanged; @@ -721,6 +721,8 @@ begin else Canvas.SetColor(clWindowBackground); Canvas.SetTextColor(FTextColor); + r.Left := r.Left + Margin; + r.Width := r.Width - Margin; end; Canvas.FillRectangle(r); -- cgit v1.2.3-70-g09d2