Merged revision(s) 55920 #c5e11a9e95, 55979 #058c0d8e3a from trunk:

LCL: GTK2: Fixed tab cannot go from combobox to combobox. Issue #32458
........
LCL: TComboBox: GTK2: Fixed KeyUp and KeyDown react like tab key after revision 55920 #c5e11a9e95. Issue #32458
........

git-svn-id: branches/fixes_1_8@56982 -
This commit is contained in:
maxim 2018-01-06 13:06:46 +00:00
parent 1a394c8f24
commit 133ffd1010
2 changed files with 17 additions and 4 deletions

View File

@ -783,9 +783,8 @@ begin
LM_SYSKEYDOWN,
LM_SYSKEYUP:
begin
if (ALCLObject is TCustomComboBox) then
ConnectKeyPressReleaseEvents(PgtkObject(PgtkCombo(gObject)^.entry))
else if (ALCLObject is TCustomForm) then
if ((ALCLObject is TCustomComboBox) and gtk_is_combo_box_entry(gObject))
or (ALCLObject is TCustomForm) then
ConnectKeyPressReleaseEvents(gObject);
ConnectKeyPressReleaseEvents(gCore);

View File

@ -1670,6 +1670,13 @@ begin
else
InputObject := AGtkObject;
if TCustomComboBox(AWinControl).Style in [csDropDownList, csOwnerDrawFixed, csOwnerDrawVariable] then
begin
// Just a combobox without a edit should handle its own keys. Issue #32458
Gtk2WidgetSet.SetCallbackDirect(LM_KEYDOWN, InputObject, AWinControl);
Gtk2WidgetSet.SetCallbackDirect(LM_KEYUP, InputObject, AWinControl);
Gtk2WidgetSet.SetCallbackDirect(LM_CHAR, InputObject, AWinControl);
end;
Gtk2WidgetSet.SetCallbackDirect(LM_MOUSEMOVE, InputObject, AWinControl);
Gtk2WidgetSet.SetCallbackDirect(LM_LBUTTONDOWN, InputObject, AWinControl);
Gtk2WidgetSet.SetCallbackDirect(LM_LBUTTONUP, InputObject, AWinControl);
@ -1686,6 +1693,13 @@ begin
// And now the same for the Button in the combo
if AButton<>nil then begin
if TCustomComboBox(AWinControl).Style in [csDropDownList, csOwnerDrawFixed, csOwnerDrawVariable] then
begin
// Just a combobox without a edit should handle its own keys. Issue #32458
Gtk2WidgetSet.SetCallbackDirect(LM_KEYDOWN, AButton, AWinControl);
Gtk2WidgetSet.SetCallbackDirect(LM_KEYUP, AButton, AWinControl);
Gtk2WidgetSet.SetCallbackDirect(LM_CHAR, AButton, AWinControl);
end;
if not GtkWidgetIsA(PGtkWidget(AButton),GTK_TYPE_CELL_VIEW) then begin
Gtk2WidgetSet.SetCallbackDirect(LM_MOUSEENTER, AButton, AWinControl);
Gtk2WidgetSet.SetCallbackDirect(LM_MOUSELEAVE, AButton, AWinControl);
@ -2123,7 +2137,7 @@ begin
Entry := GTK_BIN(WidgetInfo^.CoreWidget)^.child;
Result:=GTK_WIDGET_CAN_FOCUS(Entry);
end else begin
Result:=GTK_WIDGET_CAN_FOCUS(WidgetInfo^.CoreWidget);
Result:=inherited CanFocus(AWinControl);
end;
//DebugLn(['TGtk2WSCustomComboBox.CanFocus ',dbgsName(AWinControl),' ',gtk_is_combo_box_entry(WidgetInfo^.CoreWidget),' Result=',Result]);
end;