From a64019680b78b73917e99d92591ae3dc6f4d3289 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Mon, 15 Jul 2013 11:42:56 +0100 Subject: CreateComboBox(): specify the default height to be the same as in constructor --- src/gui/fpg_combobox.pas | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/gui') 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; -- cgit v1.2.3-70-g09d2