mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 06:20:22 +02:00
easier readable code for storage decision of ReadOnly
recreate control in case readonly changed for win32 git-svn-id: trunk@8363 -
This commit is contained in:
parent
75371875fd
commit
0d63c21f78
@ -820,11 +820,10 @@ end;
|
||||
|
||||
function TCustomComboBox.IsReadOnlyStored: boolean;
|
||||
begin
|
||||
case FStyle of
|
||||
csSimple, csDropDown, csDropDownList: Result := false;
|
||||
else
|
||||
// these styles imply readonly value
|
||||
Result := not (FStyle in [csSimple, csDropDown, csDropDownList]);
|
||||
if Result then
|
||||
Result := FReadOnly <> false;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomComboBox.SetReadOnly(const AValue: Boolean);
|
||||
|
@ -93,6 +93,7 @@ type
|
||||
class procedure SetSelLength(const ACustomComboBox: TCustomComboBox; NewLength: integer); override;
|
||||
class procedure SetItemIndex(const ACustomComboBox: TCustomComboBox; NewIndex: integer); override;
|
||||
class procedure SetMaxLength(const ACustomComboBox: TCustomComboBox; NewLength: integer); override;
|
||||
class procedure SetReadOnly(const ACustomComboBox: TCustomComboBox; NewReadOnly: boolean); override;
|
||||
class procedure SetStyle(const ACustomComboBox: TCustomComboBox; NewStyle: TComboBoxStyle); override;
|
||||
class procedure SetText(const AWinControl: TWinControl; const AText: string); override;
|
||||
|
||||
@ -720,6 +721,12 @@ begin
|
||||
GetWindowInfo(winhandle)^.MaxLength := NewLength;
|
||||
end;
|
||||
|
||||
procedure TWin32WSCustomComboBox.SetReadOnly(const ACustomComboBox: TCustomComboBox;
|
||||
NewReadOnly: boolean);
|
||||
begin
|
||||
RecreateWnd(ACustomComboBox);
|
||||
end;
|
||||
|
||||
procedure TWin32WSCustomComboBox.SetText(const AWinControl: TWinControl; const AText: string);
|
||||
var
|
||||
Handle: HWND;
|
||||
|
Loading…
Reference in New Issue
Block a user