1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

[NativeMenu] Implement native popup menu support on Windows.

This commit is contained in:
bruvzg
2024-03-07 20:42:24 +02:00
parent 61282068f4
commit ac7583e449
15 changed files with 1501 additions and 56 deletions

View File

@@ -48,6 +48,7 @@ void NativeMenu::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_size", "rid"), &NativeMenu::get_size);
ClassDB::bind_method(D_METHOD("popup", "rid", "position"), &NativeMenu::popup);
ClassDB::bind_method(D_METHOD("set_interface_direction", "rid", "is_rtl"), &NativeMenu::set_interface_direction);
ClassDB::bind_method(D_METHOD("set_popup_open_callback", "rid", "callback"), &NativeMenu::set_popup_open_callback);
ClassDB::bind_method(D_METHOD("get_popup_open_callback", "rid"), &NativeMenu::get_popup_open_callback);
ClassDB::bind_method(D_METHOD("set_popup_close_callback", "rid", "callback"), &NativeMenu::set_popup_close_callback);
@@ -111,6 +112,9 @@ void NativeMenu::_bind_methods() {
BIND_ENUM_CONSTANT(FEATURE_GLOBAL_MENU);
BIND_ENUM_CONSTANT(FEATURE_POPUP_MENU);
BIND_ENUM_CONSTANT(FEATURE_OPEN_CLOSE_CALLBACK);
BIND_ENUM_CONSTANT(FEATURE_HOVER_CALLBACK);
BIND_ENUM_CONSTANT(FEATURE_KEY_CALLBACK);
BIND_ENUM_CONSTANT(INVALID_MENU_ID);
BIND_ENUM_CONSTANT(MAIN_MENU_ID);
@@ -173,6 +177,10 @@ void NativeMenu::popup(const RID &p_rid, const Vector2i &p_position) {
WARN_PRINT("Global menus are not supported on this platform.");
}
void NativeMenu::set_interface_direction(const RID &p_rid, bool p_is_rtl) {
WARN_PRINT("Global menus are not supported on this platform.");
}
void NativeMenu::set_popup_open_callback(const RID &p_rid, const Callable &p_callback) {
WARN_PRINT("Global menus are not supported on this platform.");
}