summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-10 15:37:27 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-10 15:37:27 +0300
commitb2f23e4a4f57a88ee4872d1f5af4cf97ed0d9bed (patch)
treefe270dd4eec62bd6973d5e21d6662f78cc93b24c /src
parent66b6d8d740670a6053d0714ed63776119f7e13c3 (diff)
downloadmanaplus-b2f23e4a4f57a88ee4872d1f5af4cf97ed0d9bed.tar.gz
manaplus-b2f23e4a4f57a88ee4872d1f5af4cf97ed0d9bed.tar.bz2
manaplus-b2f23e4a4f57a88ee4872d1f5af4cf97ed0d9bed.tar.xz
manaplus-b2f23e4a4f57a88ee4872d1f5af4cf97ed0d9bed.zip
Sort varibles in button and remove some unused functions.
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/button.cpp50
-rw-r--r--src/gui/widgets/button.h71
2 files changed, 52 insertions, 69 deletions
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index 1d3d4427b..6fe3e9bc2 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -105,11 +105,6 @@ Button::Button(const Widget2 *const widget) :
FocusListener(),
WidgetListener(),
mCaption(),
- mHasMouse(false),
- mKeyPressed(false),
- mMousePressed(false),
- mAlignment(Graphics::CENTER),
- mSpacing(4),
mDescription(),
mVertexes2(new ImageCollection),
mEnabledColor(getThemeColor(Theme::BUTTON)),
@@ -122,13 +117,18 @@ Button::Button(const Widget2 *const widget) :
mPressedColor2(getThemeColor(Theme::BUTTON_PRESSED_OUTLINE)),
mImages(nullptr),
mImageSet(nullptr),
+ mAlignment(Graphics::CENTER),
mClickCount(0),
+ mSpacing(4),
mTag(0),
mMode(0),
mXOffset(0),
mYOffset(0),
mImageWidth(0),
mImageHeight(0),
+ mHasMouse(false),
+ mKeyPressed(false),
+ mMousePressed(false),
mStick(false),
mPressed(false)
{
@@ -146,11 +146,6 @@ Button::Button(const Widget2 *const widget,
FocusListener(),
WidgetListener(),
mCaption(caption),
- mHasMouse(false),
- mKeyPressed(false),
- mMousePressed(false),
- mAlignment(Graphics::CENTER),
- mSpacing(4),
mDescription(),
mVertexes2(new ImageCollection),
mEnabledColor(getThemeColor(Theme::BUTTON)),
@@ -163,13 +158,18 @@ Button::Button(const Widget2 *const widget,
mPressedColor2(getThemeColor(Theme::BUTTON_PRESSED_OUTLINE)),
mImages(nullptr),
mImageSet(nullptr),
+ mAlignment(Graphics::CENTER),
mClickCount(0),
+ mSpacing(4),
mTag(0),
mMode(0),
mXOffset(0),
mYOffset(0),
mImageWidth(0),
mImageHeight(0),
+ mHasMouse(false),
+ mKeyPressed(false),
+ mMousePressed(false),
mStick(false),
mPressed(false)
{
@@ -193,11 +193,6 @@ Button::Button(const Widget2 *const widget,
FocusListener(),
WidgetListener(),
mCaption(caption),
- mHasMouse(false),
- mKeyPressed(false),
- mMousePressed(false),
- mAlignment(Graphics::CENTER),
- mSpacing(4),
mDescription(),
mVertexes2(new ImageCollection),
mEnabledColor(getThemeColor(Theme::BUTTON)),
@@ -210,13 +205,18 @@ Button::Button(const Widget2 *const widget,
mPressedColor2(getThemeColor(Theme::BUTTON_PRESSED_OUTLINE)),
mImages(nullptr),
mImageSet(nullptr),
+ mAlignment(Graphics::CENTER),
mClickCount(0),
+ mSpacing(4),
mTag(0),
mMode(0),
mXOffset(0),
mYOffset(0),
mImageWidth(imageWidth),
mImageHeight(imageHeight),
+ mHasMouse(false),
+ mKeyPressed(false),
+ mMousePressed(false),
mStick(false),
mPressed(false)
{
@@ -240,11 +240,6 @@ Button::Button(const Widget2 *const widget,
FocusListener(),
WidgetListener(),
mCaption(),
- mHasMouse(false),
- mKeyPressed(false),
- mMousePressed(false),
- mAlignment(Graphics::CENTER),
- mSpacing(4),
mDescription(),
mVertexes2(new ImageCollection),
mEnabledColor(getThemeColor(Theme::BUTTON)),
@@ -257,13 +252,18 @@ Button::Button(const Widget2 *const widget,
mPressedColor2(getThemeColor(Theme::BUTTON_PRESSED_OUTLINE)),
mImages(nullptr),
mImageSet(nullptr),
+ mAlignment(Graphics::CENTER),
mClickCount(0),
+ mSpacing(4),
mTag(0),
mMode(0),
mXOffset(0),
mYOffset(0),
mImageWidth(imageWidth),
mImageHeight(imageHeight),
+ mHasMouse(false),
+ mKeyPressed(false),
+ mMousePressed(false),
mStick(false),
mPressed(false)
{
@@ -287,11 +287,6 @@ Button::Button(const Widget2 *const widget,
FocusListener(),
WidgetListener(),
mCaption(caption),
- mHasMouse(false),
- mKeyPressed(false),
- mMousePressed(false),
- mAlignment(Graphics::CENTER),
- mSpacing(4),
mDescription(),
mVertexes2(new ImageCollection),
mEnabledColor(getThemeColor(Theme::BUTTON)),
@@ -304,13 +299,18 @@ Button::Button(const Widget2 *const widget,
mPressedColor2(getThemeColor(Theme::BUTTON_PRESSED_OUTLINE)),
mImages(nullptr),
mImageSet(nullptr),
+ mAlignment(Graphics::CENTER),
mClickCount(0),
+ mSpacing(4),
mTag(0),
mMode(0),
mXOffset(0),
mYOffset(0),
mImageWidth(0),
mImageHeight(0),
+ mHasMouse(false),
+ mKeyPressed(false),
+ mMousePressed(false),
mStick(false),
mPressed(false)
{
diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h
index 7491ef987..9c9dce3cc 100644
--- a/src/gui/widgets/button.h
+++ b/src/gui/widgets/button.h
@@ -233,25 +233,6 @@ class Button final : public Widget,
Graphics::Alignment getAlignment() const
{ return mAlignment; }
- /**
- * Sets the spacing between the border of the button and its caption.
- *
- * @param spacing The default value for spacing is 4 and can be changed
- * using this method.
- * @see getSpacing
- */
- void setSpacing(unsigned int spacing)
- { mSpacing = spacing; }
-
- /**
- * Gets the spacing between the border of the button and its caption.
- *
- * @return spacing.
- * @see setSpacing
- */
- unsigned int getSpacing() const
- { return mSpacing; }
-
void focusLost(const Event& event) override final;
void mousePressed(MouseEvent& event) override final;
@@ -291,31 +272,6 @@ class Button final : public Widget,
*/
std::string mCaption;
- /**
- * True if the mouse is ontop of the button, false otherwise.
- */
- bool mHasMouse;
-
- /**
- * True if a key has been pressed, false otherwise.
- */
- bool mKeyPressed;
-
- /**
- * True if a mouse has been pressed, false otherwise.
- */
- bool mMousePressed;
-
- /**
- * Holds the alignment of the caption.
- */
- Graphics::Alignment mAlignment;
-
- /**
- * Holds the spacing between the border and the caption.
- */
- unsigned int mSpacing;
-
std::string mDescription;
ImageCollection *mVertexes2;
Color mEnabledColor;
@@ -328,13 +284,40 @@ class Button final : public Widget,
Color mPressedColor2;
Image **mImages;
ImageSet *mImageSet;
+
+ /**
+ * Holds the alignment of the caption.
+ */
+ Graphics::Alignment mAlignment;
+
unsigned mClickCount;
+
+ /**
+ * Holds the spacing between the border and the caption.
+ */
+ unsigned int mSpacing;
+
int mTag;
int mMode;
int mXOffset;
int mYOffset;
int mImageWidth;
int mImageHeight;
+ /**
+ * True if the mouse is ontop of the button, false otherwise.
+ */
+ bool mHasMouse;
+
+ /**
+ * True if a key has been pressed, false otherwise.
+ */
+ bool mKeyPressed;
+
+ /**
+ * True if a mouse has been pressed, false otherwise.
+ */
+ bool mMousePressed;
+
bool mStick;
bool mPressed;
};