OgreGFX::FEButton Class Reference

#include <widgets.h>

Inheritance diagram for OgreGFX::FEButton:

OgreGFX::KeyHandler OgreGFX::MouseHandler OgreGFX::FEPanel OgreGFX::MouseHandler OgreGFX::FEPanel OgreGFX::MouseHandler OgreGFX::FEPanel OgreGFX::MouseHandler OgreGFX::FEPanel OgreGFX::MouseHandler OgreGFX::FEPanel OgreGFX::FEMarineButton OgreGFX::FEMarineButton OgreGFX::FEMarineButton OgreGFX::FEMarineButton OgreGFX::FESCVButton OgreGFX::FESCVButton OgreGFX::FESCVButton OgreGFX::FESCVButton

List of all members.

Public Member Functions

 FEButton (GraphicsInteractionManager *gim, const OIS::KeyCode keyCode, const std::set< OIS::KeyCode > *modifierKeys, const OIS::MouseButtonID oisMouseButtonId, std::string name="FEButton", FastEcslent::CommandFactory *command=NULL, Widget *aParent=0, Ogre::Vector2 defaultPos=Ogre::Vector2::NEGATIVE_UNIT_X, Ogre::Vector2 defaultSize=DEFAULT_LABEL_SIZE, std::string material=DEFAULT_PANEL_MATERIAL, std::string desc="BLANK", Ogre::GuiMetricsMode defaultMode=Ogre::GMM_RELATIVE)
 ~FEButton ()
virtual void handleMouseEvent (const OIS::MouseEvent &args)
virtual void handleKeyEvent ()
virtual void show ()
virtual void hide ()
bool processButtonFirstEvent (bool buttonActivated)
bool processButtonSecondEvent (bool buttonActivated)
 FEButton (GraphicsInteractionManager *gim, const std::set< OIS::KeyCode > *modifierKeys, const OIS::MouseButtonID oisMouseButtonId, std::string name="FEButton", Widget *aParent=0, Ogre::ColourValue color=Ogre::ColourValue::Red, Ogre::Vector2 defaultPos=Ogre::Vector2::NEGATIVE_UNIT_X, Ogre::Vector2 defaultSize=DEFAULT_LABEL_SIZE, bool(*pClickFunction)()=NULL, std::string material=DEFAULT_PANEL_MATERIAL, std::string="BLANK", Ogre::GuiMetricsMode defaultMode=Ogre::GMM_RELATIVE)
 ~FEButton ()
virtual void handleMouseEvent (const OIS::MouseEvent &args)
virtual void show ()
virtual void hide ()
 FEButton (GraphicsInteractionManager *gim, const std::set< OIS::KeyCode > *modifierKeys, const OIS::MouseButtonID oisMouseButtonId, std::string name="FEButton", Widget *aParent=0, Ogre::ColourValue color=Ogre::ColourValue::Red, Ogre::Vector2 defaultPos=Ogre::Vector2::NEGATIVE_UNIT_X, Ogre::Vector2 defaultSize=DEFAULT_LABEL_SIZE, bool(*pClickFunction)()=NULL, std::string material=DEFAULT_PANEL_MATERIAL, std::string="BLANK", Ogre::GuiMetricsMode defaultMode=Ogre::GMM_RELATIVE)
 ~FEButton ()
virtual void handleMouseEvent (const OIS::MouseEvent &args)
virtual void show ()
virtual void hide ()
 FEButton (GraphicsInteractionManager *gim, const std::set< OIS::KeyCode > *modifierKeys, const OIS::MouseButtonID oisMouseButtonId, std::string name="FEButton", Widget *aParent=0, Ogre::ColourValue color=Ogre::ColourValue::Red, Ogre::Vector2 defaultPos=Ogre::Vector2::NEGATIVE_UNIT_X, Ogre::Vector2 defaultSize=DEFAULT_LABEL_SIZE, bool(*pClickFunction)()=NULL, std::string material=DEFAULT_PANEL_MATERIAL, std::string="BLANK", Ogre::GuiMetricsMode defaultMode=Ogre::GMM_RELATIVE)
 ~FEButton ()
