Procedural event grabbing from a tableau. More...
#include <vgui_event_server.h>
Public Member Functions | |
vgui_event_server (vgui_tableau_sptr const &) | |
Constructor - collects events from the given tableau. | |
void | reset () |
bool | next () |
Move on to the next event in the event queue. | |
void | set_popup (const vgui_menu &) |
vgui_event | last_event () |
Returns the last event. | |
Protected Member Functions | |
~vgui_event_server () | |
Private Attributes | |
vgui_event_server_interpose_tableau * | grabber_ |
vgui_tableau_sptr | grabber_reference_ |
vgui_event | last_event_ |
bool | use_event_ |
vgui_menu | menu |
Friends | |
class | vgui_event_server_interpose_tableau |
Procedural event grabbing from a tableau.
vgui_event_server allows you to grab events intended for a tableau in a procedural way, (i.e. in a "for" loop), in order to temporarily take control of a tableau's event stream. This is useful for modal operations such as picking (- or maybe not, see below).
WARNING: This class is not as useful as it first appears!! If we look at events outside the handle function of a tableau (e.g. by using a vgui_event_server) then the gl state associated with those events will have changed. This means for a draw_overlay event we would end up drawing into the wrong buffer. For a mouse event we may not be able to get the position in the image using the projection_inspector (if e.g. the image was zoomed) since all the gl matrices would have been reset. I guess you could use it to get key presses! - kym
Definition at line 42 of file vgui_event_server.h.
vgui_event_server::vgui_event_server | ( | vgui_tableau_sptr const & | t | ) |
Constructor - collects events from the given tableau.
Construct a vgui_event_server, which grabs all events intended for tableau t.
Definition at line 50 of file vgui_event_server.cxx.
vgui_event_server::~vgui_event_server | ( | ) | [protected] |
Definition at line 64 of file vgui_event_server.cxx.
vgui_event vgui_event_server::last_event | ( | ) | [inline] |
Returns the last event.
Definition at line 56 of file vgui_event_server.h.
bool vgui_event_server::next | ( | ) |
Move on to the next event in the event queue.
Definition at line 74 of file vgui_event_server.cxx.
void vgui_event_server::reset | ( | ) |
Definition at line 70 of file vgui_event_server.cxx.
void vgui_event_server::set_popup | ( | const vgui_menu & | ) |
friend class vgui_event_server_interpose_tableau [friend] |
Definition at line 62 of file vgui_event_server.h.
Definition at line 63 of file vgui_event_server.h.
Definition at line 64 of file vgui_event_server.h.
vgui_event vgui_event_server::last_event_ [private] |
Definition at line 65 of file vgui_event_server.h.
vgui_menu vgui_event_server::menu [private] |
Definition at line 67 of file vgui_event_server.h.
bool vgui_event_server::use_event_ [private] |
Definition at line 66 of file vgui_event_server.h.