![]() |
Lysa
0.0
Lysa 3D Engine
|
A virtual UI Window displayed inside the rendering Window. All UI widgets must belong to a UI window.
Inheritance diagram for Window:Public Types | |
| enum | ResizeableBorder { RESIZEABLE_NONE = 0b0000, RESIZEABLE_LEFT = 0b0001, RESIZEABLE_RIGHT = 0b0010, RESIZEABLE_TOP = 0b0100, RESIZEABLE_BOTTOM = 0b1000 } |
Public Member Functions | |
| Window (const Rect &rect) | |
| void | setResizeableBorders (const uint32 borders) |
| auto | getResizeableBorders () const |
| std::shared_ptr< Style > | getStyle () const |
| void | setStyle (const std::shared_ptr< Style > &style) |
| Widget & | getWidget () const |
| void | setWidget (std::shared_ptr< Widget > child=nullptr, const std::string &resources="", float padding=0) |
| template<typename T > | |
| auto | add (const std::shared_ptr< T > &child, const Widget::AlignmentType alignment, const std::string &resource="", const bool overlap=false) const |
| void | remove (const std::shared_ptr< Widget > &child) const |
| void | setFocusedWidget (const std::shared_ptr< Widget > &widget) |
| auto | getWidth () const |
| auto | getHeight () const |
| void | setRect (const Rect &newRect) |
| void | setWidth (float width) |
| void | setHeight (float height) |
| void | setPos (float x, float y) |
| void | setPos (const float2 &pos) |
| void | setX (float x) |
| void | setY (float y) |
| const auto & | getRect () const |
| auto | isVisible () const |
| void | setVisible (bool isVisible) |
| void | hide () |
| void | show () |
| void | setTransparency (float) |
| virtual void | onCreate () |
| virtual void | onDestroy () |
| virtual void | onShow () |
| virtual void | onHide () |
| virtual void | onResize () |
| virtual void | onMove () |
| virtual bool | onKeyDown (Key key) |
| virtual bool | onKeyUp (Key key) |
| virtual bool | onMouseDown (MouseButton button, float x, float y) |
| virtual bool | onMouseUp (MouseButton button, float x, float y) |
| virtual bool | onMouseMove (uint32 buttonsState, float x, float y) |
| virtual void | onGotFocus () |
| virtual void | onLostFocus () |
| void | setMinimumSize (float width, float height) |
| void | setMaximumSize (float width, float height) |
| auto | getMinimumWidth () const |
| auto | getMinimumHeight () const |
| auto | getMaximumWidth () const |
| auto | getMaximumHeight () const |
| std::shared_ptr< Font > | getFont () const |
| void | setFont (const std::shared_ptr< Font > &font) |
| float | getFontScale () const |
| void | setFontScale (float fontScale) |
| auto & | getTextColor () const |
| void | setTextColor (const float4 &color) |
| void | refresh () const |
| void | eventCreate () |
| void | eventDestroy () |
| void | eventShow () |
| void | eventResize () |
| void | eventMove () |
| void | eventHide () |
| bool | eventKeyDown (Key) |
| bool | eventKeyUp (Key) |
| bool | eventMouseDown (MouseButton, float, float) |
| bool | eventMouseUp (MouseButton, float, float) |
| bool | eventMouseMove (uint32, float, float) |
| void | eventGotFocus () |
| void | eventLostFocus () |
| void | draw () const |
| void | attach (WindowManager *windowManager) |
| void | detach () |
| WindowManager & | getWindowManager () const |
Public Member Functions inherited from Object | |
| void | connect (const Signal::signal &name, const Signal::Handler &handler) |
| void | connect (const Signal::signal &name, const std::function< void ()> &handler) |
| void | emit (const Signal::signal &name, void *params=nullptr) |
| virtual std::string | toString () const |
| Object () = default | |
| virtual | ~Object () = default |
| enum ResizeableBorder |
| Window | ( | const Rect & | rect | ) |
Creates a virtual UI window with a given position & size
|
inline |
Adds a child widget. Children widgets will be destroyed on parent destruction.
| child | : child widget to add |
| alignment | : placement |
| resource | : resource std::string |
| overlap | : overlap widget on top of other widgets |
| void attach | ( | WindowManager * | windowManager | ) |
| void detach | ( | ) |
| void draw | ( | ) | const |
| void eventCreate | ( | ) |
| void eventDestroy | ( | ) |
| void eventGotFocus | ( | ) |
| void eventHide | ( | ) |
| bool eventKeyDown | ( | Key | ) |
| bool eventKeyUp | ( | Key | ) |
| void eventLostFocus | ( | ) |
| bool eventMouseDown | ( | MouseButton | , |
| float | , | ||
| float | |||
| ) |
| bool eventMouseMove | ( | uint32 | , |
| float | , | ||
| float | |||
| ) |
| bool eventMouseUp | ( | MouseButton | , |
| float | , | ||
| float | |||
| ) |
| void eventMove | ( | ) |
| void eventResize | ( | ) |
| void eventShow | ( | ) |
| std::shared_ptr<Font> getFont | ( | ) | const |
Returns the default font loaded at startup
| float getFontScale | ( | ) | const |
|
inline |
Returns the height of the client area
|
inline |
Returns the maximum height of the Window
|
inline |
Returns the maximum width of the Window
|
inline |
Returns the minimum height of the Window
|
inline |
Returns the minimum width of the Window
|
inline |
Returns the size & position of the widget
|
inline |
Returns the borders that can be used to resize the Window
| std::shared_ptr<Style> getStyle | ( | ) | const |
Returns the current style layout or null
|
inline |
| Widget& getWidget | ( | ) | const |
|
inline |
Returns the width of the client area
|
inline |
| void hide | ( | ) |
|
inline |
Returns true if Window is currently visible
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Event called after a position change
|
inlinevirtual |
Event called after a size change
|
inlinevirtual |
| void refresh | ( | ) | const |
|
inline |
Removes a child widget
| void setFocusedWidget | ( | const std::shared_ptr< Widget > & | widget | ) |
Changes the focus
| void setFont | ( | const std::shared_ptr< Font > & | font | ) |
| void setFontScale | ( | float | fontScale | ) |
| void setHeight | ( | float | height | ) |
Sets the height of the client area
| void setMaximumSize | ( | float | width, |
| float | height | ||
| ) |
Sets the maximum size of the Window (default to VECTOR_SCALE)
| void setMinimumSize | ( | float | width, |
| float | height | ||
| ) |
Sets the minimum size of the Window (default to {2.0f, 2.0f})
| void setPos | ( | const float2 & | pos | ) |
Sets the position of the Window, bottom-left
| void setPos | ( | float | x, |
| float | y | ||
| ) |
Sets the position of the Window, bottom-left
| void setRect | ( | const Rect & | newRect | ) |
Sets the client area position & size
|
inline |
Sets the borders that can be used to resize the Window
| void setStyle | ( | const std::shared_ptr< Style > & | style | ) |
Sets the current style layout. If null, installs a default layout
|
inline |
| void setTransparency | ( | float | ) |
Sets the alpha value for transparency
| void setVisible | ( | bool | isVisible | ) |
Sets the Window visibility. The change will be effective at the start of the next frame
| void setWidget | ( | std::shared_ptr< Widget > | child = nullptr, |
| const std::string & | resources = "", |
||
| float | padding = 0 |
||
| ) |
Sets the main widget with optional resource std::string. Call SetLayout(nullptr) if no layout have been set previously
| child | : child widget to add |
| resources | placement |
| padding | : new widget padding |
| void setWidth | ( | float | width | ) |
Sets the width of the client area
| void setX | ( | float | x | ) |
Sets the X position of the Window, bottom-left
| void setY | ( | float | y | ) |
Sets the Y position of the Window, bottom-left
| void show | ( | ) |
Shows the Window. The change will be effective at the start of the next frame
|
friend |