virtual void handleMouseEvent (const OIS::MouseEvent &args)
virtual void show ()
virtual void hide ()
 FEButton (GraphicsInteractionManager *gim, const std::set< OIS::KeyCode > *modifierKeys, const OIS::MouseButtonID oisMouseButtonId, std::string name="FEButton", Widget *aParent=0, Ogre::ColourValue color=Ogre::ColourValue::Red, Ogre::Vector2 defaultPos=Ogre::Vector2::NEGATIVE_UNIT_X, Ogre::Vector2 defaultSize=DEFAULT_LABEL_SIZE, bool(*pClickFunction)()=NULL, std::string material=DEFAULT_PANEL_MATERIAL, std::string="BLANK", Ogre::GuiMetricsMode defaultMode=Ogre::GMM_RELATIVE)
 ~FEButton ()
virtual void handleMouseEvent (const OIS::MouseEvent &args)
virtual void show ()
virtual void hide ()

Public Attributes

FastEcslent::CommandFactorycommandFactory
bool pressed
bool enabled
bool(* pClickFunction )()


Detailed Description

A widget which can display text or an image, and detects when a mouse click occurs inside its area. If a mouse event does occur in its area, a function associated with that button is called. Buttons consume the mouse click, so the mouse click doesn't get passed on to any units that might exist beneath the overlay.

Definition at line 293 of file widgets.h.


Constructor & Destructor Documentation

OgreGFX::FEButton::FEButton ( GraphicsInteractionManager gim,
const OIS::KeyCode  keyCode,
const std::set< OIS::KeyCode > *  modifierKeys,
const OIS::MouseButtonID  oisMouseButtonId,
std::string  name = "FEButton",
FastEcslent::CommandFactory command = NULL,
Widget aParent = 0,
Ogre::Vector2  defaultPos = Ogre::Vector2::NEGATIVE_UNIT_X,
Ogre::Vector2  defaultSize = DEFAULT_LABEL_SIZE,
std::string  material = DEFAULT_PANEL_MATERIAL,
std::string  desc = "BLANK",
Ogre::GuiMetricsMode  defaultMode = Ogre::GMM_RELATIVE 
)

Constructor for a Button widget, which displays some text. Clicking on the text causes a function to be called to perform some task.

Parameters:
gim a pointer to the global Graphics Interaction Manager, to display widget.
modifierKeys Pointer to a configuration of keyboard keys that must all be pressed for the button handler to be called.
oisMouseButtonId The ID of the mouse button that must be pressed for the button handler to be called.
name Name of the button
command CommandFactory that produces a command when the button is clicked
aParent A pointer to the parent node, if any (null if this is a root element, or pointer to another widget if this is a child of that widget). Defaults to NULL.
defaultPos Upper-right corner position of the widget, in absolute coordinates if this is a parent node, or relative to the parent node if this is a child node.
defaultSize length and height of the widget.
material Texture name to use for button image
desc Description for button displayed in button help window
defaultMode Mode for how size/position are interpreted (relative/absolute)
See also:
~FEButton()

Definition at line 311 of file widgets.cpp.

OgreGFX::FEButton::~FEButton (  ) 

Definition at line 325 of file widgets.cpp.

References commandFactory.

OgreGFX::FEButton::FEButton ( GraphicsInteractionManager gim,
const std::set< OIS::KeyCode > *  modifierKeys,
const OIS::MouseButtonID  oisMouseButtonId,
std::string  name = "FEButton",
Widget aParent = 0,
Ogre::ColourValue  color = Ogre::ColourValue::Red,
Ogre::Vector2  defaultPos = Ogre::Vector2::NEGATIVE_UNIT_X,
Ogre::Vector2  defaultSize = DEFAULT_LABEL_SIZE,
bool(*)()  pClickFunction = NULL,
std::string  material = DEFAULT_PANEL_MATERIAL,
std::string  desc = "BLANK",
Ogre::GuiMetricsMode  defaultMode = Ogre::GMM_RELATIVE 
)

Constructor for a Button widget, which displays some text. Clicking on the text causes a function to be called to perform some task.

Parameters:
gim a pointer to the global Graphics Interaction Manager, to display widget.
modifierKeys Pointer to a configuration of keyboard keys that must all be pressed for the button handler to be called.
oisMouseButtonId The ID of the mouse button that must be pressed for the button handler to be called.
caption The text to display in the panel
aParent A pointer to the parent node, if any (null if this is a root element, or pointer to another widget if this is a child of that widget). Defaults to NULL.
color The color of the displayed text. Defaults to red
defaultPos Upper-right corner position of the widget, in absolute coordinates if this is a parent node, or relative to the parent node if this is a child node.
defaultSize length and height of the widget.
pClickFunction Pointer to a function, which is called when the button handler is called.
See also:
~FEButton()

Definition at line 285 of file widgets.cpp.

OgreGFX::FEButton::~FEButton (  ) 

