Harmonic Flow Framework (libhffwk)
Cross platform C++ 2D Game Engine Framework
Public Types | Public Member Functions | Public Attributes | List of all members
HFCore::WidgetManager Class Reference

WidgetManager manages Widget's and interacts with Game interface. More...

#include <WidgetManager.h>

Inheritance diagram for HFCore::WidgetManager:
Inheritance graph
[legend]

Public Types

typedef std::list< PreModalInfoPreModalInfoList
 typedef for List holding PreModalInfo.
 
typedef std::vector< std::pair< Widget *, int32_hf > > DeferredOverlayVector
 typedef for Vector holding pairs of pointer to Widget and priority for deferred overlays.
 
typedef std::map< int32_hf, DialogWidget * > DialogMap
 typedef for map holding dialogID and pointer to DialogWidget.
 
typedef std::list< DialogWidget * > DialogList
 typedef for List holding pointer to DialogWidget.
 
- Public Types inherited from HFCore::WidgetContainer
enum  {
  WIDGETFLAGS_UPDATE = 1, WIDGETFLAGS_DRAW = 2, WIDGETFLAGS_CLIP = 4, WIDGETFLAGS_ALLOW_MOUSE = 8,
  WIDGETFLAGS_ALLOW_FOCUS = 16
}
 Enum for Widget flags. More...
 
typedef std::list< Widget * > WidgetList
 typedef for List holding pointer to Widget.
 

Public Member Functions

 WidgetManager ()
 Constructor.
 
virtual ~WidgetManager ()
 Destructor.
 
DialogWidgetgetDialog (int32_hf dialogId)
 Get a pointer to DialogWidget for given dialogId. More...
 
void addDialog (int32_hf dialogId, DialogWidget *dialogWidget)
 Add a DialogWidget. More...
 
void addDialog (DialogWidget *dialogWidget)
 Add a DialogWidget. More...
 
bool killDialog (int32_hf dialogId, bool removeDialog, bool deleteDialog)
 Kill DialogWidget with given dialogId. More...
 
bool killDialog (int32_hf dialogId)
 Kill DialogWidget with given dialogId. More...
 
bool killDialog (DialogWidget *dialogWidget)
 Kill DialogWidget. More...
 
int32_hf getDialogCount ()
 Get DialogWidget count. More...
 
void addBaseModal (Widget *widget, const FlagsMod &belowFlagsMod)
 Add a base modal Widget. More...
 
void addBaseModal (Widget *widget)
 Add a base modal Widget. More...
 
void removeBaseModal (Widget *widget)
 Remove base modal Widget. More...
 
void disableWidget (Widget *widget)
 Disable widget. More...
 
WidgetgetAnyWidgetAt (fp32_hf x, fp32_hf y, fp32_hf *widgetX, fp32_hf *widgetY)
 Get any Widget found at x and y position. More...
 
WidgetgetWidgetAt (fp32_hf x, fp32_hf y, fp32_hf *widgetX, fp32_hf *widgetY)
 Get Widget at x and y position. More...
 
void setFocus (Widget *widget)
 Set focus on widget. More...
 
void gotFocus ()
 Called when the Widget gains focus. More...
 
void lostFocus ()
 Called when the Widget loses focus. More...
 
void initModalFlags (ModalFlags *modalFlags)
 Initialize ModalFlags to defaults. More...
 
void doMouseUps (Widget *widget)
 Call Widget::mouseButtonUp() for widget. More...
 
void doMouseUps ()
 Call Widget::mouseButtonUp() for last down Widget.
 
void deferOverlay (Widget *widget, int32_hf priority)
 Put widget in internal WidgetManager::DeferredOverlayVector. More...
 
void flushDeferredOverlayWidgets (int32_hf maxPriority)
 Calls Widget::drawOverlay() for all Widget's in internal WidgetManager::DeferredOverlayVector in priority order. More...
 
void removeOverlay (Widget *widget)
 Remove widget from internal WidgetManager::DeferredOverlayVector. More...
 
void drawFrame (Graphics *g)
 Called by the framework once for every iteration of the main loop. More...
 
void updateFrame (fp32_hf dt)
 Called by the framework once for every iteration of the game loop, immediately before rendering takes place. More...
 
