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:
micha 2005-12-24 20:53:58 +00:00
parent 75371875fd
commit 0d63c21f78
2 changed files with 10 additions and 4 deletions

View File

@ -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);

View File

@ -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;