OgreGFX::FEButton::FEButton ( GraphicsInteractionManager gim,
const std::set< OIS::KeyCode > *  modifierKeys,
const OIS::MouseButtonID  oisMouseButtonId,
std::string  name = "FEButton",
Widget aParent = 0,
Ogre::ColourValue  color = Ogre::ColourValue::Red,
Ogre::Vector2  defaultPos = Ogre::Vector2::NEGATIVE_UNIT_X,
Ogre::Vector2  defaultSize = DEFAULT_LABEL_SIZE,
bool(*)()  pClickFunction = NULL,
std::string  material = DEFAULT_PANEL_MATERIAL,
std::string  = "BLANK",
Ogre::GuiMetricsMode  defaultMode = Ogre::GMM_RELATIVE 
)

Constructor for a Button widget, which displays some text. Clicking on the text causes a function to be called to perform some task.

Parameters:
gim a pointer to the global Graphics Interaction Manager, to display widget.
modifierKeys Pointer to a configuration of keyboard keys that must all be pressed for the button handler to be called.
oisMouseButtonId The ID of the mouse button that must be pressed for the button handler to be called.
caption The text to display in the panel
aParent A pointer to the parent node, if any (null if this is a root element, or pointer to another widget if this is a child of that widget). Defaults to NULL.
color The color of the displayed text. Defaults to red
defaultPos Upper-right corner position of the widget, in absolute coordinates if this is a parent node, or relative to the parent node if this is a child node.
defaultSize length and height of the widget.
pClickFunction Pointer to a function, which is called when the button handler is called.
See also:
~FEButton()

OgreGFX::FEButton::~FEButton (  ) 

OgreGFX::FEButton::FEButton ( GraphicsInteractionManager gim,
const std::set< OIS::KeyCode > *  modifierKeys,
const OIS::MouseButtonID  oisMouseButtonId,
std::string  name = "FEButton",
Widget aParent = 0,
Ogre::ColourValue  color = Ogre::ColourValue::Red,
Ogre::Vector2  defaultPos = Ogre::Vector2::NEGATIVE_UNIT_X,
Ogre::Vector2  defaultSize = DEFAULT_LABEL_SIZE,
bool(*)()  pClickFunction = NULL,
std::string  material = DEFAULT_PANEL_MATERIAL,
std::string  = "BLANK",
Ogre::GuiMetricsMode  defaultMode = Ogre::GMM_RELATIVE 
)

Constructor for a Button widget, which displays some text. Clicking on the text causes a function to be called to perform some task.

Parameters:
gim a pointer to the global Graphics Interaction Manager, to display widget.
modifierKeys Pointer to a configuration of keyboard keys that must all be pressed for the button handler to be called.
oisMouseButtonId The ID of the mouse button that must be pressed for the button handler to be called.
caption The text to display in the panel
aParent A pointer to the parent node, if any (null if this is a root element, or pointer to another widget if this is a child of that widget). Defaults to NULL.
color The color of the displayed text. Defaults to red
defaultPos Upper-right corner position of the widget, in absolute coordinates if this is a parent node, or relative to the parent node if this is a child node.
defaultSize length and height of the widget.
pClickFunction Pointer to a function, which is called when the button handler is called.
See also:
~FEButton()

OgreGFX::FEButton::~FEButton (  ) 

OgreGFX::FEButton::FEButton ( GraphicsInteractionManager gim,
const std::set< OIS::KeyCode > *  modifierKeys,
const OIS::MouseButtonID  oisMouseButtonId,
std::string  name = "FEButton",
Widget aParent = 0,
Ogre::ColourValue  color = Ogre::ColourValue::Red,
Ogre::Vector2  defaultPos = Ogre::Vector2::NEGATIVE_UNIT_X,
Ogre::Vector2  defaultSize = DEFAULT_LABEL_SIZE,
bool(*)()  pClickFunction = NULL,
std::string  material = DEFAULT_PANEL_MATERIAL,
std::string  = "BLANK",
Ogre::GuiMetricsMode  defaultMode = Ogre::GMM_RELATIVE 
)

Constructor for a Button widget, which displays some text. Clicking on the text causes a function to be called to perform some task.

