cgv
Loading...
Searching...
No Matches
menu_provider.cxx
1
#include <cgv/gui/gui_driver.h>
2
#include "menu_provider.h"
3
4
namespace
cgv
{
5
namespace
gui {
6
8
cgv::base::base_ptr
menu_provider::add_menu_separator
(
const
std::string& menu_path)
9
{
10
if
(
get_gui_driver
())
11
return
get_gui_driver
()->add_menu_separator(menu_path);
12
return
cgv::base::base_ptr
();
13
}
14
16
button_ptr
menu_provider::add_menu_button
(
const
std::string& menu_path,
const
std::string& options)
17
{
18
if
(
get_gui_driver
())
19
return
get_gui_driver
()->add_menu_button(menu_path, options);
20
return
button_ptr
();
21
}
22
24
data::ref_ptr<control<bool>
>
menu_provider::add_menu_bool_control
(
const
std::string& menu_path,
bool
& value,
const
std::string& options)
25
{
26
if
(
get_gui_driver
())
27
return
get_gui_driver
()->add_menu_bool_control(menu_path, value, options);
28
return
data::ref_ptr<control<bool>
>();
29
}
31
base::base_ptr
menu_provider::find_menu_element
(
const
std::string& menu_path)
const
32
{
33
if
(
get_gui_driver
())
34
return
get_gui_driver
()->find_menu_element(menu_path);
35
return
base::base_ptr
();
36
}
38
void
menu_provider::remove_menu_element
(
base::base_ptr
bp)
39
{
40
if
(
get_gui_driver
())
41
get_gui_driver
()->remove_menu_element(bp);
42
}
44
menu_provider::menu_provider
()
45
{
46
}
48
menu_provider::~menu_provider
()
49
{
50
}
51
52
}
53
}
cgv::data::ref_ptr< base, true >
cgv::gui::menu_provider::add_menu_bool_control
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
Definition
menu_provider.cxx:24
cgv::gui::menu_provider::add_menu_separator
base::base_ptr add_menu_separator(const std::string &menu_path)
add a newly created decorator to the group
Definition
menu_provider.cxx:8
cgv::gui::menu_provider::add_menu_button
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 pat...
Definition
menu_provider.cxx:16
cgv::gui::menu_provider::find_menu_element
base::base_ptr find_menu_element(const std::string &menu_path) const
return the element of the given menu path
Definition
menu_provider.cxx:31
cgv::gui::menu_provider::~menu_provider
~menu_provider()
ensure to remove posted recreation callbacks
Definition
menu_provider.cxx:48
cgv::gui::menu_provider::menu_provider
menu_provider()
default construction
Definition
menu_provider.cxx:44
cgv::gui::menu_provider::remove_menu_element
void remove_menu_element(base::base_ptr)
remove a single element from the gui
Definition
menu_provider.cxx:38
cgv::base::base_ptr
data::ref_ptr< base, true > base_ptr
ref counted pointer to base
Definition
base.h:37
cgv::gui::get_gui_driver
gui_driver_ptr get_gui_driver()
return the currently registered gui driver or an empty pointer if non has been registered
Definition
gui_driver.cxx:18
cgv::gui::button_ptr
data::ref_ptr< button > button_ptr
ref counted pointer to button
Definition
button.h:24
cgv
the cgv namespace
Definition
print.h:11
cgv
gui
menu_provider.cxx
Generated by
1.9.8