void destroyRenderTextures ()
 Called by the framework when Render textures needs to be destroyed. More...
 
void createRenderTextures ()
 Called by the framework when Render textures needs to be created/initialized. More...
 
void setPopupCommandWidget (Widget *list)
 Set popup command Widget. More...
 
void removePopupCommandWidget ()
 Remove popup command Widget.
 
void rehupMouse ()
 Rehup Mouse (calls Widget::mouseLeave()) if needed for over Widget.
 
void remapMouse (int32_hf &x, int32_hf &y)
 Do some internal Mouse re-mapping. More...
 
virtual void keyUp (Keyboard::KeyboardInfo kb)
 Called automatically when Keyboard keyUp event occurs. More...
 
virtual void keyDown (Keyboard::KeyboardInfo kb)
 Called automatically when Keyboard keyDown event occurs. More...
 
virtual void touchDown (Touch::TouchInfo touch)
 Called automatically when Touch down event occurs. More...
 
virtual void touchUp (Touch::TouchInfo touch)
 Called automatically when Touch up event occurs. More...
 
virtual void touchMove (Touch::TouchInfo touch)
 Called automatically when Touch move/drag event occurs. More...
 
virtual void mouseMove (Mouse::MouseInfo mouse)
 Called automatically when Mouse motion event occurs. More...
 
virtual void mouseButtonDown (Mouse::MouseInfo mouse)
 Called automatically when Mouse button down event occurs. More...
 
virtual void mouseButtonUp (Mouse::MouseInfo mouse)
 Called automatically when Mouse button up event occurs. More...
 
virtual void mouseWheel (Mouse::MouseInfo mouse)
 Called automatically when Mouse wheel event occurs. More...
 
virtual void mouseEnter (Mouse::MouseInfo mouse)
 Called automatically when Mouse enter event occurs. More...
 
virtual void mouseLeave (Mouse::MouseInfo mouse)
 Called automatically when Mouse leave event occurs. More...
 
- Public Member Functions inherited from HFCore::WidgetContainer
 WidgetContainer ()
 Constructor.
 
virtual ~WidgetContainer ()
 Destructor.
 
virtual Rect getRect ()
 Get Widget size Rect. More...
 
virtual bool intersects (WidgetContainer *widget)
 Determine whether widget intersects with *this. More...
 
virtual void addWidget (Widget *widget)
 Adds a new Widget and call addedToManager(). More...
 
virtual void removeWidget (Widget *widget)
 Remove a Widget and call removedFromManager(). More...
 
virtual bool hasWidget (Widget *widget)
 Determine whether internal Widget list contains widget. More...
 
virtual void removeAllWidgets (bool doDelete=false, bool recursive=false)
 Remove all Widget's contained in internal list. More...
 
virtual bool isBelow (Widget *widget1, Widget *widget2)
 Determine whether widget1 is below widget2. More...
 
virtual void bringToFront (Widget *widget)
 Bring widget to front. More...
 
virtual void bringToBack (Widget *widget)
 Bring widget to back. More...
 
virtual void putBehind (Widget *widget, Widget *refWidget)
 Put widget behind refWidget. More...
 
virtual void putInfront (Widget *widget, Widget *refWidget)
 Put widget in front of refWidget. More...
 
virtual Vector2 getAbsPos ()
 Get abs position relative to top level Widget. More...
 
virtual void addedToManager (WidgetManager *widgetManager)
 Call addedToManager() for all Widget's in internal list. More...
 
virtual void removedFromManager (WidgetManager *widgetManager)
 Call removedFromManager() for all Widget's in internal list. More...
 
virtual void modalDialogOpen ()
 Called for DialogWidget's which has mIsModal flag set to true during WidgetManager::addDialog() call. More...
 
virtual void modalDialogClose ()
 Called for DialogWidget's which has mIsModal flag set to true during WidgetManager::killDialog() call. More...
 
virtual void update (fp32_hf dt)
 Called by the framework once for every iteration of the game loop, immediately before rendering takes place. More...
 
virtual void updateAll (ModalFlags *flags, fp32_hf dt)
 Calls update() for all Widget's in internal list which have WIDGETFLAGS_UPDATE set in flags. More...
 
virtual void draw (Graphics *g)
 Called by the framework once for every iteration of the main loop. More...
 