Parameters:
gim a pointer to the global Graphics Interaction Manager, to display widget.
modifierKeys Pointer to a configuration of keyboard keys that must all be pressed for the button handler to be called.
oisMouseButtonId The ID of the mouse button that must be pressed for the button handler to be called.
caption The text to display in the panel
aParent A pointer to the parent node, if any (null if this is a root element, or pointer to another widget if this is a child of that widget). Defaults to NULL.
color The color of the displayed text. Defaults to red
defaultPos Upper-right corner position of the widget, in absolute coordinates if this is a parent node, or relative to the parent node if this is a child node.
defaultSize length and height of the widget.
pClickFunction Pointer to a function, which is called when the button handler is called.
See also:
~FEButton()

OgreGFX::FEButton::~FEButton (  ) 


Member Function Documentation

void OgreGFX::FEButton::handleMouseEvent ( const OIS::MouseEvent &  args  )  [virtual]

Stores if the button is available to be clicked or not. If false, clicking the button does not result in the associated function being called.

Mouse handler called when a mouse event occurs.

Parameters:
args Information about the mouse state (mouse button, cursor position, etc).
Returns:
void

Reimplemented from OgreGFX::MouseHandler.

Reimplemented in OgreGFX::FESCVButton, OgreGFX::FEMarineButton, OgreGFX::FESCVButton, OgreGFX::FEMarineButton, OgreGFX::FESCVButton, OgreGFX::FEMarineButton, OgreGFX::FESCVButton, and OgreGFX::FEMarineButton.

Definition at line 368 of file widgets.cpp.

References FastEcslent::Both, commandFactory, OgreGFX::Widget::cursonInMe(), enabled, OgreGFX::UIMgr::entIndexUnderMouse(), OgreGFX::Widget::gfx, FastEcslent::NENTITYTYPES, FastEcslent::None, processButtonFirstEvent(), processButtonSecondEvent(), FastEcslent::CommandFactory::requiredTarget, FastEcslent::TargetEntity, FastEcslent::CommandFactory::targetEntityType, and OgreGFX::GraphicsInteractionManager::uiMgr.

Referenced by OgreGFX::UIMgr::handleSingleSelection().

void OgreGFX::FEButton::handleKeyEvent (  )  [virtual]

Reimplemented from OgreGFX::KeyHandler.

Definition at line 331 of file widgets.cpp.

References commandFactory, enabled, FastEcslent::None, processButtonFirstEvent(), processButtonSecondEvent(), and FastEcslent::CommandFactory::requiredTarget.

void OgreGFX::FEButton::show (  )  [virtual]

the height of each separator element

Reimplemented from OgreGFX::FEPanel.

Definition at line 382 of file widgets.cpp.

References DEBUG, and enabled.

void OgreGFX::FEButton::hide (  )  [virtual]

Hides the widget and all sub-elements.

See also:
show()

Reimplemented from OgreGFX::FEPanel.

Definition at line 391 of file widgets.cpp.

References enabled.

bool OgreGFX::FEButton::processButtonFirstEvent ( bool  buttonActivated  ) 

Definition at line 340 of file widgets.cpp.

References OgreGFX::UIMgr::buttonActive, commandFactory, OgreGFX::UIMgr::CreateGhostUnderMouse(), OgreGFX::Widget::gfx, FastEcslent::None, FastEcslent::CommandFactory::previewMeshName, FastEcslent::CommandFactory::requiredTarget, and OgreGFX::GraphicsInteractionManager::uiMgr.

Referenced by handleKeyEvent(), and handleMouseEvent().

bool OgreGFX::FEButton::processButtonSecondEvent ( bool  buttonActivated  ) 

Definition at line 354 of file widgets.cpp.

References FastEcslent::addCommandForEnt(), OgreGFX::UIMgr::buttonActive, OgreGFX::UIMgr::ChangeGhostTextureRBGA(), commandFactory, OgreGFX::Widget::gfx, OgreGFX::UIMgr::ghostUnderMouse, OgreGFX::GraphicsInteractionManager::uiMgr, and OgreGFX::UIMgr::waitingGhosts.

Referenced by handleKeyEvent(), and handleMouseEvent().

virtual void OgreGFX::FEButton::handleMouseEvent ( const OIS::MouseEvent &  args  )  [virtual]

Stores if the button is available to be clicked or not. If false, clicking the button does not result in the associated function being called.

Mouse handler called when a mouse event occurs.

Parameters:
args Information about the mouse state (mouse button, cursor position, etc).
Returns:
void

Reimplemented from OgreGFX::MouseHandler.

Reimplemented in OgreGFX::FESCVButton, OgreGFX::FEMarineButton, OgreGFX::FESCVButton, OgreGFX::FEMarineButton, OgreGFX::FESCVButton, OgreGFX::FEMarineButton, OgreGFX::FESCVButton, and OgreGFX::FEMarineButton.

