mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 22:19:18 +02:00
lcl: move combobox style from win32 to LCL createparams, override unsupported styles in wince
git-svn-id: trunk@25793 -
This commit is contained in:
parent
946321d393
commit
9094e47382
@ -458,6 +458,23 @@ begin
|
|||||||
RegisterCustomComboBox;
|
RegisterCustomComboBox;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomComboBox.CreateParams(var Params: TCreateParams);
|
||||||
|
const
|
||||||
|
ComboBoxStyles: array[TComboBoxStyle] of dword = (
|
||||||
|
CBS_DROPDOWN, CBS_SIMPLE, CBS_DROPDOWNLIST,
|
||||||
|
CBS_OWNERDRAWFIXED, CBS_OWNERDRAWVARIABLE);
|
||||||
|
ComboBoxReadOnlyStyles: array[boolean] of dword = (
|
||||||
|
CBS_DROPDOWN, CBS_DROPDOWNLIST);
|
||||||
|
begin
|
||||||
|
inherited CreateParams(Params);
|
||||||
|
Params.Style := Params.Style or (WS_VSCROLL or CBS_AUTOHSCROLL or CBS_HASSTRINGS) or
|
||||||
|
ComboBoxStyles[Style];
|
||||||
|
if Style in [csOwnerDrawFixed, csOwnerDrawVariable] then
|
||||||
|
Params.Style := Params.Style or ComboBoxReadOnlyStyles[ReadOnly];
|
||||||
|
if Sorted then
|
||||||
|
Params.Style := Params.Style or CBS_SORT;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomComboBox.KeyDown(var Key: Word; Shift: TShiftState);
|
procedure TCustomComboBox.KeyDown(var Key: Word; Shift: TShiftState);
|
||||||
var
|
var
|
||||||
skip : Boolean;
|
skip : Boolean;
|
||||||
|
@ -761,12 +761,8 @@ begin
|
|||||||
// customization of Params
|
// customization of Params
|
||||||
with Params do
|
with Params do
|
||||||
begin
|
begin
|
||||||
Flags := Flags or CalcComboBoxWinFlags(TCustomComboBox(AWinControl));
|
|
||||||
if TComboBox(AWinControl).Sorted Then
|
|
||||||
Flags:= Flags or CBS_SORT;
|
|
||||||
pClassName := ComboboxClsName;
|
pClassName := ComboboxClsName;
|
||||||
pSubClassName := LCLComboboxClsName;
|
pSubClassName := LCLComboboxClsName;
|
||||||
Flags := Flags or (WS_VSCROLL or CBS_AUTOHSCROLL or CBS_HASSTRINGS);
|
|
||||||
SubClassWndProc := @ComboBoxWindowProc;
|
SubClassWndProc := @ComboBoxWindowProc;
|
||||||
end;
|
end;
|
||||||
// create window
|
// create window
|
||||||
|
@ -640,11 +640,9 @@ begin
|
|||||||
// customization of Params
|
// customization of Params
|
||||||
with Params do
|
with Params do
|
||||||
begin
|
begin
|
||||||
Flags := Flags or CalcComboBoxWinFlags(TCustomComboBox(AWinControl));
|
// remove unsupported styles
|
||||||
If TComboBox(AWinControl).Sorted Then
|
Flags := Flags and not (CBS_SIMPLE or CBS_OWNERDRAWFIXED or CBS_OWNERDRAWVARIABLE);
|
||||||
Flags:= Flags or CBS_SORT;
|
|
||||||
pClassName := @ComboboxClsName;
|
pClassName := @ComboboxClsName;
|
||||||
Flags := Flags or (WS_VSCROLL or CBS_AUTOHSCROLL or CBS_HASSTRINGS);
|
|
||||||
SubClassWndProc := @ComboBoxWindowProc;
|
SubClassWndProc := @ComboBoxWindowProc;
|
||||||
end;
|
end;
|
||||||
// create window
|
// create window
|
||||||
|
@ -924,6 +924,16 @@ const
|
|||||||
ES_READONLY = $0800;
|
ES_READONLY = $0800;
|
||||||
ES_WANTRETURN = $1000;
|
ES_WANTRETURN = $1000;
|
||||||
|
|
||||||
|
{ Combobox style }
|
||||||
|
CBS_SIMPLE = $0001;
|
||||||
|
CBS_DROPDOWN = $0002;
|
||||||
|
CBS_DROPDOWNLIST = $0003;
|
||||||
|
CBS_OWNERDRAWFIXED = $0010;
|
||||||
|
CBS_OWNERDRAWVARIABLE = $0020;
|
||||||
|
CBS_AUTOHSCROLL = $0040;
|
||||||
|
CBS_SORT = $0100;
|
||||||
|
CBS_HASSTRINGS = $0200;
|
||||||
|
|
||||||
const
|
const
|
||||||
//==============================================
|
//==============================================
|
||||||
// SetWindowPos Flags
|
// SetWindowPos Flags
|
||||||
|
@ -302,6 +302,7 @@ type
|
|||||||
procedure SetCharCase(eccCharCase: TEditCharCase);
|
procedure SetCharCase(eccCharCase: TEditCharCase);
|
||||||
protected
|
protected
|
||||||
class procedure WSRegisterClass; override;
|
class procedure WSRegisterClass; override;
|
||||||
|
procedure CreateParams(var Params: TCreateParams); override;
|
||||||
procedure InitializeWnd; override;
|
procedure InitializeWnd; override;
|
||||||
procedure DestroyWnd; override;
|
procedure DestroyWnd; override;
|
||||||
procedure DoEnter; override;
|
procedure DoEnter; override;
|
||||||
|
Loading…
Reference in New Issue
Block a user