virtual void drawAll (ModalFlags *flags, Graphics *g)
 Calls draw() for all Widget's in internal list which have WIDGETFLAGS_DRAW set in flags. More...
 
virtual void sysColorChangedAll ()
 Call sysColorChanged() for all Widget's in internal list.
 
virtual void sysColorChanged ()
 Handle sys color changed. More...
 
WidgetgetWidgetAtHelper (fp32_hf x, fp32_hf y, int32_hf flags, bool *found, fp32_hf *widgetX, fp32_hf *widgetY)
 Get Widget at x and y position which has flags set. More...
 

Public Attributes

DialogMap mDialogMap
 Internal WidgetManager::DialogMap.
 
DialogList mDialogList
 Internal WidgetManager::DialogList.
 
WidgetmPopupCommandWidget
 Holds pointer to popup command Widget.
 
WidgetmFocusWidget
 Holds pointer to focus Widget.
 
WidgetmLastDownWidget
 Holds pointer to last down Widget.
 
WidgetmOverWidget
 Holds pointer to over Widget.
 
WidgetmBaseModalWidget
 Holds pointer to base modal Widget.
 
GraphicsmCurG
 Holds pointer to Graphics object.
 
Mouse::MouseInfo mCurMouse
 Holds current Mouse state.
 
Mouse::Button mCurMouseButton
 Holds current Mouse button state.
 
DeferredOverlayVector mDeferredOverlayWidgets
 Internal WidgetManager::DeferredOverlayVector.
 
int32_hf mMinDeferredOverlayPriority
 Holds minimum deferred overlay priority.
 
bool mHasFocus
 Flag indicating if has focus or not.
 
FlagsMod mLostFocusFlagsMod
 Holds lost focus FlagsMod.
 
FlagsMod mBelowModalFlagsMod
 Holds below modal FlagsMod.
 
FlagsMod mDefaultBelowModalFlagsMod
 Holds default below modal FlagsMod.
 
PreModalInfoList mPreModalInfoList
 Internal WidgetManager::PreModalInfoList.
 
Rect mMouseDestRect
 Holds Mouse destination Rect.
 
Rect mMouseSourceRect
 Holds Mouse source Rect.
 
bool mMouseIn
 Flag indicating if Mouse entered or not.
 
fp32_hf mLastMouseX
 Holds last Mouse position X.
 
fp32_hf mLastMouseY
 Holds last Mouse position Y.
 
int32_hf mWidgetFlags
 Holds Widget flags.
 
- Public Attributes inherited from HFCore::WidgetContainer
WidgetList mWidgets
 WidgetContainer::WidgetList holding child Widget's.
 
WidgetManagermWidgetManager
 Pointer to WidgetManager.
 
WidgetContainermParent
 Pointer to parent WidgetContainer.
 
bool mUpdateIteratorModified
 Flag indicating if update iterator is modified or not.
 
WidgetList::iterator mUpdateIterator
 WidgetContainer::WidgetList iterator.
 
fp32_hf mX
 Holds Widget X position.
 
fp32_hf mY
 Holds Widget Y position.
 
fp32_hf mWidth
 Holds Widget width.
 
fp32_hf mHeight
 Holds Widget height.
 
bool mHasAlpha
 Flag indicating if Widget has Alpha or not.
 
bool mClip
 Flag indicating if Widget should be clipped or not.
 
FlagsMod mWidgetFlagsMod
 Holds Widget FlagsMod.
 
int32_hf mPriority
 Holds Widget priority (not used!).
 
int32_hf mZOrder
 Holds Widget Z order.
 

Detailed Description

WidgetManager manages Widget's and interacts with Game interface.

Example code for how to interact with Game interface:

