mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 06:39:12 +02:00
win32: implementing combobox readonly property
git-svn-id: branches/comboboxreadonly@63238 -
This commit is contained in:
parent
bc8507e6b6
commit
dbeeed9c09
@ -99,6 +99,7 @@ type
|
|||||||
class procedure SetItemIndex(const ACustomComboBox: TCustomComboBox; NewIndex: integer); override;
|
class procedure SetItemIndex(const ACustomComboBox: TCustomComboBox; NewIndex: integer); override;
|
||||||
class procedure SetMaxLength(const ACustomComboBox: TCustomComboBox; NewLength: integer); override;
|
class procedure SetMaxLength(const ACustomComboBox: TCustomComboBox; NewLength: integer); override;
|
||||||
class procedure SetStyle(const ACustomComboBox: TCustomComboBox; NewStyle: TComboBoxStyle); override;
|
class procedure SetStyle(const ACustomComboBox: TCustomComboBox; NewStyle: TComboBoxStyle); override;
|
||||||
|
class procedure SetReadOnly(const ACustomComboBox: TCustomComboBox; NewReadOnly: boolean); override;
|
||||||
|
|
||||||
class function GetItems(const ACustomComboBox: TCustomComboBox): TStrings; override;
|
class function GetItems(const ACustomComboBox: TCustomComboBox): TStrings; override;
|
||||||
class procedure Sort(const ACustomComboBox: TCustomComboBox; AList: TStrings; IsSorted: boolean); override;
|
class procedure Sort(const ACustomComboBox: TCustomComboBox; AList: TStrings; IsSorted: boolean); override;
|
||||||
@ -1058,6 +1059,20 @@ begin
|
|||||||
RecreateWnd(ACustomComboBox);
|
RecreateWnd(ACustomComboBox);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class procedure TWin32WSCustomComboBox.SetReadOnly(const ACustomComboBox: TCustomComboBox;
|
||||||
|
NewReadOnly: boolean);
|
||||||
|
var
|
||||||
|
Info: TComboboxInfo;
|
||||||
|
begin
|
||||||
|
if not ACustomComboBox.HandleAllocated then
|
||||||
|
Exit;
|
||||||
|
|
||||||
|
Info.cbSize := SizeOf(Info);
|
||||||
|
Win32Extra.GetComboBoxInfo(ACustomComboBox.Handle, @Info);
|
||||||
|
if (info.hwndItem<>0) and (info.hwndItem<>INVALID_HANDLE_VALUE) then
|
||||||
|
SendMessage(info.hwndItem, EM_SETREADONLY, WParam(NewReadOnly), 0);
|
||||||
|
end;
|
||||||
|
|
||||||
class function TWin32WSCustomComboBox.GetItemIndex(const ACustomComboBox: TCustomComboBox): integer;
|
class function TWin32WSCustomComboBox.GetItemIndex(const ACustomComboBox: TCustomComboBox): integer;
|
||||||
begin
|
begin
|
||||||
Result := SendMessage(ACustomComboBox.Handle, CB_GETCURSEL, 0, 0);
|
Result := SendMessage(ACustomComboBox.Handle, CB_GETCURSEL, 0, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user