mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-18 09:26:03 +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;
|
ACombo: TCustomComboBox;
|
||||||
ListStore: PGtkListStore;
|
ListStore: PGtkListStore;
|
||||||
ItemList: TGtkListStoreStringList;
|
ItemList: TGtkListStoreStringList;
|
||||||
Renderer : PGtkCellRenderer;
|
Renderer: PGtkCellRenderer;
|
||||||
|
bs: string;
|
||||||
|
pos: gint;
|
||||||
begin
|
begin
|
||||||
FWidgetType := FWidgetType + [wtTreeModel, wtComboBox];
|
FWidgetType := FWidgetType + [wtTreeModel, wtComboBox];
|
||||||
ACombo := TCustomComboBox(LCLObject);
|
ACombo := TCustomComboBox(LCLObject);
|
||||||
@ -5959,6 +5961,11 @@ begin
|
|||||||
// do not allow combo button to get focus, entry should take focus
|
// do not allow combo button to get focus, entry should take focus
|
||||||
if PGtkComboBox(Result)^.priv3^.button <> nil then
|
if PGtkComboBox(Result)^.priv3^.button <> nil then
|
||||||
PGtkComboBox(Result)^.priv3^.button^.set_can_focus(False);
|
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
|
// set lclwidget data to entry
|
||||||
g_object_set_data(PGtkComboBox(Result)^.get_child, 'lclwidget', Self);
|
g_object_set_data(PGtkComboBox(Result)^.get_child, 'lclwidget', Self);
|
||||||
// when we scroll with mouse wheel over entry our scrollevent doesn't catch entry
|
// when we scroll with mouse wheel over entry our scrollevent doesn't catch entry
|
||||||
|
Loading…
Reference in New Issue
Block a user