void GameMain::draw(HFCore::Graphics *g)
{
if (!g->beginScene())
return;
// Setup Viewport and Ortho projection mapped pixel perfect:
// (Ortho projection must be used for Widgets and text rendering)
setProjectionMatrix(g);
// Setup Camera lookAt:
setViewMatrix(g);
// Let renderer know we're using pixel perfect vertex center:
// (Perspective projection uses 0.5f instead of w/2)
// Let WidgetManager call all Widget draw methods:
HFCORE_WIDMGR->drawFrame(g);
g->endScene();
}
void GameMain::update(fp32_hf dt)
{
// Let WidgetManager call all Widget update methods:
HFCORE_WIDMGR->updateFrame(g);
}
void GameMain::destroyRenderTextures()
{
HFCORE_WIDMGR->destroyRenderTextures();
}
void GameMain::createRenderTextures()
{
HFCORE_WIDMGR->createRenderTextures();
}
void GameMain::keyUp(HFCore::Keyboard::KeyboardInfo kb)
{
HFCORE_WIDMGR->keyUp(kb);
}
void GameMain::keyDown(HFCore::Keyboard::KeyboardInfo kb)
{
HFCORE_WIDMGR->keyDown(kb);
}
void GameMain::mouseMove(HFCore::Mouse::MouseInfo mouse)
{
HFCORE_WIDMGR->mouseMove(mouse);
}
void GameMain::mouseButtonDown(HFCore::Mouse::MouseInfo mouse)
{
HFCORE_WIDMGR->mouseButtonDown(mouse);
}
void GameMain::mouseButtonUp(HFCore::Mouse::MouseInfo mouse)
{
HFCORE_WIDMGR->mouseButtonUp(mouse);
}
void GameMain::mouseWheel(HFCore::Mouse::MouseInfo mouse)
{
HFCORE_WIDMGR->mouseWheel(mouse);
}
void GameMain::windowFocusLost(int32_hf windowID)
{
HFCORE_WIDMGR->lostFocus();
}
void GameMain::windowFocusGained(int32_hf windowID)
{
HFCORE_WIDMGR->gotFocus();
}
// etc... forward what's needed from Game interface!

Definition at line 155 of file WidgetManager.h.

Member Function Documentation

◆ addBaseModal() [1/2]

void WidgetManager::addBaseModal ( Widget widget,
const FlagsMod belowFlagsMod 
)

Add a base modal Widget.

Parameters
widgetPointer to Widget.
belowFlagsModFlagsMod to use.
See also
removeBaseModal()

Definition at line 221 of file WidgetManager.cpp.

◆ addBaseModal() [2/2]

void WidgetManager::addBaseModal ( Widget widget)

Add a base modal Widget.

Parameters
widgetPointer to Widget.
See also
removeBaseModal()

Definition at line 233 of file WidgetManager.cpp.

◆ addDialog() [1/2]

void WidgetManager::addDialog ( int32_hf  dialogId,
DialogWidget dialogWidget 
)

Add a DialogWidget.

Parameters
dialogIdDialog ID.
dialogWidgetPointer to DialogWidget.
See also
getDialog()
killDialog()
getDialogCount()

Definition at line 138 of file WidgetManager.cpp.

◆ addDialog() [2/2]

void WidgetManager::addDialog ( DialogWidget dialogWidget)

Add a DialogWidget.

Parameters
dialogWidgetPointer to DialogWidget.
See also
getDialog()
killDialog()
getDialogCount()

Definition at line 161 of file WidgetManager.cpp.

◆ createRenderTextures()

void WidgetManager::createRenderTextures ( )

Called by the framework when Render textures needs to be created/initialized.

Call this method from the class implementing Game interface:

void GameMain::createRenderTextures()
{
// inform widgetmanager so that all loaded dialogs
// and widgets create it's render textures:
HFCORE_WIDMGR->createRenderTextures();
}
See also
destroyRenderTextures()

Definition at line 830 of file WidgetManager.cpp.

◆ deferOverlay()

void WidgetManager::deferOverlay ( Widget widget,
int32_hf  priority 
)

Put widget in internal WidgetManager::DeferredOverlayVector.

Parameters
widgetPointer to Widget.
priorityPriority.
See also
flushDeferredOverlayWidgets()
removeOverlay()

Definition at line 390 of file WidgetManager.cpp.

◆ destroyRenderTextures()

void WidgetManager::destroyRenderTextures ( )

Called by the framework when Render textures needs to be destroyed.

Call this method from the class implementing Game interface:

void GameMain::destroyRenderTextures()
{
// inform widgetmanager so that all loaded dialogs
// and widgets destroys it's render textures:
HFCORE_WIDMGR->destroyRenderTextures();
}
See also
createRenderTextures()

Definition at line 807 of file WidgetManager.cpp.

