From 2d40e8a38c71d815701e49c8bd91a12a3d134e0d Mon Sep 17 00:00:00 2001 From: blikblum Date: Sun, 25 Dec 2011 20:07:31 +0000 Subject: [PATCH] gtk2: update combo text only if has a edit box git-svn-id: trunk@34414 - --- lcl/interfaces/gtk2/gtk2wsstdctrls.pp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lcl/interfaces/gtk2/gtk2wsstdctrls.pp b/lcl/interfaces/gtk2/gtk2wsstdctrls.pp index d46be0c160..52458bca9b 100644 --- a/lcl/interfaces/gtk2/gtk2wsstdctrls.pp +++ b/lcl/interfaces/gtk2/gtk2wsstdctrls.pp @@ -1937,22 +1937,14 @@ class procedure TGtk2WSCustomComboBox.SetText(const AWinControl: TWinControl; var WidgetInfo: PWidgetInfo; Entry: PGtkWidget; - Index: Integer; begin WidgetInfo := GetWidgetInfo(Pointer(AWinControl.Handle)); // we use user ChangeLock to not signal onchange Inc(WidgetInfo^.ChangeLock); - if gtk_is_combo_box_entry(WidgetInfo^.CoreWidget) then begin + if gtk_is_combo_box_entry(WidgetInfo^.CoreWidget) then + begin Entry := GTK_BIN(WidgetInfo^.CoreWidget)^.child; gtk_entry_set_text(PGtkEntry(Entry), PChar(AText)); - end - else begin - // if not an entry it is a readonly list so we will try to comply by matching the text to an item - if AText = '' then - Index := -1 - else - Index := TCustomComboBox(AWinControl).Items.IndexOf(AText); - SetItemIndex(TCustomComboBox(AWinControl), Index); end; Dec(WidgetInfo^.ChangeLock); end;