3#include <cgv/base/group.h>
4#include <cgv/type/cond/is_enum.h>
5#include <cgv/type/info/type_name.h>
6#include <cgv/base/register.h>
13template <typename T, bool is_enum = cgv::type::cond::is_enum<T>::value>
21 static const char*
get_name() {
return "enum"; }
27class CGV_API gui_group;
28class CGV_API provider;
55 std::string get_type_name()
const;
68 void release_all_managed_objects();
77 virtual bool multiple_selection()
const;
82 virtual void select_child(
unsigned ci,
bool exclusive =
false);
88 virtual bool unselect_child(
unsigned ci);
94 virtual int get_selected_child_index()
const;
104 bool is_selected(
unsigned ci)
const;
114 virtual bool can_open_and_close()
const;
118 bool is_open_child_group(
unsigned ci)
const;
132 virtual void align(
const std::string& _align);
134 virtual gui_group_ptr add_group(
const std::string& label,
const std::string& group_type,
const std::string& options,
const std::string& align);
136 virtual cgv::base::base_ptr add_decorator(
const std::string& label,
const std::string& decorator_type,
const std::string& options,
const std::string& align);
138 virtual button_ptr add_button(
const std::string& label,
const std::string& options,
const std::string& align);
140 virtual view_ptr add_view_void(
const std::string& label,
const void* value_ptr,
const std::string& value_type,
const std::string& gui_type,
const std::string& options,
const std::string& align);
142 virtual control_ptr add_control_void(
const std::string& label,
void* value_ptr,
abst_control_provider* acp,
const std::string& value_type,
const std::string& gui_type,
const std::string& options,
const std::string& align,
void* user_data);
144 template <
typename T>
145 inline data::ref_ptr<view<T> >
add_view(
const std::string& label,
const T& value,
const std::string& gui_type =
"",
const std::string& options =
"",
const std::string& align =
"\n") {
146 view_ptr vp = add_view_void(label, &value,
148 gui_type, options, align);
152 template <
typename T>
154 control_ptr cp = add_control_void(label, &value, 0,
156 gui_type, options, align, 0);
160 template <
typename T>
163 const std::string& options =
"",
const std::string& align =
"\n",
void* user_data = 0) {
166 gui_type, options, align, user_data);
176 view_ptr find_view_void(
const void* value_ptr,
int* idx_ptr);
178 control_ptr find_control_void(
void* value_ptr,
int* idx_ptr);
183 template <
typename T>
185 view_ptr vp = find_view_void(&value,idx_ptr);
192 template <
typename T>
194 control_ptr cp = find_control_void(&value,idx_ptr);
210#include <cgv/config/lib_end.h>
The group class is a node with children.
reference counted pointer, which can work together with types that are derived from ref_counted,...
ref_ptr< S, is_ref_counted > down_cast() const
use static cast to convert from T to S if T is a base class of S and has a virtual destructor
gui independent group class which is a container for gui elements
cgv::signal::signal< cgv::base::base_ptr, bool > on_selection_change
This signal is emitted for every change of the selection of a child.
data::ref_ptr< view< T > > find_view(const T &value, int *idx_ptr=0)
find the next view of the given value in the current group.
std::vector< cgv::base::base_ptr > managed_objects
managed objects can be add to the group such that
data::ref_ptr< control< T > > add_control(const std::string &label, T &value, const std::string &gui_type="", const std::string &options="", const std::string &align="\n")
add a newly created control to the group for the given value with the given gui type,...
data::ref_ptr< view< T > > add_view(const std::string &label, const T &value, const std::string &gui_type="", const std::string &options="", const std::string &align="\n")
add a newly created view to the group for the given value with the given gui type,...
data::ref_ptr< control< T > > add_control(const std::string &label, control_provider< T > *provider, const std::string &gui_type="", const std::string &options="", const std::string &align="\n", void *user_data=0)
add a newly created control to the group which is controlled by a control_provider
cgv::signal::signal< gui_group_ptr, bool > on_open_state_change
this signal is emitted, when a child group is opened or closed
data::ref_ptr< control< T > > find_control(T &value, int *idx_ptr=0)
find the next control of the given value in the current group.
derive from this class to provide a gui to the current viewer
class for gui elements that view values of the type specified in the template argument
data::ref_ptr< gui_group, true > gui_group_ptr
ref counted pointer to a gui group
data::ref_ptr< const gui_group, true > const_gui_group_ptr
ref counted pointer to const gui group
interfaces that allows to listen to registration events.
type independent base class of control provider interface
traits class with a static function get_name() of type const char* that returns the type name of the ...
static const char * get_name()
return special name for standard types or type name from RTTI cleaned from keywords for all other typ...