class Button : public Control
{
-protected:
-
- /**
- * Construct a new Button.
- */
- Button();
-
- /**
- * A reference counted object may only be deleted by calling Unreference()
- */
- virtual ~Button();
-
public:
/**
protected:
+ enum ButtonState
+ {
+ ButtonUp, ///< The button is up.
+ ButtonDown, ///< The button is down.
+ };
+
+ /**
+ * Button paint states.
+ */
+ enum PaintState
+ {
+ UnselectedState, ///< The button is unselected.
+ SelectedState, ///< The button is selected.
+ DisabledUnselectedState, ///< The button is disabled and unselected.
+ DisabledSelectedState, ///< The button is disabled and selected.
+ };
+
+ /**
+ * Enum to specify which decoration when getting and setting decorations.
+ */
+ enum DecorationState
+ {
+ UNSELECTED_DECORATION = 0,
+ SELECTED_DECORATION,
+ DECORATION_STATES
+ };
+
+ /**
+ * Construct a new Button.
+ */
+ Button();
+
+ /**
+ * A reference counted object may only be deleted by calling Unreference()
+ */
+ virtual ~Button();
/**
* @return A reference to the label actor.
*/
*/
void OnStageDisconnection();
+
private:
/**
void SetupContent( Actor& actorToModify, Actor newActor );
/**
- * Sets the color of the unselected image.
- * If no image exists, it is created.
- * @param[in] color The color to use.
- */
- void SetUnselectedColor( const Vector4& color );
-
- /**
* Gets the unselected content color.
* @return The currently used unselected color.
*/
const Vector4 GetUnselectedColor() const;
/**
- * Sets the color of the selected image.
- * If no image exists, it is created.
+ * Sets the color of button in selected or unselected state, if image also supplied this color will be appplied to it.
+ * If no visual exists, it is created.
* @param[in] color The color to use.
+ * @param[in] selectedState The state to apply the color to, SelectedState or DisabledUnselectedState.
*/
- void SetSelectedColor( const Vector4& color );
+ void SetColor( const Vector4& color, PaintState selectedState );
/**
* Gets the selected content color.
protected:
- enum ButtonState
- {
- ButtonUp, ///< The button is up.
- ButtonDown, ///< The button is down.
- };
-
- /**
- * Button paint states.
- */
- enum PaintState
- {
- UnselectedState, ///< The button is unselected.
- SelectedState, ///< The button is selected.
- DisabledUnselectedState, ///< The button is disabled and unselected.
- DisabledSelectedState, ///< The button is disabled and selected.
- };
-
- /**
- * Enum to specify which decoration when getting and setting decorations.
- */
- enum DecorationState
- {
- UNSELECTED_DECORATION = 0,
- SELECTED_DECORATION,
- DECORATION_STATES
- };
-
ButtonState GetState();
PaintState GetPaintState();
void SetDecoration( DecorationState state, Actor actor );