mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 17:30:21 +02:00
gtk2: support for combobox readonly
git-svn-id: branches/comboboxreadonly@63239 -
This commit is contained in:
parent
dbeeed9c09
commit
02b7d44d7d
@ -129,6 +129,7 @@ type
|
||||
class procedure SetItemIndex(const ACustomComboBox: TCustomComboBox; NewIndex: integer); override;
|
||||
class procedure SetMaxLength(const ACustomComboBox: TCustomComboBox; NewLength: integer); 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 procedure Sort(const ACustomComboBox: TCustomComboBox; {%H-}AList: TStrings; IsSorted: boolean); override;
|
||||
@ -2014,6 +2015,19 @@ begin
|
||||
ReCreateCombo(ACustomComboBox, NeedEntry, WidgetInfo);
|
||||
end;
|
||||
|
||||
class procedure TGtk2WSCustomComboBox.SetReadOnly(
|
||||
const ACustomComboBox: TCustomComboBox; NewReadOnly: boolean);
|
||||
var
|
||||
WidgetInfo: PWidgetInfo;
|
||||
Entry: PGtkEntry;
|
||||
begin
|
||||
WidgetInfo := GetWidgetInfo({%H-}Pointer(ACustomComboBox.Handle));
|
||||
|
||||
Entry := GetComboBoxEntry(WidgetInfo^.CoreWidget);
|
||||
if (Entry<>nil) and (ACustomComboBox.Style in [csDropDown, csOwnerDrawEditableFixed, csOwnerDrawEditableVariable, csSimple]) then
|
||||
gtk_entry_set_editable(PGtkEditable(Entry), not NewReadOnly);
|
||||
end;
|
||||
|
||||
class function TGtk2WSCustomComboBox.GetItems(
|
||||
const ACustomComboBox: TCustomComboBox): TStrings;
|
||||
var
|
||||
|
Loading…
Reference in New Issue
Block a user