Open3D (C++ API)
0.11.0
|
#include <Menu.h>
Data Structures | |
struct | Impl |
Public Types | |
using | ItemId = int |
Public Member Functions | |
Menu () | |
virtual | ~Menu () |
void | AddItem (const char *name, ItemId item_id=NO_ITEM, KeyName key=KEY_NONE) |
void | AddMenu (const char *name, std::shared_ptr< Menu > submenu) |
void | AddSeparator () |
void | InsertItem (int index, const char *name, ItemId item_id=NO_ITEM, KeyName key=KEY_NONE) |
void | InsertMenu (int index, const char *name, std::shared_ptr< Menu > submenu) |
void | InsertSeparator (int index) |
int | GetNumberOfItems () const |
bool | IsEnabled (ItemId item_id) const |
void | SetEnabled (ItemId item_id, bool enabled) |
bool | IsChecked (ItemId item_id) const |
void | SetChecked (ItemId item_id, bool checked) |
int | CalcHeight (const Theme &theme) const |
bool | CheckVisibilityChange () const |
Returns true if submenu visibility changed on last call to DrawMenuBar. More... | |
ItemId | DrawMenuBar (const DrawContext &context, bool is_enabled) |
ItemId | Draw (const DrawContext &context, const char *name, bool is_enabled) |
Static Public Attributes | |
static constexpr ItemId | NO_ITEM = -1 |
Protected Member Functions | |
void * | GetNativePointer () |
Friends | |
class | Application |
The menu item action is handled by Window, rather than by registering a a callback function with (non-existent) Menu::SetOnClicked(). This is because on macOS the menubar is global over all application windows, so any callback would need to go find the data object corresponding to the active window.
using open3d::visualization::gui::Menu::ItemId = int |
open3d::visualization::gui::Menu::Menu | ( | ) |
|
virtual |
void open3d::visualization::gui::Menu::AddItem | ( | const char * | name, |
ItemId | item_id = NO_ITEM , |
||
KeyName | key = KEY_NONE |
||
) |
void open3d::visualization::gui::Menu::AddMenu | ( | const char * | name, |
std::shared_ptr< Menu > | submenu | ||
) |
void open3d::visualization::gui::Menu::AddSeparator | ( | ) |
int open3d::visualization::gui::Menu::CalcHeight | ( | const Theme & | theme | ) | const |
bool open3d::visualization::gui::Menu::CheckVisibilityChange | ( | ) | const |
Returns true if submenu visibility changed on last call to DrawMenuBar.
Menu::ItemId open3d::visualization::gui::Menu::Draw | ( | const DrawContext & | context, |
const char * | name, | ||
bool | is_enabled | ||
) |
Menu::ItemId open3d::visualization::gui::Menu::DrawMenuBar | ( | const DrawContext & | context, |
bool | is_enabled | ||
) |
|
protected |
int open3d::visualization::gui::Menu::GetNumberOfItems | ( | ) | const |
void open3d::visualization::gui::Menu::InsertItem | ( | int | index, |
const char * | name, | ||
ItemId | item_id = NO_ITEM , |
||
KeyName | key = KEY_NONE |
||
) |
void open3d::visualization::gui::Menu::InsertMenu | ( | int | index, |
const char * | name, | ||
std::shared_ptr< Menu > | submenu | ||
) |
void open3d::visualization::gui::Menu::InsertSeparator | ( | int | index | ) |
bool open3d::visualization::gui::Menu::IsChecked | ( | ItemId | item_id | ) | const |
bool open3d::visualization::gui::Menu::IsEnabled | ( | ItemId | item_id | ) | const |
Searches the menu hierarchy down from this menu to find the item and returns true if the item is enabled.
void open3d::visualization::gui::Menu::SetChecked | ( | ItemId | item_id, |
bool | checked | ||
) |
void open3d::visualization::gui::Menu::SetEnabled | ( | ItemId | item_id, |
bool | enabled | ||
) |
Searches the menu hierarchy down from this menu to find the item and set it enabled according to enabled
.
|
friend |
|
static |