◆ disableWidget()

void WidgetManager::disableWidget ( Widget widget)
virtual

Disable widget.

Parameters
widgetPointer to Widget.

Reimplemented from HFCore::WidgetContainer.

Definition at line 280 of file WidgetManager.cpp.

◆ doMouseUps()

void WidgetManager::doMouseUps ( Widget widget)

Call Widget::mouseButtonUp() for widget.

Parameters
widgetPointer to Widget.

Definition at line 372 of file WidgetManager.cpp.

◆ drawFrame()

void WidgetManager::drawFrame ( Graphics g)

Called by the framework once for every iteration of the main loop.

Call this method from the class implementing Game interface:

void GameMain::draw(HFCore::Graphics *g)
{
if (!g->beginScene())
return;
// Setup Viewport and Ortho projection mapped pixel perfect:
// (Ortho projection must be used for Widgets and text rendering)
setProjectionMatrix(g);
// Setup Camera lookAt:
setViewMatrix(g);
// Let renderer know we're using pixel perfect vertex center:
// (Perspective projection uses 0.5f instead of w/2)
// Let WidgetManager call all Widget draw methods:
HFCORE_WIDMGR->drawFrame(g);
g->endScene();
}
Parameters
gPointer to Graphics object.
See also
updateFrame()

Definition at line 446 of file WidgetManager.cpp.

◆ flushDeferredOverlayWidgets()

void WidgetManager::flushDeferredOverlayWidgets ( int32_hf  maxPriority)

Calls Widget::drawOverlay() for all Widget's in internal WidgetManager::DeferredOverlayVector in priority order.

Parameters
maxPriorityMax priority.
See also
deferOverlay()
removeOverlay()

Definition at line 397 of file WidgetManager.cpp.

◆ getAnyWidgetAt()

Widget * WidgetManager::getAnyWidgetAt ( fp32_hf  x,
fp32_hf  y,
fp32_hf widgetX,
fp32_hf widgetY 
)

Get any Widget found at x and y position.

Parameters
xX position.
yY position.
[out]widgetXFound Widget position X.
[out]widgetYFound Widget position Y.
Returns
Pointer to Widget found or NULL if not found.
See also
getWidgetAt()

Definition at line 307 of file WidgetManager.cpp.

◆ getDialog()

DialogWidget * WidgetManager::getDialog ( int32_hf  dialogId)

Get a pointer to DialogWidget for given dialogId.

Parameters
dialogIdID of DialogWidget.
Returns
Pointer to DialogWidget for given dialogId.
See also
addDialog()
killDialog()
getDialogCount()

Definition at line 128 of file WidgetManager.cpp.

◆ getDialogCount()

int32_hf WidgetManager::getDialogCount ( )

Get DialogWidget count.

Returns
DialogWidget count.
See also
getDialog()
addDialog()
killDialog()

Definition at line 216 of file WidgetManager.cpp.

◆ getWidgetAt()

Widget * WidgetManager::getWidgetAt ( fp32_hf  x,
fp32_hf  y,
fp32_hf widgetX,
fp32_hf widgetY 
)

Get Widget at x and y position.

Does the same as getAnyWidgetAt() except that it checks so that it isn't disabled too.

Parameters
xX position.
yY position.
[out]widgetXFound Widget position X.
[out]widgetYFound Widget position Y.
Returns
Pointer to Widget found or NULL if not found.
See also
getAnyWidgetAt()

Definition at line 315 of file WidgetManager.cpp.

◆ gotFocus()

void WidgetManager::gotFocus ( )

Called when the Widget gains focus.

Call this method from the class implementing Game interface:

void GameMain::windowFocusGained(int32_hf windowID)
{
HFCORE_WIDMGR->gotFocus();
}
See also
lostFocus()
setFocus()

Definition at line 343 of file WidgetManager.cpp.

◆ initModalFlags()

void WidgetManager::initModalFlags ( ModalFlags modalFlags)

Initialize ModalFlags to defaults.

Parameters
modalFlagsModalFlags to initialize.

Definition at line 365 of file WidgetManager.cpp.

◆ keyDown()

void WidgetManager::keyDown ( Keyboard::KeyboardInfo  kb)
virtual

Called automatically when Keyboard keyDown event occurs.

