mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-16 00:22:40 +02:00
LCL-GTK3: Implement setting Combobox caption. Issue #35685, patch from Anton Kavalenka.
git-svn-id: trunk@62101 -
This commit is contained in:
parent
8f67f44fcd
commit
ba9f2d75a3
@ -5938,7 +5938,9 @@ var
|
||||
ACombo: TCustomComboBox;
|
||||
ListStore: PGtkListStore;
|
||||
ItemList: TGtkListStoreStringList;
|
||||
Renderer : PGtkCellRenderer;
|
||||
Renderer: PGtkCellRenderer;
|
||||
bs: string;
|
||||
pos: gint;
|
||||
begin
|
||||
FWidgetType := FWidgetType + [wtTreeModel, wtComboBox];
|
||||
ACombo := TCustomComboBox(LCLObject);
|
||||
@ -5959,6 +5961,11 @@ begin
|
||||
// do not allow combo button to get focus, entry should take focus
|
||||
if PGtkComboBox(Result)^.priv3^.button <> nil then
|
||||
PGtkComboBox(Result)^.priv3^.button^.set_can_focus(False);
|
||||
|
||||
bs := Self.LCLObject.Caption;
|
||||
pos := 0;
|
||||
PGtkEditable(PGtkComboBox(Result)^.get_child)^.insert_text(pgChar(PChar(bs)),length(bs),@pos);
|
||||
|
||||
// set lclwidget data to entry
|
||||
g_object_set_data(PGtkComboBox(Result)^.get_child, 'lclwidget', Self);
|
||||
// when we scroll with mouse wheel over entry our scrollevent doesn't catch entry
|
||||
|
Loading…
Reference in New Issue
Block a user