(svn r8697) [cpp_gui] -Codechange: changed IsWindowOfPrototype() is a Window method
--- a/src/misc_gui.cpp Tue Feb 13 09:54:37 2007 +0000
+++ b/src/misc_gui.cpp Tue Feb 13 10:17:24 2007 +0000
@@ -498,7 +498,7 @@
COPY_IN_DPARAM(0, _errmsg_decode_params, lengthof(_errmsg_decode_params));
DrawWindowWidgets(w);
COPY_IN_DPARAM(0, _errmsg_decode_params, lengthof(_errmsg_decode_params));
- if (!IsWindowOfPrototype(w, _errmsg_face_widgets)) {
+ if (!w->IsWindowOfPrototype(_errmsg_face_widgets)) {
DrawStringMultiCenter(
120,
(_errmsg_message_1 == INVALID_STRING_ID ? 25 : 15),
--- a/src/station_gui.cpp Tue Feb 13 09:54:37 2007 +0000
+++ b/src/station_gui.cpp Tue Feb 13 10:17:24 2007 +0000
@@ -683,7 +683,7 @@
}
} while (pos > -5 && ++i != NUM_CARGO);
- if (IsWindowOfPrototype(w, _station_view_widgets)) {
+ if (w->IsWindowOfPrototype(_station_view_widgets)) {
char *b = _userstring;
bool first = true;
@@ -742,7 +742,7 @@
w->SetDirty();
/* toggle height/widget set */
- if (IsWindowOfPrototype(w, _station_view_expanded_widgets)) {
+ if (w->IsWindowOfPrototype(_station_view_expanded_widgets)) {
w->AssignWidgetToWindow(_station_view_widgets);
w->height = 110;
} else {
--- a/src/window.cpp Tue Feb 13 09:54:37 2007 +0000
+++ b/src/window.cpp Tue Feb 13 10:17:24 2007 +0000
@@ -922,9 +922,9 @@
// }
//}
-bool IsWindowOfPrototype(const Window *w, const Widget *widget)
+bool Window::IsWindowOfPrototype(const Widget *widgets) const
{
- return (w->original_widget == widget);
+ return (original_widget == widgets);
}
/* Copies 'widget' to 'w->widget' to allow for resizable windows */
--- a/src/window.h Tue Feb 13 09:54:37 2007 +0000
+++ b/src/window.h Tue Feb 13 10:17:24 2007 +0000
@@ -387,6 +387,7 @@
static Window* FindById(WindowClass cls, WindowNumber num);
static void SetDirtyById(WindowClass cls, WindowNumber num);
+ bool IsWindowOfPrototype(const Widget *widgets) const;
int GetMenuItemIndex(int x, int y) const;
void ResizeWindow(int x, int y);
@@ -730,7 +731,6 @@
//Window *BringWindowToFrontById(WindowClass cls, WindowNumber number);
Window *FindWindowFromPt(int x, int y);
-bool IsWindowOfPrototype(const Window *w, const Widget *widget);
//Window *AllocateWindow(
// int x,
// int y,