summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2011-02-07 16:50:56 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2011-02-07 16:50:56 +0200
commit34400c5c356449c0e6a13f1417a99edcc446d605 (patch)
treee469459b7dbf03b4b16265b137d866538d92fcd0
parentc4f45a9aad312dac874cc0bbe8d47c053720e35e (diff)
downloadfpGUI-34400c5c356449c0e6a13f1417a99edcc446d605.tar.xz
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.
-rw-r--r--src/gui/fpg_combobox.pas8
1 files 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);