Call this method from the class implementing Game interface:

void GameMain::keyDown(HFCore::Keyboard::KeyboardInfo kb)
{
HFCORE_WIDMGR->keyDown(kb);
}
Parameters
kbKeyboard::KeyboardInfo structure.

Definition at line 565 of file WidgetManager.cpp.

◆ keyUp()

void WidgetManager::keyUp ( Keyboard::KeyboardInfo  kb)
virtual

Called automatically when Keyboard keyUp event occurs.

Call this method from the class implementing Game interface:

void GameMain::keyUp(HFCore::Keyboard::KeyboardInfo kb)
{
HFCORE_WIDMGR->keyUp(kb);
}
Parameters
kbKeyboard::KeyboardInfo structure.

Definition at line 557 of file WidgetManager.cpp.

◆ killDialog() [1/3]

bool WidgetManager::killDialog ( int32_hf  dialogId,
bool  removeDialog,
bool  deleteDialog 
)

Kill DialogWidget with given dialogId.

Parameters
dialogIdDialog ID.
removeDialogtrue to call removeWidget(), else false.
deleteDialogtrue to free up memory allocated, else false.
Returns
true if DialogWidget was successfully killed, else false.
See also
getDialog()
addDialog()
getDialogCount()

Definition at line 166 of file WidgetManager.cpp.

◆ killDialog() [2/3]

bool WidgetManager::killDialog ( int32_hf  dialogId)

Kill DialogWidget with given dialogId.

Parameters
dialogIdDialog ID.
Returns
true if DialogWidget was successfully killed, else false.
See also
getDialog()
addDialog()
getDialogCount()

Definition at line 206 of file WidgetManager.cpp.

◆ killDialog() [3/3]

bool WidgetManager::killDialog ( DialogWidget dialogWidget)

Kill DialogWidget.

Parameters
dialogWidgetPointer to DialogWidget to kill.
Returns
true if DialogWidget was successfully killed, else false.
See also
getDialog()
addDialog()
getDialogCount()

Definition at line 211 of file WidgetManager.cpp.

◆ lostFocus()

void WidgetManager::lostFocus ( )

Called when the Widget loses focus.

Call this method from the class implementing Game interface:

void GameMain::windowFocusLost(int32_hf windowID)
{
// Let WidgetManager call lostFocus for correct Widget:
HFCORE_WIDMGR->lostFocus();
}
See also
gotFocus()
setFocus()

Definition at line 354 of file WidgetManager.cpp.

◆ mouseButtonDown()

void WidgetManager::mouseButtonDown ( Mouse::MouseInfo  mouse)
virtual

Called automatically when Mouse button down event occurs.

Call this method from the class implementing Game interface:

void GameMain::mouseButtonDown(HFCore::Mouse::MouseInfo mouse)
{
HFCORE_WIDMGR->mouseButtonDown(mouse);
}
Parameters
mouseMouse::MouseInfo structure.

Definition at line 673 of file WidgetManager.cpp.

◆ mouseButtonUp()

void WidgetManager::mouseButtonUp ( Mouse::MouseInfo  mouse)
virtual

Called automatically when Mouse button up event occurs.

Call this method from the class implementing Game interface:

void GameMain::mouseButtonUp(HFCore::Mouse::MouseInfo mouse)
{
HFCORE_WIDMGR->mouseButtonUp(mouse);
}
Parameters
mouseMouse::MouseInfo structure.

Definition at line 700 of file WidgetManager.cpp.

◆ mouseEnter()

void WidgetManager::mouseEnter ( Mouse::MouseInfo  mouse)
virtual

Called automatically when Mouse enter event occurs.

Call this method from the class implementing Game interface:

void GameMain::mouseEnter(HFCore::Mouse::MouseInfo mouse)
{
HFCORE_WIDMGR->mouseEnter(mouse);
}
Parameters
mouseMouse::MouseInfo structure.

Definition at line 725 of file WidgetManager.cpp.

◆ mouseLeave()

void WidgetManager::mouseLeave ( Mouse::MouseInfo  mouse)
virtual

Called automatically when Mouse leave event occurs.

Call this method from the class implementing Game interface:

