mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-07 13:38:16 +02:00
LCL GTK2: fire OnExit event when leaving Combobox. Patch by August Klein, issue #18962
git-svn-id: trunk@30564 -
This commit is contained in:
parent
ea174afc6b
commit
5ee9d4d079
@ -1368,8 +1368,14 @@ begin
|
|||||||
@LCLIntfCellRenderer_CellDataFunc, AWidgetInfo, nil);
|
@LCLIntfCellRenderer_CellDataFunc, AWidgetInfo, nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure GtkComboFocus(AWidget: PGtkWidget; WidgetInfo: PWidgetInfo); cdecl;
|
||||||
|
begin
|
||||||
|
LCLSendSetFocusMsg(TControl(WidgetInfo^.LCLObject));
|
||||||
|
end;
|
||||||
|
|
||||||
procedure GtkPopupShowCB(AMenu: PGtkMenuShell; WidgetInfo: PWidgetInfo); cdecl;
|
procedure GtkPopupShowCB(AMenu: PGtkMenuShell; WidgetInfo: PWidgetInfo); cdecl;
|
||||||
begin
|
begin
|
||||||
|
LCLSendSetFocusMsg(TControl(WidgetInfo^.LCLObject));
|
||||||
// let the LCL change the items on the fly:
|
// let the LCL change the items on the fly:
|
||||||
LCLSendDropDownMsg(TControl(WidgetInfo^.LCLObject));
|
LCLSendDropDownMsg(TControl(WidgetInfo^.LCLObject));
|
||||||
end;
|
end;
|
||||||
@ -1393,6 +1399,7 @@ var
|
|||||||
begin
|
begin
|
||||||
if pspec^.name = 'popup-shown' then
|
if pspec^.name = 'popup-shown' then
|
||||||
begin
|
begin
|
||||||
|
LCLSendSetFocusMsg(TControl(WidgetInfo^.LCLObject));
|
||||||
FillChar(AValue, SizeOf(AValue), 0); // fill by zeros
|
FillChar(AValue, SizeOf(AValue), 0); // fill by zeros
|
||||||
g_value_init(@AValue, G_TYPE_BOOLEAN); // initialize for boolean
|
g_value_init(@AValue, G_TYPE_BOOLEAN); // initialize for boolean
|
||||||
g_object_get_property(AObject, pspec^.name, @AValue); // get property value
|
g_object_get_property(AObject, pspec^.name, @AValue); // get property value
|
||||||
@ -1511,10 +1518,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// if we are a GtkComboBoxEntry
|
// if we are a GtkComboBoxEntry
|
||||||
if GtkWidgetIsA(PGtkWidget(AEntry), GTK_TYPE_ENTRY) then
|
if not GtkWidgetIsA(PGtkWidget(AEntry), GTK_TYPE_ENTRY) then
|
||||||
begin
|
g_signal_connect(Combowidget, 'grab-focus', TGCallback(@GtkComboFocus), AWidgetInfo);
|
||||||
// Anything?
|
|
||||||
end;
|
|
||||||
|
|
||||||
AMenu := nil;
|
AMenu := nil;
|
||||||
if (APrivate^.popup_widget <> nil)
|
if (APrivate^.popup_widget <> nil)
|
||||||
|
Loading…
Reference in New Issue
Block a user