mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-30 09:02:48 +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);
|
||||
end;
|
||||
|
||||
procedure GtkComboFocus(AWidget: PGtkWidget; WidgetInfo: PWidgetInfo); cdecl;
|
||||
begin
|
||||
LCLSendSetFocusMsg(TControl(WidgetInfo^.LCLObject));
|
||||
end;
|
||||
|
||||
procedure GtkPopupShowCB(AMenu: PGtkMenuShell; WidgetInfo: PWidgetInfo); cdecl;
|
||||
begin
|
||||
LCLSendSetFocusMsg(TControl(WidgetInfo^.LCLObject));
|
||||
// let the LCL change the items on the fly:
|
||||
LCLSendDropDownMsg(TControl(WidgetInfo^.LCLObject));
|
||||
end;
|
||||
@ -1393,6 +1399,7 @@ var
|
||||
begin
|
||||
if pspec^.name = 'popup-shown' then
|
||||
begin
|
||||
LCLSendSetFocusMsg(TControl(WidgetInfo^.LCLObject));
|
||||
FillChar(AValue, SizeOf(AValue), 0); // fill by zeros
|
||||
g_value_init(@AValue, G_TYPE_BOOLEAN); // initialize for boolean
|
||||
g_object_get_property(AObject, pspec^.name, @AValue); // get property value
|
||||
@ -1511,10 +1518,8 @@ begin
|
||||
end;
|
||||
|
||||
// if we are a GtkComboBoxEntry
|
||||
if GtkWidgetIsA(PGtkWidget(AEntry), GTK_TYPE_ENTRY) then
|
||||
begin
|
||||
// Anything?
|
||||
end;
|
||||
if not GtkWidgetIsA(PGtkWidget(AEntry), GTK_TYPE_ENTRY) then
|
||||
g_signal_connect(Combowidget, 'grab-focus', TGCallback(@GtkComboFocus), AWidgetInfo);
|
||||
|
||||
AMenu := nil;
|
||||
if (APrivate^.popup_widget <> nil)
|
||||
|
Loading…
Reference in New Issue
Block a user