mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 11:59:08 +02:00
win32: combobox: don't check for current style in SetStyle
git-svn-id: trunk@55274 -
This commit is contained in:
parent
d31c78df1c
commit
fc02cb8e2a
@ -933,20 +933,6 @@ end;
|
||||
|
||||
{ TWin32WSCustomComboBox }
|
||||
|
||||
const
|
||||
ComboBoxStylesMask = CBS_DROPDOWN or CBS_DROPDOWN or CBS_DROPDOWNLIST or
|
||||
CBS_OWNERDRAWFIXED or CBS_OWNERDRAWVARIABLE;
|
||||
|
||||
function CalcComboBoxWinFlags(AComboBox: TCustomComboBox): dword;
|
||||
const
|
||||
ComboBoxStyles: array[TComboBoxStyle] of dword = (
|
||||
CBS_DROPDOWN, CBS_SIMPLE, CBS_DROPDOWNLIST,
|
||||
CBS_OWNERDRAWFIXED or CBS_DROPDOWNLIST, CBS_OWNERDRAWVARIABLE or CBS_DROPDOWNLIST,
|
||||
CBS_OWNERDRAWFIXED or CBS_DROPDOWN, CBS_OWNERDRAWVARIABLE or CBS_DROPDOWN);
|
||||
begin
|
||||
Result := ComboBoxStyles[AComboBox.Style];
|
||||
end;
|
||||
|
||||
class function TWin32WSCustomComboBox.GetStringList(
|
||||
const ACustomComboBox: TCustomComboBox): TWin32ComboBoxStringList;
|
||||
begin
|
||||
@ -1043,13 +1029,7 @@ begin
|
||||
end;
|
||||
|
||||
class procedure TWin32WSCustomComboBox.SetStyle(const ACustomComboBox: TCustomComboBox; NewStyle: TComboBoxStyle);
|
||||
var
|
||||
CurrentStyle: DWord;
|
||||
begin
|
||||
CurrentStyle := GetWindowLong(ACustomComboBox.Handle, GWL_STYLE);
|
||||
if (CurrentStyle and ComboBoxStylesMask) = CalcComboBoxWinFlags(ACustomComboBox) then
|
||||
Exit;
|
||||
|
||||
RecreateWnd(ACustomComboBox);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user