Nazara Engine
0.4
A fast, complete, cross-platform API designed for game development
|
Abstract class serving as a base class for all widgets. More...
Inherits Nz::Node.
Inherited by Ndk::ButtonWidget, Ndk::Canvas, Ndk::CheckboxWidget, Ndk::LabelWidget, Ndk::ProgressBarWidget, and Ndk::TextAreaWidget.
Public Member Functions | |
BaseWidget (BaseWidget *parent) | |
Constructs a BaseWidget object using another widget as its parent. More... | |
BaseWidget (const BaseWidget &)=delete | |
BaseWidget (BaseWidget &&)=default | |
virtual | ~BaseWidget () |
Frees the widget, unregistering it from its canvas. | |
template<typename T , typename... Args> | |
T * | Add (Args &&... args) |
void | AddChild (std::unique_ptr< BaseWidget > &&widget) |
void | Center () |
void | CenterHorizontal () |
void | CenterVertical () |
void | Destroy () |
Destroy the widget, deleting it in the process. More... | |
void | EnableBackground (bool enable) |
Enable or disables the widget background. | |
const Nz::Color & | GetBackgroundColor () const |
Canvas * | GetCanvas () |
Nz::SystemCursor | GetCursor () const |
const Padding & | GetPadding () const |
Nz::Vector2f | GetContentOrigin () const |
const Nz::Vector2f & | GetContentSize () const |
Nz::Vector2f | GetSize () const |
bool | IsVisible () const |
void | GrabKeyboard () |
virtual void | ResizeToContent ()=0 |
void | SetBackgroundColor (const Nz::Color &color) |
void | SetCursor (Nz::SystemCursor systemCursor) |
void | SetContentSize (const Nz::Vector2f &size) |
void | SetPadding (float left, float top, float right, float bottom) |
void | SetSize (const Nz::Vector2f &size) |
void | Show (bool show=true) |
BaseWidget & | operator= (const BaseWidget &)=delete |
BaseWidget & | operator= (BaseWidget &&)=default |
Protected Member Functions | |
const EntityHandle & | CreateEntity () |
void | DestroyEntity (Entity *entity) |
virtual void | Layout () |
void | InvalidateNode () override |
virtual void | OnKeyPressed (const Nz::WindowEvent::KeyEvent &key) |
virtual void | OnKeyReleased (const Nz::WindowEvent::KeyEvent &key) |
virtual void | OnMouseEnter () |
virtual void | OnMouseMoved (int x, int y, int deltaX, int deltaY) |
virtual void | OnMouseButtonPress (int x, int y, Nz::Mouse::Button button) |
virtual void | OnMouseButtonRelease (int x, int y, Nz::Mouse::Button button) |
virtual void | OnMouseExit () |
virtual void | OnParentResized (const Nz::Vector2f &newSize) |
virtual void | OnTextEntered (char32_t character, bool repeated) |
Abstract class serving as a base class for all widgets.
Ndk::BaseWidget::BaseWidget | ( | BaseWidget * | parent | ) |
Constructs a BaseWidget object using another widget as its parent.
parent | Parent widget, must be valid and attached to a canvas |
Constructs a BaseWidget object using another widget as a base. This will also register the widget to the canvas owning the top-most widget.
|
inline |
Destroy the widget, deleting it in the process.
Calling this function immediately destroys the widget, freeing its memory.