bWidgets
Core widget toolkit designed for Blender
bWidgets::bwScreenGraph::EventHandler Class Reference

API for registering and calling event-listeners. More...

#include <EventHandler.h>

+ Inheritance diagram for bWidgets::bwScreenGraph::EventHandler:

Public Types

enum  EventType { MOUSE_ENTER , MOUSE_LEAVE , TOT_EVENT_TYPES }
 

Public Member Functions

 EventHandler ()=default
 
virtual ~EventHandler ()=default
 
void addEventListener (EventType event_type, EventListener listener)
 
virtual void onMouseMove (bwEvent &)
 
virtual void onMouseEnter (bwEvent &)
 
virtual void onMouseLeave (bwEvent &)
 
virtual void onMousePress (bwMouseButtonEvent &)
 
virtual void onMouseRelease (bwMouseButtonEvent &)
 
virtual void onMouseClick (bwMouseButtonEvent &)
 
virtual void onMouseDrag (bwMouseButtonDragEvent &)
 
virtual void onMouseWheel (bwMouseWheelEvent &)
 

Detailed Description

API for registering and calling event-listeners.

TODO:

  • Only default onFoo() style listeners are supported, custom addEventListener() doesn't work yet.
  • Many widget handlers are friend classes to the widgets to access internal data. Instead widgets should have APIs to manipulate their state anyway, which they don't have yet.

Member Enumeration Documentation

◆ EventType

Enumerator
MOUSE_ENTER 
MOUSE_LEAVE 
TOT_EVENT_TYPES 

Constructor & Destructor Documentation

◆ EventHandler()

bWidgets::bwScreenGraph::EventHandler::EventHandler ( )
default

◆ ~EventHandler()

virtual bWidgets::bwScreenGraph::EventHandler::~EventHandler ( )
virtualdefault

Member Function Documentation

◆ addEventListener()

void bWidgets::bwScreenGraph::EventHandler::addEventListener ( EventHandler::EventType  event_type,
EventListener  listener 
)

◆ onMouseClick()

void bWidgets::bwScreenGraph::EventHandler::onMouseClick ( bwMouseButtonEvent )
virtual

◆ onMouseDrag()

void bWidgets::bwScreenGraph::EventHandler::onMouseDrag ( bwMouseButtonDragEvent )
virtual

◆ onMouseEnter()

void bWidgets::bwScreenGraph::EventHandler::onMouseEnter ( bwEvent )
virtual

◆ onMouseLeave()

void bWidgets::bwScreenGraph::EventHandler::onMouseLeave ( bwEvent )
virtual

◆ onMouseMove()

void bWidgets::bwScreenGraph::EventHandler::onMouseMove ( bwEvent )
virtual

Reimplemented in bWidgets::bwScrollViewHandler.

◆ onMousePress()

◆ onMouseRelease()

◆ onMouseWheel()

void bWidgets::bwScreenGraph::EventHandler::onMouseWheel ( bwMouseWheelEvent )
virtual

Reimplemented in bWidgets::bwScrollViewHandler.


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