summaryrefslogtreecommitdiff
path: root/src/train_gui.cpp
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2007-01-24 02:36:55 +0000
committerbjarni <bjarni@openttd.org>2007-01-24 02:36:55 +0000
commite2f72cbf1ff97f1b0eab68614ac730fe8cd47b73 (patch)
tree6db06687d695ee0417f9694efa9466b841ab1481 /src/train_gui.cpp
parenta1a6e1eb85017bcddef24825103fb86240535d2e (diff)
downloadopenttd-e2f72cbf1ff97f1b0eab68614ac730fe8cd47b73.tar.xz
(svn r8384) -Codechange: [GUI] instead of writing a resize button function for each window, a global ResizeButtons() is added
Diffstat (limited to 'src/train_gui.cpp')
-rw-r--r--src/train_gui.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/train_gui.cpp b/src/train_gui.cpp
index 060c1fea5..b952b3534 100644
--- a/src/train_gui.cpp
+++ b/src/train_gui.cpp
@@ -506,19 +506,6 @@ static void DrawTrainDetailsWindow(Window *w)
}
}
-static void TrainDetailButtonResize(Window *w)
-{
- /* Make the buttons in the bottom equal in size */
- w->widget[12].right = w->widget[13].left - 1; // right point of the buttons (4/4)
- w->widget[10].right = w->widget[12].right / 2; // the middle of the buttons (2/4)
- w->widget[ 9].right = w->widget[10].right / 2; // 1/4 of the buttons
- w->widget[11].right = w->widget[10].right + w->widget[ 9].right; // (2+1)/4 = 3/4 of the buttons
- /* Now the right side of the buttons are set. We will now set the left sides next to them */
- w->widget[10].left = w->widget[ 9].right + 1;
- w->widget[11].left = w->widget[10].right + 1;
- w->widget[12].left = w->widget[11].right + 1;
-}
-
static void TrainDetailsWndProc(Window *w, WindowEvent *e)
{
switch (e->event) {
@@ -573,7 +560,7 @@ do_change_service_int:
break;
case WE_RESIZE:
- if (e->we.sizing.diff.x != 0) TrainDetailButtonResize(w);
+ if (e->we.sizing.diff.x != 0) ResizeButtons(w, 9, 13);
if (e->we.sizing.diff.y == 0) break;
w->vscroll.cap += e->we.sizing.diff.y / 14;