views: Add groups and focus/blur callbacks (issue #2102)

- cefclient: Only make menus focusable when ALT is pressed.
- cefclient: Display sample top menu when passed the `--show-top-menu`
  command-line flag.
This commit is contained in:
Marshall Greenblatt
2017-02-17 21:08:51 -05:00
parent bd1b80198f
commit 6ed4fe96b8
58 changed files with 1284 additions and 39 deletions

View File

@@ -145,6 +145,20 @@ class CefView : public CefBaseRefCounted {
/*--cef()--*/
virtual void SetID(int id) =0;
///
// Returns the group id of this View, or -1 if not set.
///
/*--cef()--*/
virtual int GetGroupID() =0;
///
// A group id is used to tag Views which are part of the same logical group.
// Focus can be moved between views with the same group using the arrow keys.
// The group id is immutable once it's set.
///
/*--cef()--*/
virtual void SetGroupID(int group_id) =0;
///
// Returns the View that contains this View, if any.
///

View File

@@ -108,6 +108,18 @@ class CefViewDelegate : public virtual CefBaseRefCounted {
virtual void OnChildViewChanged(CefRefPtr<CefView> view,
bool added,
CefRefPtr<CefView> child) {}
///
// Called when |view| gains focus.
///
/*--cef()--*/
virtual void OnFocus(CefRefPtr<CefView> view) {}
///
// Called when |view| loses focus.
///
/*--cef()--*/
virtual void OnBlur(CefRefPtr<CefView> view) {}
};
#endif // CEF_INCLUDE_VIEWS_CEF_WINDOW_DELEGATE_H_