mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-09 16:55:55 +02:00
LCL-GTK2: Fix setting TComboBox ItemIndex. Issue #28683, patch from AlexeyT.
git-svn-id: trunk@53685 -
This commit is contained in:
parent
41c4fca494
commit
4245e9efae
@ -1464,7 +1464,6 @@ var
|
|||||||
ComboWidget: PGtkWidget;
|
ComboWidget: PGtkWidget;
|
||||||
Model: PGtkTreeModel;
|
Model: PGtkTreeModel;
|
||||||
Index: Integer;
|
Index: Integer;
|
||||||
Text: String;
|
|
||||||
Box: PGtkWidget;
|
Box: PGtkWidget;
|
||||||
ItemList: TGtkListStoreStringList;
|
ItemList: TGtkListStoreStringList;
|
||||||
LCLIndex: PLongint;
|
LCLIndex: PLongint;
|
||||||
@ -1487,18 +1486,6 @@ begin
|
|||||||
AWidgetInfo^.DataOwner := True;
|
AWidgetInfo^.DataOwner := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// this should work but may not in all circumstances
|
|
||||||
Index := -1;
|
|
||||||
if AWithEntry = False then
|
|
||||||
begin // the current widget HAS an entry
|
|
||||||
Text:='';
|
|
||||||
GetText(ACustomComboBox, Text);
|
|
||||||
if Text = '' then
|
|
||||||
Index := -1
|
|
||||||
else
|
|
||||||
Index := ACustomComboBox.Items.IndexOf(Text);
|
|
||||||
end;
|
|
||||||
if Index = -1 then
|
|
||||||
Index := GetItemIndex(ACustomComboBox);
|
Index := GetItemIndex(ACustomComboBox);
|
||||||
|
|
||||||
if PGtkComboBoxPrivate(PGtkComboBox(ComboWidget)^.priv)^.button <> nil then
|
if PGtkComboBoxPrivate(PGtkComboBox(ComboWidget)^.priv)^.button <> nil then
|
||||||
|
Loading…
Reference in New Issue
Block a user