mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-08 10:39:15 +02:00
win32: prevent combobox height resizing since windows combobox has fixed height (by Mattias instructions)
git-svn-id: trunk@12638 -
This commit is contained in:
parent
c644f33dc3
commit
a1e7edc076
@ -328,6 +328,11 @@ begin
|
||||
begin
|
||||
FixedHeight := true;
|
||||
FixedWidth := true;
|
||||
end
|
||||
else
|
||||
if SizeConstraints.Control is TCustomComboBox then
|
||||
begin
|
||||
FixedHeight := True; // win32 combo has fixed height
|
||||
end;
|
||||
|
||||
if (FixedHeight or FixedWidth)
|
||||
|
@ -83,6 +83,8 @@ type
|
||||
const AParams: TCreateParams): HWND; override;
|
||||
class procedure AdaptBounds(const AWinControl: TWinControl;
|
||||
var Left, Top, Width, Height: integer; var SuppressMove: boolean); override;
|
||||
class procedure GetPreferredSize(const AWinControl: TWinControl;
|
||||
var PreferredWidth, PreferredHeight: integer; WithThemeSpace: Boolean); override;
|
||||
class function GetSelStart(const ACustomComboBox: TCustomComboBox): integer; override;
|
||||
class function GetSelLength(const ACustomComboBox: TCustomComboBox): integer; override;
|
||||
class function GetItemIndex(const ACustomComboBox: TCustomComboBox): integer; override;
|
||||
@ -768,6 +770,21 @@ begin
|
||||
Height := StringList.ComboHeight;
|
||||
end;
|
||||
|
||||
class procedure TWin32WSCustomComboBox.GetPreferredSize(
|
||||
const AWinControl: TWinControl; var PreferredWidth, PreferredHeight: integer;
|
||||
WithThemeSpace: Boolean);
|
||||
begin
|
||||
if not AWinControl.HandleAllocated then
|
||||
begin
|
||||
// any idea about?
|
||||
PreferredHeight := 0;
|
||||
end
|
||||
else
|
||||
begin
|
||||
PreferredHeight := AWinControl.Height;
|
||||
end;
|
||||
end;
|
||||
|
||||
class function TWin32WSCustomComboBox.GetSelStart(const ACustomComboBox: TCustomComboBox): integer;
|
||||
begin
|
||||
SendMessage(ACustomComboBox.Handle, CB_GETEDITSEL, Windows.WPARAM(@Result), Windows.LPARAM(nil));
|
||||
|
Loading…
Reference in New Issue
Block a user