cgv
Loading...
Searching...
No Matches
cgv::gui::menu_provider Class Referenceabstract

derive from this class to provide a gui to the current viewer More...

#include <menu_provider.h>

Protected Member Functions

creation of menu entries
base::base_ptr add_menu_separator (const std::string &menu_path)
 add a newly created decorator to the group
 
button_ptr add_menu_button (const std::string &menu_path, const std::string &options="")
 use the current gui driver to append a new button in the menu, where menu path is a '/' separated path
 
data::ref_ptr< control< bool > > add_menu_bool_control (const std::string &menu_path, bool &value, const std::string &options="")
 use this to add a new control to the gui with a given value type, gui type and init options
 

update menu

base::base_ptr find_menu_element (const std::string &menu_path) const
 return the element of the given menu path
 
void remove_menu_element (base::base_ptr)
 remove a single element from the gui
 
 menu_provider ()
 default construction
 
 ~menu_provider ()
 ensure to remove posted recreation callbacks
 
virtual void create_menu ()=0
 you must overload this for menu creation
 
virtual void destroy_menu ()=0
 you must overload this for to remove all elements from the menu again
 

Detailed Description

derive from this class to provide a gui to the current viewer

Definition at line 12 of file menu_provider.h.

Constructor & Destructor Documentation

◆ menu_provider()

cgv::gui::menu_provider::menu_provider ( )

default construction

Definition at line 44 of file menu_provider.cxx.

◆ ~menu_provider()

cgv::gui::menu_provider::~menu_provider ( )

ensure to remove posted recreation callbacks

Definition at line 48 of file menu_provider.cxx.

Member Function Documentation

◆ add_menu_bool_control()

data::ref_ptr< control< bool > > cgv::gui::menu_provider::add_menu_bool_control ( const std::string &  menu_path,
bool &  value,
const std::string &  options = "" 
)
protected

use this to add a new control to the gui with a given value type, gui type and init options

Definition at line 24 of file menu_provider.cxx.

References cgv::gui::get_gui_driver().

◆ add_menu_button()

button_ptr cgv::gui::menu_provider::add_menu_button ( const std::string &  menu_path,
const std::string &  options = "" 
)
protected

use the current gui driver to append a new button in the menu, where menu path is a '/' separated path

Definition at line 16 of file menu_provider.cxx.

References cgv::gui::get_gui_driver().

◆ add_menu_separator()

cgv::base::base_ptr cgv::gui::menu_provider::add_menu_separator ( const std::string &  menu_path)
protected

add a newly created decorator to the group

Definition at line 8 of file menu_provider.cxx.

References cgv::gui::get_gui_driver().

◆ find_menu_element()

base::base_ptr cgv::gui::menu_provider::find_menu_element ( const std::string &  menu_path) const
protected

return the element of the given menu path

Definition at line 31 of file menu_provider.cxx.

References cgv::gui::get_gui_driver().

◆ remove_menu_element()

void cgv::gui::menu_provider::remove_menu_element ( base::base_ptr  bp)
protected

remove a single element from the gui

Definition at line 38 of file menu_provider.cxx.

References cgv::gui::get_gui_driver().


The documentation for this class was generated from the following files: