summaryrefslogtreecommitdiffhomepage
path: root/Stars45/Button.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Stars45/Button.cpp')
-rw-r--r--Stars45/Button.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/Stars45/Button.cpp b/Stars45/Button.cpp
index 292e29a..c4a8de1 100644
--- a/Stars45/Button.cpp
+++ b/Stars45/Button.cpp
@@ -262,7 +262,7 @@ Button::Draw()
DrawText(text.data(), 0, label_rect, DT_CALCRECT | align);
vert_space = (vert_space - label_rect.h)/2;
-
+
label_rect.w = horz_space;
if (vert_space > 0)
@@ -276,14 +276,14 @@ Button::Draw()
if (drop_shadow) {
label_rect.x++;
label_rect.y++;
-
+
font->SetColor(back_color);
DrawText(text.data(), text.length(), label_rect, align);
-
+
label_rect.x--;
label_rect.y--;
}
-
+
font->SetColor(fore_color);
DrawText(text.data(), text.length(), label_rect, align);
}
@@ -351,13 +351,13 @@ Button::CalcPictureRect()
int h = rect.h;
int img_w = picture.Width();
int img_h = picture.Height();
-
+
if (img_h > h) img_h = h-2;
if (img_w > w) img_w = w-2;
-
+
int img_x_offset = bevel_width;
int img_y_offset = bevel_width;
-
+
switch (picture_loc)
{
default:
@@ -391,7 +391,7 @@ Button::CalcPictureRect()
img_y_offset = h - img_h - bevel_width;
break;
}
-
+
Rect img_rect;
img_rect.x = img_x_offset;
img_rect.y = img_y_offset;
@@ -557,11 +557,11 @@ int Button::OnClick()
}
int Button::OnMouseEnter(int mx, int my)
-{
+{
if (button_state >= 0)
pre_state = button_state;
- if (button_state == 0)
+ if (button_state == 0)
button_state = -1;
if (IsEnabled() && IsShown())
@@ -571,7 +571,7 @@ int Button::OnMouseEnter(int mx, int my)
}
int Button::OnMouseExit(int mx, int my)
-{
+{
if (button_state == -1)
button_state = pre_state;