#include <ivfwidget/IvfWidgetBase.h>
Inheritance diagram for CIvfWidgetBase:
Public Types | |
enum | TFunctionKey { FK_BUTTON, FK_BACKSPACE, FK_TAB, FK_ENTER, FK_PAUSE, FK_SCROLL_LOCK, FK_ESCAPE, FK_HOME, FK_LEFT, FK_UP, FK_RIGHT, FK_DOWN, FK_PAGE_UP, FK_PAGE_DOWN, FK_END, FK_PRINT, FK_INSERT, FK_MENU, FK_NUM_LOCK, FK_F1, FK_F2, FK_F3, FK_F4, FK_F5, FK_F6, FK_F7, FK_F8, FK_F9, FK_F10, FK_F11, FK_F12, FK_KP0, FK_KP1, FK_KP2, FK_KP3, FK_KP4, FK_KP5, FK_KP6, FK_KP7, FK_KP8, FK_KP9, FK_KP_ENTER, FK_SHIFT_L, FK_SHIFT_R, FK_CONTROL_L, FK_CONTROL_R, FK_CAPS_LOCK, FK_META_L, FK_META_R, FK_ALT_L, FK_ALT_R, FK_DELETE } |
enum | TModifierType { MT_SHIFT, MT_CTRL, MT_ALT, MT_NONE } |
Public Member Functions | |
void | addMenuItemEvent (CIvfMenuItemEvent *event) |
void | addRenderEvent (CIvfRenderEvent *event) |
void | addClearEvent (CIvfClearEvent *event) |
void | assignAppLoopEvent (CIvfAppLoopEvent *event) |
void | addDestroyEvent (CIvfDestroyEvent *event) |
void | addFocusEvent (CIvfFocusEvent *event) |
void | addFunctionKeyEvent (CIvfFunctionKeyEvent *event) |
void | addIdleEvent (CIvfIdleEvent *event) |
void | addInitContextEvent (CIvfInitContextEvent *event) |
void | addInitEvent (CIvfInitEvent *event) |
void | addInitOverlayEvent (CIvfInitOverlayEvent *event) |
void | addKeyboardEvent (CIvfKeyboardEvent *event) |
void | addModifierDownEvent (CIvfModifierDownEvent *event) |
void | addModifierUpEvent (CIvfModifierUpEvent *event) |
void | addMouseDownEvent (CIvfMouseDownEvent *event) |
void | addMouseEnterEvent (CIvfMouseEnterEvent *event) |
void | addMouseEvent (CIvfMouseEvent *event) |
void | addMouseLeaveEvent (CIvfMouseLeaveEvent *event) |
void | addMouseMoveEvent (CIvfMouseMoveEvent *event) |
void | addMouseUpEvent (CIvfMouseUpEvent *event) |
void | addOverlayEvent (CIvfOverlayEvent *event) |
void | addResizeEvent (CIvfResizeEvent *event) |
void | addUnFocusEvent (CIvfUnFocusEvent *event) |
void | assignTimeoutEvent (int nbr, CIvfTimeoutEvent *event) |
void | removeMenuItemEvent (CIvfMenuItemEvent *event) |
void | removeRenderEvent (CIvfRenderEvent *event) |
void | removeClearEvent (CIvfClearEvent *event) |
void | removeDestroyEvent (CIvfDestroyEvent *event) |
void | removeFocusEvent (CIvfFocusEvent *event) |
void | removeFunctionKeyEvent (CIvfFunctionKeyEvent *event) |
void | removeIdleEvent (CIvfIdleEvent *event) |
void | removeInitContextEvent (CIvfInitContextEvent *event) |
void | removeInitEvent (CIvfInitEvent *event) |
void | removeInitOverlayEvent (CIvfInitOverlayEvent *event) |
void | removeKeyboardEvent (CIvfKeyboardEvent *event) |
void | removeModifierDownEvent (CIvfModifierDownEvent *event) |
void | removeModifierUpEvent (CIvfModifierUpEvent *event) |
void | removeMouseDownEvent (CIvfMouseDownEvent *event) |
void | removeMouseEnterEvent (CIvfMouseEnterEvent *event) |
void | removeMouseEvent (CIvfMouseEvent *event) |
void | removeMouseLeaveEvent (CIvfMouseLeaveEvent *event) |
void | removeMouseMoveEvent (CIvfMouseMoveEvent *event) |
void | removeMouseUpEvent (CIvfMouseUpEvent *event) |
void | removeOverlayEvent (CIvfOverlayEvent *event) |
void | removeResizeEvent (CIvfResizeEvent *event) |
void | removeUnFocusEvent (CIvfUnFocusEvent *event) |
void | removeTimeoutEvent (int nbr) |
CIvfWidgetBase () | |
virtual | ~CIvfWidgetBase () |
IvfClassInfo ("CIvfWidgetBase", CIvfBase) | |
void | redraw () |
bool | isInitDone () |
bool | isMiddleButtonDown () |
bool | isRightButtonDown () |
bool | isLeftButtonDown () |
bool | isAnyButtonDown () |
void | disableIdleProcessing () |
void | enableIdleProcessing () |
bool | isIdleProcessing () |
void | enableTimeout (float time, int nbr) |
void | disableTimeout (int nbr) |
bool | isTimeoutEnabled (int nbr) |
float | getTimeout (int number) |
TModifierType | getModifierKey () |
double | elapsedTime () |
void | setPosition (int x, int y) |
void | setSize (int w, int h) |
void | setUseOverlay (bool flag) |
bool | getUseOverlay () |
void | clearMouseStatus () |
void | setModifierKey (TModifierType key) |
void | setMiddleButtonStatus (bool down) |
void | setRightButtonStatus (bool down) |
void | setLeftButtonStatus (bool down) |
virtual void | onInit (int width, int height) |
virtual void | onDestroy () |
virtual void | onInitContext (int width, int height) |
virtual void | onOverlay () |
virtual void | onMouse (int x, int y) |
virtual void | onMouseDown (int x, int y) |
virtual void | onMouseUp (int x, int y) |
virtual void | onMouseMove (int x, int y) |
virtual void | onMouseLeave (int x, int y) |
virtual void | onMouseEnter (int x, int y) |
virtual void | onKeyboard (int key, int x, int y) |
virtual void | onModifierDown () |
virtual void | onModifierUp () |
virtual void | onInitOverlay (int width, int height) |
virtual void | onRender () |
virtual void | onMenuItem (int id) |
virtual void | onClear () |
virtual void | onResize (int width, int height) |
virtual void | onUnFocus () |
virtual void | onFocus () |
virtual void | onFunctionKey (TFunctionKey key, int x, int y) |
virtual void | onIdle () |
virtual bool | onTimeout0 () |
virtual bool | onTimeout1 () |
virtual bool | onTimeout2 () |
virtual bool | onTimeout3 () |
virtual bool | onTimeout4 () |
virtual bool | onTimeout5 () |
virtual bool | onTimeout6 () |
virtual bool | onTimeout7 () |
virtual bool | onTimeout8 () |
virtual bool | onTimeout9 () |
virtual bool | onAppLoop () |
virtual void | doIdle () |
virtual bool | doTimeout0 () |
virtual bool | doTimeout1 () |
virtual bool | doTimeout2 () |
virtual bool | doTimeout3 () |
virtual bool | doTimeout4 () |
virtual bool | doTimeout5 () |
virtual bool | doTimeout6 () |
virtual bool | doTimeout7 () |
virtual bool | doTimeout8 () |
virtual bool | doTimeout9 () |
virtual bool | doAppLoop () |
virtual double | doElapsedTime () |
virtual void | doInitOverlay (int width, int height) |
virtual void | doDestroy () |
virtual void | doOverlay () |
virtual void | doInitContext (int width, int height) |
virtual void | doClear () |
virtual void | doRender () |
virtual void | doInit (int width, int height) |
void | doMenuItem (int id) |
virtual void | doDisableIdleProcessing () |
virtual void | doEnableIdleProcessing () |
virtual void | doEnableTimeout (float time, int nbr) |
virtual void | doDisableTimeout (int nbr) |
virtual void | doRedraw () |
virtual void | doMouseEnter (int x, int y) |
virtual void | doUnFocus () |
virtual void | doFocus () |
virtual void | doMouseMove (int x, int y) |
virtual void | doMouseUp (int x, int y) |
virtual void | doMouseDown (int x, int y) |
virtual void | doDraw () |
virtual void | doResize (int width, int height) |
virtual void | doMouseLeave (int x, int y) |
virtual void | doKeyboard (int key, int x, int y) |
virtual void | doModifierDown () |
virtual void | doModifierUp () |
virtual void | doFunctionKey (TFunctionKey key, int x, int y) |
virtual void | doSetPosition (int x, int y) |
virtual void | doSetSize (int w, int h) |
This class implements the standard functionality for handling keyboard, mouse and drawing of a widget. The class should be used in combination with some kind of window/view class. The ivffltk library derives a widget class by combining Fl_Gl_Window with CIvfWidgetBase.
Ivf++ 0.9.x introduces a new event model in the CIvfWidgetBase class. This model uses assignable event classes in addition of the virtual methods previously used. This enables the use of "handler" classes for supporting pluggable user interface functionality. See the IvfEvent.h header file for a description of the supported events in the CIvfWidgetBase class. Events is preferred way of implementing UI functionality in Ivf++ 0.9.x.
When implementing new classes mouse, keyboard and drawing events should be interfaced with the doXXX() methods. These Will in turn call onXXX() methods and asssigned events, from which the user can override the default behavior.
The methods doEnableIdleProcessing(), doDisableIdleProcessing(), doEnableTimeout() and doRedraw() should be overidden and functionality for these implemented.
Definition at line 62 of file IvfWidgetBase.h.
|
Function key enumerations Definition at line 65 of file IvfWidgetBase.h. |
|
Enumerations for modifier status Definition at line 121 of file IvfWidgetBase.h. |
|
CIvfWidgetBase constructor |
|
CIvfWidgetBase destructor |
|
Add clear event |
|
Add destroy event |
|
Add focus event |
|
Add function key event |
|
Add idle event |
|
Add init context event |
|
Add init event |
|
Add init overlay event |
|
Add keyboard event |
|
Add menu item event |
|
Add modifier down event |
|
Add modifier up event |
|
Add mouse down event |
|
Add mouse enter event |
|
Add mouse event |
|
Add mouse leave event |
|
Add mouse move event |
|
Add mouse up event |
|
Add overlay event |
|
Add render event |
|
Add resize event |
|
Add unfocus event |
|
Assign application loop event |
|
Assign timeout event |
|
Clears mouse status |
|
Disables idle processing |
|
Enables timeout
|
|
doAppLoop event These events handles timer calls. If timeout should be repeated the return value should be true. |
|
Called by doDraw() |
|
Called by the doDraw() method Reimplemented in CIvfMfcView, CIvfMfcWindow, CIvfWorkspaceWidget, and CIvfWin32Window. |
|
Enable idle processing (to be overidden) Derived widget should override this method to enable idle processing. Idle processing should then call doIdle(). Reimplemented in CIvfFltkBase, CIvfFltkWorkspace, CIvfMfcView, CIvfMfcWindow, and CIvfWin32Window. |
|
Disable timeout callback (to be overidden) Derived widget should override this method to disable specified callback. Reimplemented in CIvfFltkBase, CIvfMfcView, CIvfMfcWindow, and CIvfWin32Window. |
|
Draw event handling (called from widget) Derived widget should call this method when widget is to be redrawn. |
|
Disable idle processing (to be overidden) Derived widget should override this method to disable idle processing. Reimplemented in CIvfFltkBase, CIvfFltkWorkspace, CIvfMfcView, CIvfMfcWindow, and CIvfWin32Window. |
|
Enable timeout callback (to be overidden) Derived widget should override this method to enable specified callback. Reimplemented in CIvfFltkBase, CIvfFltkWorkspace, CIvfMfcView, CIvfMfcWindow, and CIvfWin32Window. |
|
UnFocus event handling (called from widget) Derived widget should call this method when widget received focus. |
|
FunctionKey event handling (called from widget) Derived widget should call this method when a function key on the keyboard is pressed. |
|
Idle method processing This method should be called from the derived widget when it is in idle processing. doIdle() will call the onIdle method. |
|
Called by doResize() Reimplemented in CIvfMfcView, CIvfMfcWindow, and CIvfWorkspaceWidget. |
|
Called by doResize() |
|
Called by the doDraw() method |
|
Keyboard event handling (called from widget) Derived widget should call this method when a key on the keyboard is pressed. Reimplemented in CIvfWorkspaceWidget. |
|
A modifer key event handling Derived widgets should call this method when a modifier key is pressed. |
|
A modifer key event handling Derived widgets should call this method when a modifier key is released. |
|
MouseDown event handling (called from widget) Derived widget should call this method when any of the mouse buttons is pressed. Reimplemented in CIvfWindow, CIvfWorkspaceWindow, and CIvfWorkspaceWidget. |
|
MouseEnter event handling (called from widget) Derived widget should call this method when mouse enters the widget. |
|
MouseLeave event handling (called from widget) Derived widget should call this method when the mouse leaves the widget. |
|
MouseMove event handling (called from widget) Derived widget should call this method when the mouse is moved. Reimplemented in CIvfWorkspaceWidget. |
|
MouseUp event handling (called from widget) Derived widget should call this method when any of the mouse buttons is released. Reimplemented in CIvfWindow, CIvfWorkspaceWindow, and CIvfWorkspaceWidget. |
|
Called by the doDraw() method |
|
Redraw operation (to be overidden) Derived widget should override this method to do a redraw of widget Reimplemented in CIvfFltkBase, CIvfFltkWorkspace, CIvfMfcView, CIvfMfcWindow, and CIvfWin32Window. |
|
Called by doDraw() Reimplemented in CIvfWorkspaceWidget. |
|
Resize event handling (called from widget) Derived widget should call this method when widget is resized. Reimplemented in CIvfWorkspaceWidget. |
|
Timeout processing (called from widget) This method should be called from the derived widget when a timeout event has occured. This method will inturn call onTimeoutX() |
|
Timeout processing (called from widget) This method should be called from the derived widget when a timeout event has occured. This method will inturn call onTimeoutX() |
|
Timeout processing (called from widget) This method should be called from the derived widget when a timeout event has occured. This method will inturn call onTimeoutX() |
|
Timeout processing (called from widget) This method should be called from the derived widget when a timeout event has occured. This method will inturn call onTimeoutX() |
|
Timeout processing (called from widget) This method should be called from the derived widget when a timeout event has occured. This method will inturn call onTimeoutX() |
|
Timeout processing (called from widget) This method should be called from the derived widget when a timeout event has occured. This method will inturn call onTimeoutX() |
|
Timeout processing (called from widget) This method should be called from the derived widget when a timeout event has occured. This method will inturn call onTimeoutX() |
|
Timeout processing (called from widget) This method should be called from the derived widget when a timeout event has occured. This method will inturn call onTimeoutX() |
|
Timeout processing (called from widget) This method should be called from the derived widget when a timeout event has occured. This method will inturn call onTimeoutX() |
|
Timeout processing (called from widget) This method should be called from the derived widget when a timeout event has occured. This method will inturn call onTimeoutX() |
|
UnFocus event handling (called from widget) Derived widget should call this method when widget looses focus. |
|
Returns elasped time since onInit event |
|
Enables idle processing |
|
Enables timeout
|
|
Return what modifier key is down |
|
Return interval of specified timeout |
|
Return overlay status |
|
Returns true if any button is down |
|
Returns true if idle processing is enabled |
|
Returns true if onInit() has been called |
|
Returns true if left button is down |
|
Returns true if middle button is down |
|
Returns true if right button is down |
|
Returns true if timeout nbr is enabled |
|
onAppLoop event These events handles timer calls. If timeout should be repeated the return value should be true. |
|
onClear event The onClear event is called when the widget needs to be cleared. Typically a glClear() function should be called to clear the widget if overidden. If not overidden, the widget is clear with the color black. |
|
onDestroy event This method is called when the widget is destroyed.
|
|
onFocus event The onFocus event occurs when the widget has received focus. |
|
onFunctionKey event The onFunctionKey event is called when a function key is pressed. See the TFunctionKey enumeration. |
|
onIdle event This event handles idle processing if it is turned on using enableIdleProcessing(). |
|
onInit event onInit is called the first time an OpenGL context is activated. All OpenGL dependent intialization code should be placed here, including Ivf++ code.
|
|
onInitContext event This event is called when an OpenGL context is initialized. OpenGL state initialization code should be placed here. |
|
onInitOverlay event The onInitOverlay event is called before the onOverlay event to setup the overlay projection matrices. |
|
onKeyboard event The onKeyboard event is called when a key on the keyboard is pressed
|
|
onModifierDown event The onModifier event is called when a modifier key is pressed (only supported on WIN32 for now) |
|
onModifierUp event The onModifier event is called when a modifier key is released (only supported on WIN32 for now) |
|
onMouseDown event The onMouseDown event is called when any of the mouse buttons are pressed.
|
|
onMouseEnter event The onMouseEnter event is called when the mouse enters the window. |
|
onMouseLeave event The onMouseLeave event is called when the mouse leaves the window. |
|
onMouseMove event The onMouseMove event is called whenever the mouse is moved in the window.
|
|
onMouseUp event The onMouse event is called when the mouse button is released.
|
|
onOverlay event This event is called when an overlay is to be drawn. For this method to be called, the UseOverlay property must be set using the setUseOverlay method. The view port is configured for 2D drawing when this method is called. |
|
onRender event The onRender event is called whenever the widget needs to be redrawn.
|
|
onResize event The onResize event occurs when the widget has changed size. Typically code for initialising the viewport and perspective transformation goes here.
|
|
onTimeout event These events handles timer calls. If timeout should be repeated the return value should be true.
|
|
onTimeout event These events handles timer calls. If timeout should be repeated the return value should be true. |
|
onTimeout event These events handles timer calls. If timeout should be repeated the return value should be true. |
|
onTimeout event These events handles timer calls. If timeout should be repeated the return value should be true. |
|
onTimeout event These events handles timer calls. If timeout should be repeated the return value should be true. |
|
onTimeout event These events handles timer calls. If timeout should be repeated the return value should be true. |
|
onTimeout event These events handles timer calls. If timeout should be repeated the return value should be true. |
|
onTimeout event These events handles timer calls. If timeout should be repeated the return value should be true. |
|
onTimeout event These events handles timer calls. If timeout should be repeated the return value should be true. |
|
onTimeout event These events handles timer calls. If timeout should be repeated the return value should be true. |
|
onUnFocus event The onUnFocus event occurs when the widget has lost focus. |
|
Remove clear event |
|
Remove destroy event |
|
Remove focus event |
|
Remove function key event |
|
Remove idle event |
|
Remove init context event |
|
Remove init event |
|
Remove init overlay event |
|
Remove keyboard event |
|
Remove menu item event |
|
Remove modifier down event |
|
Remove modifier up event |
|
Remove mouse down event |
|
Remove mouse enter event |
|
Remove mouse event |
|
Remove mouse leave event |
|
Remove mouse move event |
|
Remove mouse up event |
|
Remove overlay event |
|
Remove render event |
|
Remove resize event |
|
Remove timeout event |
|
Remove unfocus event |
|
Set left mouse status |
|
Set middle mouse status |
|
Sets the modifier key |
|
Set position of widget |
|
Set right mouse status |
|
Set size of widget |
|
Enable/disable use of overlay When flag is set to true the widget will call the onOverlay event, for drawing the overlay. |