#include <SO3Widget.h>
Classes | |
| struct | WidgetScriptFunction |
Public Member Functions | |
| SWidget (SScene *targetScene, std::string widgetName, int xPos, int yPos, unsigned short widgetWidth, unsigned short widgetHeight, SViewPort *targetViewport, unsigned int widgetZOrder, std::string widgetType) | |
| SWidget (SScene *targetScene, std::string widgetName, int xPos, int yPos, unsigned short widgetWidth, unsigned short widgetHeight, SViewPort *targetViewport, std::string widgetType) | |
| SWidget (SScene *targetScene, std::string widgetName, unsigned short widgetWidth, unsigned short widgetHeight, SMaterial *targetMaterial, unsigned short targetTechnique, unsigned short targetPass, unsigned short targetTextureUnit, std::string widgetType) | |
| ~SWidget () | |
| SScene * | GetParentScene () |
| std::string | GetType () |
| unsigned short | GetWidth () |
| unsigned short | GetHeight () |
| SPoint< unsigned short > | GetSize () |
| void | SetSize (unsigned short newWidth, unsigned short newHeight) |
| void | SetSize (SPoint< unsigned short > newSize) |
| SPoint< int > | GetPosition () |
| void | SetPosition (int xPos, int yPos) |
| void | SetPosition (const SPoint< int > &newPosition) |
| void | Move (const SPoint< int > &relativeMove) |
| virtual void | InjectMouseMove (int xPos, int yPos, MouseButtonId button)=0 |
| virtual void | InjectMouseWheel (int scrollX, int scrollY, int relativeScroll)=0 |
| virtual void | InjectMouseDown (int xPos, int yPos, MouseButtonId button)=0 |
| virtual void | InjectMouseUp (int xPos, int yPos, MouseButtonId button)=0 |
| virtual void | InjectKeyEvent (UINT msg, WindowHandle hwnd, WPARAM wParam, LPARAM lParam)=0 |
| virtual void | InjectTextEvent (std::string utf8)=0 |
| void | Show (bool fade=false, unsigned short fadeDurationMS=300) |
| void | Hide (bool fade=false, unsigned short fadeDurationMS=300) |
| bool | GetVisible () |
| void | SetTransparency (bool enableTransparency) |
| bool | GetTransparency () |
| void | SetOpacity (float widgetOpacity) |
| float | GetOpacity () |
| void | SetIgnoreTransparentPixels (bool widgetIgnoreTransparentPixels, float tresholdColor=0.0f) |
| bool | GetIgnoreTransparentPixels () |
| float | GetIgnoreTransparentPixelsTreshold () |
| virtual void | LoadURL (const std::string &url)=0 |
| virtual void | LoadFile (const std::string &file)=0 |
| void | SetZOrder (unsigned short newWidgetOrder) |
| unsigned short | GetZOrder () |
| void | TakeFocus () |
| bool | HasFocus () |
| void | SetKeyboardEnable (bool enableKeyboardOnWidget) |
| bool | GetKeyboardEnable () |
| void | SetMouseEnable (bool enableMouseOnWidget) |
| bool | GetMouseEnable () |
| bool | GetMouseOver () |
| void | SetForeground (bool enableWidgetForeground) |
| bool | GetForeground () |
| void | SetTopOnFocus (bool enableWidgetTopOnFocus) |
| bool | GetTopOnFocus () |
| virtual void | RunScriptFunction (std::string functionName, std::vector< std::string > argumentList)=0 |
| virtual void | loadResource (Ogre::Resource *resource) |
| virtual int | GetPixelUnder (int posX, int posY)=0 |
Public Attributes | |
| friend | SWidgetManager |
Protected Member Functions | |
| bool | IsCompensateNPOT () const |
| std::string | CheckUrl (const std::string &url) |
| virtual void | SetFocusImpl (bool focusOnWidget)=0 |
| virtual void | SetTransparencyImpl (bool enableTransparency)=0 |
| virtual void | SetKeyboardEnableImpl (bool enableKeyboardOnWidget)=0 |
| virtual void | SetMouseEnableImpl (bool enableMouseOnWidget)=0 |
| virtual void | SetSizeImpl (unsigned short newWidth, unsigned short newHeight)=0 |
Protected Attributes | |
| std::string | baseResourceName |
| int | leftPos |
| int | topPos |
| unsigned short | width |
| unsigned short | height |
| unsigned short | textureWidth |
| The actual texture width allocated in ogre. | |
| unsigned short | textureHeight |
| The actual texture height allocated in ogre. | |
| SScene * | scene |
| SViewPort * | viewport |
| Ogre::TexturePtr | renderingTexture |
| bool | forceRenderingUpdate |
| float | transparentTresholdColor |
Definition at line 50 of file SO3Widget.h.
| SO3::SWidget::SWidget | ( | SScene * | targetScene, | |
| std::string | widgetName, | |||
| int | xPos, | |||
| int | yPos, | |||
| unsigned short | widgetWidth, | |||
| unsigned short | widgetHeight, | |||
| SViewPort * | targetViewport, | |||
| unsigned int | widgetZOrder, | |||
| std::string | widgetType | |||
| ) |
Construct a widget on a SViewport, using an overlay.
Definition at line 47 of file SO3Widget.cpp.
| SO3::SWidget::SWidget | ( | SScene * | targetScene, | |
| std::string | widgetName, | |||
| int | xPos, | |||
| int | yPos, | |||
| unsigned short | widgetWidth, | |||
| unsigned short | widgetHeight, | |||
| SViewPort * | targetViewport, | |||
| std::string | widgetType | |||
| ) |
Construct a widget on a SViewport, using an 2D rect.
Definition at line 55 of file SO3Widget.cpp.
| SO3::SWidget::SWidget | ( | SScene * | targetScene, | |
| std::string | widgetName, | |||
| unsigned short | widgetWidth, | |||
| unsigned short | widgetHeight, | |||
| SMaterial * | targetMaterial, | |||
| unsigned short | targetTechnique, | |||
| unsigned short | targetPass, | |||
| unsigned short | targetTextureUnit, | |||
| std::string | widgetType | |||
| ) |
Construct a widget on an existing SMaterial.
Definition at line 63 of file SO3Widget.cpp.
| SO3::SWidget::~SWidget | ( | ) |
Destructor.
Definition at line 137 of file SO3Widget.cpp.
| std::string SO3::SWidget::CheckUrl | ( | const std::string & | url | ) | [protected] |
Helper function that add "http://" at the begining of an url, if it missing.
Definition at line 656 of file SO3Widget.cpp.
| bool SO3::SWidget::GetForeground | ( | ) |
Retrieve if a widget is setted as foreground (always on top) or not.
Definition at line 541 of file SO3Widget.cpp.
| unsigned short SO3::SWidget::GetHeight | ( | ) |
Definition at line 193 of file SO3Widget.cpp.
| bool SO3::SWidget::GetIgnoreTransparentPixels | ( | ) |
TODO: doc
Definition at line 688 of file SO3Widget.cpp.
| float SO3::SWidget::GetIgnoreTransparentPixelsTreshold | ( | ) |
TODO: doc
Definition at line 693 of file SO3Widget.cpp.
| bool SO3::SWidget::GetKeyboardEnable | ( | ) |
Retrieve if keyboard input is enabled on widget.
Definition at line 640 of file SO3Widget.cpp.
| bool SO3::SWidget::GetMouseEnable | ( | ) |
Retrieve if mouse input is enabled on widget.
Definition at line 651 of file SO3Widget.cpp.
| bool SO3::SWidget::GetMouseOver | ( | ) |
Definition at line 559 of file SO3Widget.cpp.
| float SO3::SWidget::GetOpacity | ( | ) |
Retrieve the opacity coeficient on a transparent widget.
Definition at line 581 of file SO3Widget.cpp.
| SScene * SO3::SWidget::GetParentScene | ( | ) |
Definition at line 173 of file SO3Widget.cpp.
| virtual int SO3::SWidget::GetPixelUnder | ( | int | posX, | |
| int | posY | |||
| ) | [pure virtual] |
return -1 if no pixel is under coordonates.
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
| SPoint< int > SO3::SWidget::GetPosition | ( | ) |
Get the actual position of the widget within the viewport
Definition at line 232 of file SO3Widget.cpp.
| SPoint< unsigned short > SO3::SWidget::GetSize | ( | ) |
Definition at line 198 of file SO3Widget.cpp.
| bool SO3::SWidget::GetTopOnFocus | ( | ) |
Retrieve if a widget is setted as "top on focus" (on top on focus) or not.
Definition at line 530 of file SO3Widget.cpp.
| bool SO3::SWidget::GetTransparency | ( | ) |
Retrieve if a widget got transparent backround.
Definition at line 629 of file SO3Widget.cpp.
| std::string SO3::SWidget::GetType | ( | ) |
Definition at line 178 of file SO3Widget.cpp.
| bool SO3::SWidget::GetVisible | ( | ) |
Whether the widget is hided or showed.
Definition at line 605 of file SO3Widget.cpp.
| unsigned short SO3::SWidget::GetWidth | ( | ) |
Definition at line 188 of file SO3Widget.cpp.
| unsigned short SO3::SWidget::GetZOrder | ( | ) |
Retrieve the order (like a layer) of this widget. 0 is on top.
Definition at line 285 of file SO3Widget.cpp.
| bool SO3::SWidget::HasFocus | ( | ) |
Retrieves whether this widget got the focus or not
Definition at line 551 of file SO3Widget.cpp.
| void SO3::SWidget::Hide | ( | bool | fade = false, |
|
| unsigned short | fadeDurationMS = 300 | |||
| ) |
Hide this Widget.
| fade | Whether or not to fade the Widget down. | |
| fadeDurationMS | If fading, the number of milliseconds to fade for. |
Definition at line 595 of file SO3Widget.cpp.
| virtual void SO3::SWidget::InjectKeyEvent | ( | UINT | msg, | |
| WindowHandle | hwnd, | |||
| WPARAM | wParam, | |||
| LPARAM | lParam | |||
| ) | [pure virtual] |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
| virtual void SO3::SWidget::InjectMouseDown | ( | int | xPos, | |
| int | yPos, | |||
| MouseButtonId | button | |||
| ) | [pure virtual] |
Injects mouse down events into this Widget. You must supply the current coordinates of the mouse in this Widget's own local coordinate space.
| xPos | The absolute X-Value of the mouse, relative to this Widget's origin. | |
| yPos | The absolute Y-Value of the mouse, relative to this Widget's origin. |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
| virtual void SO3::SWidget::InjectMouseMove | ( | int | xPos, | |
| int | yPos, | |||
| MouseButtonId | button | |||
| ) | [pure virtual] |
Injects the mouse's current coordinates (in this Widget's own local coordinate space) into this Widget.
| xPos | The X-coordinate of the mouse, relative to this Widget's origin. | |
| yPos | The Y-coordinate of the mouse, relative to this Widget's origin. |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
| virtual void SO3::SWidget::InjectMouseUp | ( | int | xPos, | |
| int | yPos, | |||
| MouseButtonId | button | |||
| ) | [pure virtual] |
Injects mouse up events into this Widget. You must supply the current coordinates of the mouse in this Widget's own local coordinate space.
| xPos | The absolute X-Value of the mouse, relative to this Widget's origin. | |
| yPos | The absolute Y-Value of the mouse, relative to this Widget's origin. |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
| virtual void SO3::SWidget::InjectMouseWheel | ( | int | scrollX, | |
| int | scrollY, | |||
| int | relativeScroll | |||
| ) | [pure virtual] |
Injects mouse wheel events into this Widget.
| scrollX | scroll distance on X axis | |
| scrollY | scroll distance on Y axis |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
| virtual void SO3::SWidget::InjectTextEvent | ( | std::string | utf8 | ) | [pure virtual] |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
| bool SO3::SWidget::IsCompensateNPOT | ( | ) | const [protected] |
Definition at line 183 of file SO3Widget.cpp.
| virtual void SO3::SWidget::LoadFile | ( | const std::string & | file | ) | [pure virtual] |
Loads a local file.
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
| void SO3::SWidget::loadResource | ( | Ogre::Resource * | resource | ) | [virtual] |
Reimplemented in SO3::SBitmapWidget, and SO3::SObjWindowWidget.
Definition at line 505 of file SO3Widget.cpp.
| virtual void SO3::SWidget::LoadURL | ( | const std::string & | url | ) | [pure virtual] |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
| void SO3::SWidget::Move | ( | const SPoint< int > & | relativeMove | ) |
Move the widget relatively from is actual position.
Definition at line 270 of file SO3Widget.cpp.
| virtual void SO3::SWidget::RunScriptFunction | ( | std::string | functionName, | |
| std::vector< std::string > | argumentList | |||
| ) | [pure virtual] |
Execute an action script function using the parameters passed in the list.
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
| virtual void SO3::SWidget::SetFocusImpl | ( | bool | focusOnWidget | ) | [protected, pure virtual] |
Focus or unfocus widget implementation.
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
| void SO3::SWidget::SetForeground | ( | bool | enableWidgetForeground | ) |
Set widget as foreground (always on top) or not.
Definition at line 535 of file SO3Widget.cpp.
| void SO3::SWidget::SetIgnoreTransparentPixels | ( | bool | widgetIgnoreTransparentPixels, | |
| float | tresholdColor = 0.0f | |||
| ) |
TODO: doc
Definition at line 682 of file SO3Widget.cpp.
| void SO3::SWidget::SetKeyboardEnable | ( | bool | enableKeyboardOnWidget | ) |
Enable keyboard input on widget.
Definition at line 634 of file SO3Widget.cpp.
| virtual void SO3::SWidget::SetKeyboardEnableImpl | ( | bool | enableKeyboardOnWidget | ) | [protected, pure virtual] |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
| void SO3::SWidget::SetMouseEnable | ( | bool | enableMouseOnWidget | ) |
Enable mouse input on widget.
Definition at line 645 of file SO3Widget.cpp.
| virtual void SO3::SWidget::SetMouseEnableImpl | ( | bool | enableMouseOnWidget | ) | [protected, pure virtual] |
Enable mouse input on widget.
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
| void SO3::SWidget::SetOpacity | ( | float | widgetOpacity | ) |
Set the opacity coeficient on a transparent widget (must be bound between 0.0 and 1.0).
Definition at line 564 of file SO3Widget.cpp.
| void SO3::SWidget::SetPosition | ( | const SPoint< int > & | newPosition | ) |
Set the position of the widget in the viewport
Definition at line 245 of file SO3Widget.cpp.
| void SO3::SWidget::SetPosition | ( | int | xPos, | |
| int | yPos | |||
| ) |
Set the position of the widget in the viewport
Definition at line 240 of file SO3Widget.cpp.
| void SO3::SWidget::SetSize | ( | SPoint< unsigned short > | newSize | ) |
Definition at line 208 of file SO3Widget.cpp.
| void SO3::SWidget::SetSize | ( | unsigned short | newWidth, | |
| unsigned short | newHeight | |||
| ) |
Definition at line 203 of file SO3Widget.cpp.
| virtual void SO3::SWidget::SetSizeImpl | ( | unsigned short | newWidth, | |
| unsigned short | newHeight | |||
| ) | [protected, pure virtual] |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
| void SO3::SWidget::SetTopOnFocus | ( | bool | enableWidgetTopOnFocus | ) |
Set widget to be show on first plan when focused (on top on focus) or not.
Definition at line 525 of file SO3Widget.cpp.
| void SO3::SWidget::SetTransparency | ( | bool | enableTransparency | ) |
Activate or deactivate transparent backround on a widget.
Definition at line 615 of file SO3Widget.cpp.
| virtual void SO3::SWidget::SetTransparencyImpl | ( | bool | enableTransparency | ) | [protected, pure virtual] |
Implemented in SO3::SBitmapWidget, SO3::SFlashWidget, and SO3::SObjWindowWidget.
| void SO3::SWidget::SetZOrder | ( | unsigned short | newWidgetOrder | ) |
Set the order (like a layer) of this widget. 0 is on top.
Definition at line 276 of file SO3Widget.cpp.
| void SO3::SWidget::Show | ( | bool | fade = false, |
|
| unsigned short | fadeDurationMS = 300 | |||
| ) |
Shows this Widget.
| fade | Whether or not to fade the Widget up. | |
| fadeDurationMS | If fading, the number of milliseconds to fade for. |
Definition at line 586 of file SO3Widget.cpp.
| void SO3::SWidget::TakeFocus | ( | ) |
Force the focus on this widget
Definition at line 546 of file SO3Widget.cpp.
std::string SO3::SWidget::baseResourceName [protected] |
Definition at line 61 of file SO3Widget.h.
bool SO3::SWidget::forceRenderingUpdate [protected] |
Definition at line 71 of file SO3Widget.h.
unsigned short SO3::SWidget::height [protected] |
Definition at line 65 of file SO3Widget.h.
int SO3::SWidget::leftPos [protected] |
Definition at line 62 of file SO3Widget.h.
Ogre::TexturePtr SO3::SWidget::renderingTexture [protected] |
Definition at line 70 of file SO3Widget.h.
SScene* SO3::SWidget::scene [protected] |
Definition at line 68 of file SO3Widget.h.
| friend SO3::SWidget::SWidgetManager |
Definition at line 54 of file SO3Widget.h.
unsigned short SO3::SWidget::textureHeight [protected] |
The actual texture height allocated in ogre.
Definition at line 67 of file SO3Widget.h.
unsigned short SO3::SWidget::textureWidth [protected] |
The actual texture width allocated in ogre.
Definition at line 66 of file SO3Widget.h.
int SO3::SWidget::topPos [protected] |
Definition at line 63 of file SO3Widget.h.
float SO3::SWidget::transparentTresholdColor [protected] |
Definition at line 72 of file SO3Widget.h.
SViewPort* SO3::SWidget::viewport [protected] |
Definition at line 69 of file SO3Widget.h.
unsigned short SO3::SWidget::width [protected] |
Definition at line 64 of file SO3Widget.h.
1.6.3