Supports navigating between tabs, as well as their buttons, toolbars, and galleries.
There are new public implementation functions, but I didn't document them as they seem more like internal functions that client don't really need to see.
Tested on MSW, macOS, and Linux Mint.
https://github.com/wxWidgets/wxWidgets/pull/27046
(13 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@vadz approved this pull request.
Thanks!
There is a lot of new code here and it's a bit surprising that it seems to be completely independent of all the existing code supporting keyboard navigation (e.g. shouldn't wxWindow::DoNavigateIn() be overridden somewhere?) but, as with the PR adding accelerators display, this is clearly valuable for the users, so let's merge it if nobody sees any problems with it (I'll leave it unmerged for a couple of days to give people a chance to comment).
> @@ -263,6 +303,11 @@ class WXDLLIMPEXP_RIBBON wxRibbonBar : public wxRibbonControl
wxVector<wxImageList*> m_image_lists;
+ // The control whose item has the keyboard focus, null if it's on the tabs.
+ wxWeakRef<wxRibbonControl> m_focusedStop;
Why is it called "stop"?
In include/wx/ribbon/control.h:
> @@ -62,6 +64,31 @@ class WXDLLIMPEXP_RIBBON wxRibbonControl : public wxControl
// Finds the best width and height given the parent's width and height
virtual wxSize GetBestSizeForParentSize(const wxSize& WXUNUSED(parentSize)) const { return GetBestSize(); }
+ // Implementation only: keyboard navigation of the items inside a control.
+ //
+ // The keyboard focus always stays on wxRibbonBar, which forwards the keys
+ // to these functions. A control with items which can be selected with the
+ // keyboard returns true from HasFocusableItems() and overrides the rest.
+ virtual bool HasFocusableItems() const { return false; }
Is this really different from wxWindow::CanAcceptFocus()?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@Blake-Madden commented on this pull request.
> @@ -263,6 +303,11 @@ class WXDLLIMPEXP_RIBBON wxRibbonBar : public wxRibbonControl
wxVector<wxImageList*> m_image_lists;
+ // The control whose item has the keyboard focus, null if it's on the tabs.
+ wxWeakRef<wxRibbonControl> m_focusedStop;
Yes, "control" or "item" is a better name. I was thinking that as you tab or arrow, it "stops" on that control. I'll reword that...
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@Blake-Madden commented on this pull request.
In include/wx/ribbon/control.h:
> @@ -62,6 +64,31 @@ class WXDLLIMPEXP_RIBBON wxRibbonControl : public wxControl
// Finds the best width and height given the parent's width and height
virtual wxSize GetBestSizeForParentSize(const wxSize& WXUNUSED(parentSize)) const { return GetBestSize(); }
+ // Implementation only: keyboard navigation of the items inside a control.
+ //
+ // The keyboard focus always stays on wxRibbonBar, which forwards the keys
+ // to these functions. A control with items which can be selected with the
+ // keyboard returns true from HasFocusableItems() and overrides the rest.
+ virtual bool HasFocusableItems() const { return false; }
I was thinking CanAcceptFocus() is about if the window itself can receive the focus. Here, the ribbon bar always keeps the focus. This checks if the control has any item the bar can move the focus to. (For example, a button bar with all buttons disabled has none.) I'm updating the comment.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@Blake-Madden pushed 1 commit.
—
View it on GitHub or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()