summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-29 06:49:56 +0000
committerrubidium <rubidium@openttd.org>2008-05-29 06:49:56 +0000
commit3716f4814de0cdda1d08ed6a2835383874228423 (patch)
tree36e475cf0450f0f0cf0507bbf3f755dccc35a6cd
parentd3d0432314d3bed01b058ad598c9d056415b6012 (diff)
downloadopenttd-3716f4814de0cdda1d08ed6a2835383874228423.tar.xz
(svn r13318) -Codechange: move some functions from gui.h/misc_gui.cpp to window_gui.h/window.cpp because they belong there.
-rw-r--r--src/gui.h3
-rw-r--r--src/misc_gui.cpp24
-rw-r--r--src/window.cpp24
-rw-r--r--src/window_gui.h4
4 files changed, 28 insertions, 27 deletions
diff --git a/src/gui.h b/src/gui.h
index aa87c9872..bc54f3062 100644
--- a/src/gui.h
+++ b/src/gui.h
@@ -61,9 +61,6 @@ void ShowErrorMessage(StringID msg_1, StringID msg_2, int x, int y);
void ShowSmallMap();
void ShowExtraViewPortWindow(TileIndex tile = INVALID_TILE);
-void SetVScrollCount(Window *w, int num);
-void SetVScroll2Count(Window *w, int num);
-void SetHScrollCount(Window *w, int num);
void BuildFileList();
void SetFiosType(const byte fiostype);
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index c28f7ee20..a9b64beeb 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -717,30 +717,6 @@ void CheckRedrawStationCoverage(const Window *w)
}
}
-void SetVScrollCount(Window *w, int num)
-{
- w->vscroll.count = num;
- num -= w->vscroll.cap;
- if (num < 0) num = 0;
- if (num < w->vscroll.pos) w->vscroll.pos = num;
-}
-
-void SetVScroll2Count(Window *w, int num)
-{
- w->vscroll2.count = num;
- num -= w->vscroll2.cap;
- if (num < 0) num = 0;
- if (num < w->vscroll2.pos) w->vscroll2.pos = num;
-}
-
-void SetHScrollCount(Window *w, int num)
-{
- w->hscroll.count = num;
- num -= w->hscroll.cap;
- if (num < 0) num = 0;
- if (num < w->hscroll.pos) w->hscroll.pos = num;
-}
-
/* Delete a character at the caret position in a text buf.
* If backspace is set, delete the character before the caret,
* else delete the character after it. */
diff --git a/src/window.cpp b/src/window.cpp
index 280ed78a8..33fe7d1a0 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -2068,6 +2068,30 @@ int PositionMainToolbar(Window *w)
return w->left;
}
+void SetVScrollCount(Window *w, int num)
+{
+ w->vscroll.count = num;
+ num -= w->vscroll.cap;
+ if (num < 0) num = 0;
+ if (num < w->vscroll.pos) w->vscroll.pos = num;
+}
+
+void SetVScroll2Count(Window *w, int num)
+{
+ w->vscroll2.count = num;
+ num -= w->vscroll2.cap;
+ if (num < 0) num = 0;
+ if (num < w->vscroll2.pos) w->vscroll2.pos = num;
+}
+
+void SetHScrollCount(Window *w, int num)
+{
+ w->hscroll.count = num;
+ num -= w->hscroll.cap;
+ if (num < 0) num = 0;
+ if (num < w->hscroll.pos) w->hscroll.pos = num;
+}
+
/**
* Relocate all windows to fit the new size of the game application screen
* @param neww New width of the game application screen
diff --git a/src/window_gui.h b/src/window_gui.h
index 7b62da461..020f5797a 100644
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -562,6 +562,10 @@ void ResizeButtons(Window *w, byte left, byte right);
void ResizeWindowForWidget(Window *w, int widget, int delta_x, int delta_y);
+void SetVScrollCount(Window *w, int num);
+void SetVScroll2Count(Window *w, int num);
+void SetHScrollCount(Window *w, int num);
+
/**
* Sets the enabled/disabled status of a widget.