cgv
Loading...
Searching...
No Matches
menu_provider.h
1#pragma once
2
3#include <cgv/gui/button.h>
4#include <cgv/gui/control.h>
5
6#include "lib_begin.h"
7
8namespace cgv {
9 namespace gui {
10
12class CGV_API menu_provider //: public cgv::signal::tacker
13{
14protected:
17
18 base::base_ptr add_menu_separator(const std::string& menu_path);
20 button_ptr add_menu_button(const std::string& menu_path, const std::string& options = "");
22 data::ref_ptr<control<bool> > add_menu_bool_control(const std::string& menu_path, bool& value, const std::string& options = "");
24
27
28 base::base_ptr find_menu_element(const std::string& menu_path) const;
32public:
38 virtual void create_menu() = 0;
40 virtual void destroy_menu() = 0;
41};
42
43 }
44}
45
46#include <cgv/config/lib_end.h>
reference counted pointer, which can work together with types that are derived from ref_counted,...
Definition ref_ptr.h:160
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
base::base_ptr add_menu_separator(const std::string &menu_path)
add a newly created decorator to the group
virtual void destroy_menu()=0
you must overload this for to remove all elements from the menu again
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...
base::base_ptr find_menu_element(const std::string &menu_path) const
return the element of the given menu path
virtual void create_menu()=0
you must overload this for menu creation
menu_provider()
default construction
void remove_menu_element(base::base_ptr)
remove a single element from the gui
data::ref_ptr< base, true > base_ptr
ref counted pointer to base
Definition base.h:37
namespace that holds the abstract gui interface
Definition vr_calib.cxx:10
data::ref_ptr< button > button_ptr
ref counted pointer to button
Definition button.h:24
this header is dependency free
Definition print.h:11