cgv
cgv::gui::event_handler Class Referenceabstract

interface for all classes that want to receive events More...

#include <event_handler.h>

Inheritance diagram for cgv::gui::event_handler:
cgv::base::traverse_policy

Public Member Functions

 event_handler ()
 default construction
 
bool grab_focus ()
 grab the focus in all parent nodes
 
virtual bool handle (event &e)=0
 overload and implement this method to handle events
 
virtual void stream_help (std::ostream &os)=0
 overload to stream help information to the given output stream
 
bool add_key_control (const std::string &property, const std::string &options, cgv::base::group_ptr group=cgv::base::group_ptr())
 add a key control for the given property with the given options. More...
 
int get_policy () const
 return the policy without the stop on success flag
 
bool stop_on_success () const
 return whether to stop on success
 
bool stop_on_failure () const
 return whether to stop on failure
 
void set_policy (int _policy)
 set a new policy, always add stop on success flag if needed
 
int get_focused_child () const
 return the focused child or -1 if none is focused
 
void set_focused_child (int _focused_child)
 set the focused child
 
bool get_active () const
 return whether the current node is active
 
void set_active (bool _active)
 set the active flag of the current node
 

Detailed Description

interface for all classes that want to receive events

Member Function Documentation

◆ add_key_control()

bool cgv::gui::event_handler::add_key_control ( const std::string &  property,
const std::string &  options,
cgv::base::group_ptr  group = cgv::base::group_ptr() 
)

add a key control for the given property with the given options.

grab the focus in all parent nodes

This should be called in classes derived from cgv::base::group and event_handler. The group argument should be the this pointer cast to cgv::base_group. If group is not given, a dynamic_cast is performed on the this pointer.


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