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

@ -322,6 +322,33 @@ void CEF_CALLBACK button_set_id(struct _cef_view_t* self, int id) {
id);
}
int CEF_CALLBACK button_get_group_id(struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
int _retval = CefButtonCppToC::Get(reinterpret_cast<cef_button_t*>(
self))->GetGroupID();
// Return type: simple
return _retval;
}
void CEF_CALLBACK button_set_group_id(struct _cef_view_t* self, int group_id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Execute
CefButtonCppToC::Get(reinterpret_cast<cef_button_t*>(self))->SetGroupID(
group_id);
}
struct _cef_view_t* CEF_CALLBACK button_get_parent_view(
struct _cef_view_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -916,6 +943,8 @@ CefButtonCppToC::CefButtonCppToC() {
GetStruct()->base.get_window = button_get_window;
GetStruct()->base.get_id = button_get_id;
GetStruct()->base.set_id = button_set_id;
GetStruct()->base.get_group_id = button_get_group_id;
GetStruct()->base.set_group_id = button_set_group_id;
GetStruct()->base.get_parent_view = button_get_parent_view;
GetStruct()->base.get_view_for_id = button_get_view_for_id;
GetStruct()->base.set_bounds = button_set_bounds;