virtual void OgreGFX::FEButton::show (  )  [virtual]

the height of each separator element

Reimplemented from OgreGFX::FEPanel.

virtual void OgreGFX::FEButton::hide (  )  [virtual]

Hides the widget and all sub-elements.

See also:
show()

Reimplemented from OgreGFX::FEPanel.

virtual void OgreGFX::FEButton::handleMouseEvent ( const OIS::MouseEvent &  args  )  [virtual]

Stores if the button is available to be clicked or not. If false, clicking the button does not result in the associated function being called.

Mouse handler called when a mouse event occurs.

Parameters:
args Information about the mouse state (mouse button, cursor position, etc).
Returns:
void

Reimplemented from OgreGFX::MouseHandler.

Reimplemented in OgreGFX::FESCVButton, OgreGFX::FEMarineButton, OgreGFX::FESCVButton, OgreGFX::FEMarineButton, OgreGFX::FESCVButton, OgreGFX::FEMarineButton, OgreGFX::FESCVButton, and OgreGFX::FEMarineButton.

virtual void OgreGFX::FEButton::show (  )  [virtual]

the height of each separator element

Reimplemented from OgreGFX::FEPanel.

virtual void OgreGFX::FEButton::hide (  )  [virtual]

Hides the widget and all sub-elements.

See also:
show()

Reimplemented from OgreGFX::FEPanel.

virtual void OgreGFX::FEButton::handleMouseEvent ( const OIS::MouseEvent &  args  )  [virtual]

Stores if the button is available to be clicked or not. If false, clicking the button does not result in the associated function being called.

Mouse handler called when a mouse event occurs.

Parameters:
args Information about the mouse state (mouse button, cursor position, etc).
Returns:
void

Reimplemented from OgreGFX::MouseHandler.

Reimplemented in OgreGFX::FESCVButton, OgreGFX::FEMarineButton, OgreGFX::FESCVButton, OgreGFX::FEMarineButton, OgreGFX::FESCVButton, OgreGFX::FEMarineButton, OgreGFX::FESCVButton, and OgreGFX::FEMarineButton.

virtual void OgreGFX::FEButton::show (  )  [virtual]

the height of each separator element

Reimplemented from OgreGFX::FEPanel.

virtual void OgreGFX::FEButton::hide (  )  [virtual]

Hides the widget and all sub-elements.

See also:
show()

Reimplemented from OgreGFX::FEPanel.

virtual void OgreGFX::FEButton::handleMouseEvent ( const OIS::MouseEvent &  args  )  [virtual]

Stores if the button is available to be clicked or not. If false, clicking the button does not result in the associated function being called.

Mouse handler called when a mouse event occurs.

Parameters:
args Information about the mouse state (mouse button, cursor position, etc).
Returns:
void

Reimplemented from OgreGFX::MouseHandler.

Reimplemented in OgreGFX::FESCVButton, OgreGFX::FEMarineButton, OgreGFX::FESCVButton, OgreGFX::FEMarineButton, OgreGFX::FESCVButton, OgreGFX::FEMarineButton, OgreGFX::FESCVButton, and OgreGFX::FEMarineButton.

virtual void OgreGFX::FEButton::show (  )  [virtual]

the height of each separator element

Reimplemented from OgreGFX::FEPanel.

virtual void OgreGFX::FEButton::hide (  )  [virtual]

Hides the widget and all sub-elements.

See also:
show()

Reimplemented from OgreGFX::FEPanel.


Member Data Documentation

FastEcslent::CommandFactory* OgreGFX::FEButton::commandFactory

Definition at line 319 of file widgets.h.

Referenced by handleKeyEvent(), handleMouseEvent(), processButtonFirstEvent(), processButtonSecondEvent(), and ~FEButton().

bool OgreGFX::FEButton::pressed

CommandFactory that generates a command to give to selected entity on button press

Definition at line 320 of file widgets.h.

bool OgreGFX::FEButton::enabled

Stores if the button has been clicked since last update

Definition at line 321 of file widgets.h.

Referenced by handleKeyEvent(), OgreGFX::FEMarineButton::handleMouseEvent(), OgreGFX::FESCVButton::handleMouseEvent(), handleMouseEvent(), hide(), and show().

bool(* OgreGFX::FEButton::pClickFunction)() (  ) 


The documentation for this class was generated from the following files:
Generated on Fri Dec 13 14:54:22 2013 for FastECSLent by  doxygen 1.5.4