| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- #pragma once
- #include "BsPrerequisites.h"
- #include "BsGUIButtonBase.h"
- #include "BsImageSprite.h"
- #include "BsTextSprite.h"
- #include "BsGUIContent.h"
- #include "BsEvent.h"
- namespace BansheeEngine
- {
- /**
- * @brief GUI button that can be clicked. Has normal, hover and active states
- * with an optional label.
- */
- class BS_EXPORT GUIButton : public GUIButtonBase
- {
- public:
- /**
- * Returns type name of the GUI element used for finding GUI element styles.
- */
- static const String& getGUITypeName();
- /**
- * Creates a new button with the specified label.
- *
- * @param text Label to display on the button.
- * @param stylename Optional style to use for the button. Style will be retrieved
- * from GUISkin of the GUIWidget the element is used on. If not specified
- * default button style is used.
- */
- static GUIButton* create(const HString& text, const String& styleName = StringUtil::BLANK);
- /**
- * Creates a new button with the specified label.
- *
- * @param text Label to display on the button.
- * @param layoutOptions Options that allows you to control how is the element positioned in
- * GUI layout. This will override any similar options set by style.
- * @param stylename Optional style to use for the button. Style will be retrieved
- * from GUISkin of the GUIWidget the element is used on. If not specified
- * default button style is used.
- */
- static GUIButton* create(const HString& text, const GUIOptions& layoutOptions, const String& styleName = StringUtil::BLANK);
- /**
- * Creates a new button with the specified label.
- *
- * @param content Content to display on a button. May include a label, image and a tooltip.
- * @param stylename Optional style to use for the button. Style will be retrieved
- * from GUISkin of the GUIWidget the element is used on. If not specified
- * default button style is used.
- */
- static GUIButton* create(const GUIContent& content, const String& styleName = StringUtil::BLANK);
- /**
- * Creates a new button with the specified label.
- *
- * @param content Content to display on a button. May include a label, image and a tooltip.
- * @param layoutOptions Options that allows you to control how is the element positioned in
- * GUI layout. This will override any similar options set by style.
- * @param stylename Optional style to use for the button. Style will be retrieved
- * from GUISkin of the GUIWidget the element is used on. If not specified
- * default button style is used.
- */
- static GUIButton* create(const GUIContent& content, const GUIOptions& layoutOptions, const String& styleName = StringUtil::BLANK);
- /**
- * @copydoc GUIElement::getElementType
- */
- virtual ElementType getElementType() const { return ElementType::Button; }
- private:
- GUIButton(const String& styleName, const GUIContent& content, const GUILayoutOptions& layoutOptions);
- };
- }
|