void GameMain::mouseLeave(HFCore::Mouse::MouseInfo mouse)
{
HFCORE_WIDMGR->mouseLeave(mouse);
}
Parameters
mouseMouse::MouseInfo structure.

Definition at line 737 of file WidgetManager.cpp.

◆ mouseMove()

void WidgetManager::mouseMove ( Mouse::MouseInfo  mouse)
virtual

Called automatically when Mouse motion event occurs.

Call this method from the class implementing Game interface:

void GameMain::mouseMove(HFCore::Mouse::MouseInfo mouse)
{
HFCORE_WIDMGR->mouseMove(mouse);
}
Parameters
mouseMouse::MouseInfo structure.

Definition at line 625 of file WidgetManager.cpp.

◆ mouseWheel()

void WidgetManager::mouseWheel ( Mouse::MouseInfo  mouse)
virtual

Called automatically when Mouse wheel event occurs.

Call this method from the class implementing Game interface:

void GameMain::mouseWheel(HFCore::Mouse::MouseInfo mouse)
{
HFCORE_WIDMGR->mouseWheel(mouse);
}
Parameters
mouseMouse::MouseInfo structure.

Definition at line 716 of file WidgetManager.cpp.

◆ remapMouse()

void WidgetManager::remapMouse ( int32_hf x,
int32_hf y 
)

Do some internal Mouse re-mapping.

Parameters
xX position.
yY position.

Definition at line 549 of file WidgetManager.cpp.

◆ removeBaseModal()

void WidgetManager::removeBaseModal ( Widget widget)

Remove base modal Widget.

Parameters
widgetPointer to Widget.
See also
addBaseModal()

Definition at line 238 of file WidgetManager.cpp.

◆ removeOverlay()

void WidgetManager::removeOverlay ( Widget widget)

Remove widget from internal WidgetManager::DeferredOverlayVector.

Parameters
widgetPointer to Widget.
See also
deferOverlay()
flushDeferredOverlayWidgets()

Definition at line 433 of file WidgetManager.cpp.

◆ setFocus()

void WidgetManager::setFocus ( Widget widget)
virtual

Set focus on widget.

Parameters
widgetPointer to Widget.

Reimplemented from HFCore::WidgetContainer.

Definition at line 324 of file WidgetManager.cpp.

◆ setPopupCommandWidget()

void WidgetManager::setPopupCommandWidget ( Widget list)

Set popup command Widget.

Parameters
listPointer to Widget.

Definition at line 513 of file WidgetManager.cpp.

◆ touchDown()

void WidgetManager::touchDown ( Touch::TouchInfo  touch)
virtual

Called automatically when Touch down event occurs.

Call this method from the class implementing Game interface:

void GameMain::touchDown(HFCore::Touch::TouchInfo touch)
{
HFCORE_WIDMGR->touchDown(touch);
}
Parameters
touchTouch::TouchInfo structure.

Definition at line 573 of file WidgetManager.cpp.

◆ touchMove()

void WidgetManager::touchMove ( Touch::TouchInfo  touch)
virtual

Called automatically when Touch move/drag event occurs.

Call this method from the class implementing Game interface:

void GameMain::touchMove(HFCore::Touch::TouchInfo touch)
{
HFCORE_WIDMGR->touchMove(touch);
}
Parameters
touchTouch::TouchInfo structure.

Definition at line 616 of file WidgetManager.cpp.

◆ touchUp()

void WidgetManager::touchUp ( Touch::TouchInfo  touch)
virtual

Called automatically when Touch up event occurs.

Call this method from the class implementing Game interface:

void GameMain::touchUp(HFCore::Touch::TouchInfo touch)
{
HFCORE_WIDMGR->touchUp(touch);
}
Parameters
touchTouch::TouchInfo structure.

Definition at line 600 of file WidgetManager.cpp.

◆ updateFrame()

void WidgetManager::updateFrame ( fp32_hf  dt)

Called by the framework once for every iteration of the game loop, immediately before rendering takes place.

Call this method from the class implementing Game interface:

void GameMain::update(fp32_hf dt)
{
// Let WidgetManager call all Widget update methods:
HFCORE_WIDMGR->updateFrame(g);
}
Parameters
dtAmount of time that's passed since the last call.
See also
drawFrame()

Definition at line 505 of file WidgetManager.cpp.


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