summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2013-07-15 11:42:56 +0100
committerGraeme Geldenhuys <graemeg@gmail.com>2013-07-15 11:42:56 +0100
commita64019680b78b73917e99d92591ae3dc6f4d3289 (patch)
treeee2c332092d8189a5b89eac06ebbd3abf59eb94a /src/gui
parent3b9482f2e3bcb15d5faa5474665cf6d6bc1b327e (diff)
downloadfpGUI-a64019680b78b73917e99d92591ae3dc6f4d3289.tar.xz
CreateComboBox(): specify the default height to be the same as in constructor
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/fpg_combobox.pas13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/fpg_combobox.pas b/src/gui/fpg_combobox.pas
index 4a2fa006..111d4c66 100644
--- a/src/gui/fpg_combobox.pas
+++ b/src/gui/fpg_combobox.pas
@@ -1,7 +1,7 @@
{
fpGUI - Free Pascal GUI Toolkit
- Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this
+ Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this
distribution, for details of the copyright.
See the file COPYING.modifiedLGPL, included in this distribution,
@@ -182,7 +182,7 @@ type
function CreateComboBox(AOwner: TComponent; x, y, w: TfpgCoord; AList: TStringList;
- h: TfpgCoord = 0): TfpgComboBox;
+ h: TfpgCoord = 24): TfpgComboBox;
implementation
@@ -537,7 +537,9 @@ end;
function CreateComboBox(AOwner: TComponent; x, y, w: TfpgCoord; AList: TStringList;
- h: TfpgCoord = 0): TfpgComboBox;
+ h: TfpgCoord): TfpgComboBox;
+var
+ lh: integer;
begin
Result := TfpgComboBox.Create(AOwner);
Result.Left := x;
@@ -545,8 +547,9 @@ begin
Result.Width := w;
Result.Focusable := True;
- if h < TfpgComboBox(Result).FFont.Height + (Result.FMargin * 2) then
- Result.Height := TfpgComboBox(Result).FFont.Height + (Result.FMargin * 2)
+ lh := TfpgComboBox(Result).FFont.Height + (Result.FMargin * 2);
+ if h < lh then
+ Result.Height := lh
else
Result.Height := h;