Simple GUI Library
|
Public Member Functions | |
MenuItem (const char *label) | |
void | setOnAction (ActionListener< MenuItem > *listener) |
Public Member Functions inherited from Sgl::Button | |
Button (const char *label) | |
Button (const Image *icon) | |
Button (BaseSkin< Button > *skin) | |
Button (BaseSkin< Button > *skin, const char *label) | |
Button (BaseSkin< Button > *skin, const Image *icon) | |
const char * | getLabel () const |
void | setLabel (const char *label) |
const Image * | getIcon () const |
void | setIcon (const Image *icon) |
void | setOnAction (ActionListener< Button > *listener) |
ActionListener< Button > * | getOnAction () |
Public Member Functions inherited from Sgl::Control | |
virtual Component * | getHitComponent (int32_t x, int32_t y) override |
Public Member Functions inherited from Sgl::Parent | |
virtual void | render (const Sml::Rectangle< int32_t > &targetRegion) override |
virtual void | layout () override final |
virtual void | prerender () override final |
virtual bool | containsComponent (Component *component) override final |
virtual bool | isResizable () const override |
void | addChild (Component *child) |
Convenience method for adding a child to Parent. More... | |
void | addChildren () |
template<typename Head , typename... Tail> | |
void | addChildren (Head head, Tail... tail) |
Convenience method for adding multiple children to Parent. More... | |
void | removeChild (Component *child) |
Convenience method for removing a child to Parent. More... | |
void | removeChildren () |
std::list< Component * > & | getChildren () |
const std::list< Component * > & | getChildrenReadonly () const |
Sml::Texture * | getSnapshot () |
bool | needLayoutPass () const |
void | requestLayoutPass () |
const Background * | getBackground () const |
void | setBackground (const Background *background) |
const Border * | getBorder () const |
void | setBorder (const Border *border) |
Insets | getInsets () const |
Sml::Rectangle< int32_t > | getContentArea () const |
Insets | getPadding () const |
void | setPadding (const Insets &padding) |
void | setPrefWidth (int32_t width) |
void | setPrefHeight (int32_t height) |
void | setMinWidth (int32_t width) |
void | setMinHeight (int32_t height) |
void | setMaxWidth (int32_t width) |
void | setMaxHeight (int32_t height) |
int32_t | getPrefWidth () const |
int32_t | getPrefHeight () const |
int32_t | getMinWidth () const |
int32_t | getMinHeight () const |
int32_t | getMaxWidth () const |
int32_t | getMaxHeight () const |
virtual int32_t | computePrefWidth (int32_t height=-1) const override final |
virtual int32_t | computePrefHeight (int32_t width=-1) const override final |
virtual int32_t | computeMinWidth (int32_t height=-1) const override final |
virtual int32_t | computeMinHeight (int32_t width=-1) const override final |
virtual int32_t | computeMaxWidth (int32_t height=-1) const override final |
virtual int32_t | computeMaxHeight (int32_t width=-1) const override final |
Public Member Functions inherited from Sgl::Component | |
virtual Sml::EventDispatchChain * | buildEventDispatchChain (Sml::EventDispatchChain *chain) override |
bool | isVisible () const |
void | setVisible (bool visible) |
bool | isInteractable () const |
void | setInteractable (bool interactable) |
Visibility | getVisibility () const |
void | setVisibility (Visibility visibility) |
bool | isFocused () const |
bool | isHovered () const |
void | requestFocus () |
void | requestDrag () |
const Shadow & | getShadow () const |
void | setShadow (const ShadowSpecification *specification) |
GuiEventDispatcher * | getEventDispatcher () |
Scene * | getScene () |
void | setScene (Scene *scene) |
const Parent * | getParent () const |
Parent * | getModifiableParent () |
void | setParent (Parent *parent) |
Sml::Vec2i | computeLocalToScenePos (const Sml::Vec2i &localPos) const |
Sml::Vec2i | computeSceneToLocalPos (const Sml::Vec2i &scenePos) const |
Sml::Rectangle< int32_t > | getOriginBounds () const |
const Sml::Rectangle< int32_t > & | getLayoutBounds () const |
const Sml::Vec2i & | getLayoutPos () const |
int32_t | getLayoutX () const |
int32_t | getLayoutY () const |
int32_t | getLayoutWidth () const |
int32_t | getLayoutHeight () const |
void | setLayoutX (int32_t x) |
void | setLayoutY (int32_t y) |
void | setLayoutWidth (int32_t width) |
void | setLayoutHeight (int32_t height) |
Sml::Vec2i | computeScenePos () |
Public Member Functions inherited from Sgl::Skinnable | |
Skin * | getSkin () |
void | setSkin (Skin *skin) |
Additional Inherited Members | |
Public Types inherited from Sgl::Component | |
enum class | Visibility { INVISIBLE_DISABLED = 0b00 , INVISIBLE_INTERACTABLE = 0b01 , VISIBLE_DISABLED = 0b10 , VISIBLE_INTERACTABLE = 0b11 } |
Used to determine if Component should be rendered and targeted by events. More... | |
Public Attributes inherited from Sgl::Component | |
friend | Scene |
Static Public Attributes inherited from Sgl::Component | |
static const int32_t | USE_COMPUTED_SIZE = INT32_MIN |
static const int32_t | UNLIMITED_SIZE = INT32_MAX |
Protected Member Functions inherited from Sgl::Control | |
virtual void | layoutChildren () override final |
virtual void | prerenderSelf () override final |
virtual int32_t | computeCustomPrefWidth (int32_t height=-1) const override |
virtual int32_t | computeCustomPrefHeight (int32_t width=-1) const override |
virtual int32_t | computeCustomMinWidth (int32_t height=-1) const override |
virtual int32_t | computeCustomMinHeight (int32_t width=-1) const override |
virtual int32_t | computeCustomMaxWidth (int32_t height=-1) const override |
virtual int32_t | computeCustomMaxHeight (int32_t width=-1) const override |
Protected Member Functions inherited from Sgl::Parent | |
virtual void | setSceneInSceneTree (Scene *scene) override final |
void | updateSnapshotSize () |
Protected Member Functions inherited from Sgl::Component | |
void | updateShadow () |
void | renderShadow (const Sml::Rectangle< int32_t > &targetRegion) |
Protected Attributes inherited from Sgl::Control | |
Skin * | m_DefaultSkin = nullptr |
Protected Attributes inherited from Sgl::Parent | |
std::list< Component * > | m_Children |
Sml::Texture * | m_Snapshot = nullptr |
bool | m_NeedLayoutPass = false |
const Background * | m_Background = nullptr |
const Border * | m_Border = nullptr |
Insets | m_Padding = Insets::EMPTY |
int32_t | m_PrefWidth = USE_COMPUTED_SIZE |
int32_t | m_PrefHeight = USE_COMPUTED_SIZE |
int32_t | m_MinWidth = USE_COMPUTED_SIZE |
int32_t | m_MinHeight = USE_COMPUTED_SIZE |
int32_t | m_MaxWidth = USE_COMPUTED_SIZE |
int32_t | m_MaxHeight = USE_COMPUTED_SIZE |
Protected Attributes inherited from Sgl::Component | |
Visibility | m_Visibility = Visibility::VISIBLE_INTERACTABLE |
bool | m_Focused = false |
bool | m_Hovered = false |
Shadow | m_Shadow |
GuiEventDispatcher | m_Dispatcher |
Scene * | m_Scene = nullptr |
Parent * | m_Parent = nullptr |
Sml::Rectangle< int32_t > | m_LayoutBounds = {{0, 0}, 0, 0} |
Protected Attributes inherited from Sgl::Skinnable | |
Skin * | m_Skin = nullptr |
Definition at line 19 of file context_menu.h.
Sgl::MenuItem::MenuItem | ( | const char * | label | ) |
Definition at line 15 of file context_menu.cpp.
void Sgl::MenuItem::setOnAction | ( | ActionListener< MenuItem > * | listener | ) |
Definition at line 23 of file context_menu.cpp.