summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-05-09 12:44:12 +0000
committeralberth <alberth@openttd.org>2009-05-09 12:44:12 +0000
commit590becf567a3554cd5954d6444f9e586319b6ae8 (patch)
treebd15752030c9b35ad0d626408fb5051c7ba98953
parent977db77921bf94a4fdcafc3053b2f99defd579b1 (diff)
downloadopenttd-590becf567a3554cd5954d6444f9e586319b6ae8.tar.xz
(svn r16256) -Codechange: Moved load/save dialogue widget numbers outside the window struct.
-rw-r--r--src/misc_gui.cpp79
1 files changed, 41 insertions, 38 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index fc514a2ae..553641fe4 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -1478,36 +1478,53 @@ void ShowQuery(StringID caption, StringID message, Window *parent, QueryCallback
}
+enum SaveLoadWindowWidgets {
+ SLWW_CLOSE = 0,
+ SLWW_WINDOWTITLE,
+ SLWW_SORT_BYNAME,
+ SLWW_SORT_BYDATE,
+ SLWW_BACKGROUND,
+ SLWW_FILE_BACKGROUND,
+ SLWW_HOME_BUTTON,
+ SLWW_DRIVES_DIRECTORIES_LIST,
+ SLWW_SCROLLBAR,
+ SLWW_CONTENT_DOWNLOAD, ///< only available for play scenario/heightmap (content download)
+ SLWW_SAVE_OSK_TITLE, ///< only available for save operations
+ SLWW_DELETE_SELECTION, ///< same in here
+ SLWW_SAVE_GAME, ///< not to mention in here too
+ SLWW_RESIZE,
+};
+
static const Widget _load_dialog_widgets[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_GREY, 0, 10, 0, 13, STR_BLACK_CROSS, STR_TOOLTIP_CLOSE_WINDOW},
-{ WWT_CAPTION, RESIZE_RIGHT, COLOUR_GREY, 11, 256, 0, 13, STR_NULL, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_GREY, 0, 127, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_GREY, 128, 256, 14, 25, STR_SORT_BY_DATE, STR_SORT_ORDER_TIP},
-{ WWT_PANEL, RESIZE_RIGHT, COLOUR_GREY, 0, 256, 26, 47, 0x0, STR_NULL},
-{ WWT_PANEL, RESIZE_RB, COLOUR_GREY, 0, 256, 48, 153, 0x0, STR_NULL},
-{ WWT_PUSHIMGBTN, RESIZE_LR, COLOUR_GREY, 245, 256, 48, 59, SPR_HOUSE_ICON, STR_SAVELOAD_HOME_BUTTON},
-{ WWT_INSET, RESIZE_RB, COLOUR_GREY, 2, 243, 50, 139, 0x0, STR_SAVELOAD_LIST_TOOLTIP},
-{ WWT_SCROLLBAR, RESIZE_LRB, COLOUR_GREY, 245, 256, 60, 141, 0x0, STR_TOOLTIP_VSCROLL_BAR_SCROLLS_LIST},
-{ WWT_PUSHTXTBTN, RESIZE_RTB, COLOUR_GREY, 0, 243, 142, 153, STR_CONTENT_INTRO_BUTTON, STR_CONTENT_INTRO_BUTTON_TIP},
+{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_GREY, 0, 10, 0, 13, STR_BLACK_CROSS, STR_TOOLTIP_CLOSE_WINDOW}, // SLWW_CLOSE
+{ WWT_CAPTION, RESIZE_RIGHT, COLOUR_GREY, 11, 256, 0, 13, STR_NULL, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS}, // SLWW_WINDOWTITLE
+{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_GREY, 0, 127, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP}, // SLWW_SORT_BYNAME
+{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_GREY, 128, 256, 14, 25, STR_SORT_BY_DATE, STR_SORT_ORDER_TIP}, // SLWW_SORT_BYDATE
+{ WWT_PANEL, RESIZE_RIGHT, COLOUR_GREY, 0, 256, 26, 47, 0x0, STR_NULL}, // SLWW_BACKGROUND
+{ WWT_PANEL, RESIZE_RB, COLOUR_GREY, 0, 256, 48, 153, 0x0, STR_NULL}, // SLWW_FILE_BACKGROUND
+{ WWT_PUSHIMGBTN, RESIZE_LR, COLOUR_GREY, 245, 256, 48, 59, SPR_HOUSE_ICON, STR_SAVELOAD_HOME_BUTTON}, // SLWW_HOME_BUTTON
+{ WWT_INSET, RESIZE_RB, COLOUR_GREY, 2, 243, 50, 139, 0x0, STR_SAVELOAD_LIST_TOOLTIP}, // SLWW_DRIVES_DIRECTORIES_LIST
+{ WWT_SCROLLBAR, RESIZE_LRB, COLOUR_GREY, 245, 256, 60, 141, 0x0, STR_TOOLTIP_VSCROLL_BAR_SCROLLS_LIST}, // SLWW_SCROLLBAR
+{ WWT_PUSHTXTBTN, RESIZE_RTB, COLOUR_GREY, 0, 243, 142, 153, STR_CONTENT_INTRO_BUTTON, STR_CONTENT_INTRO_BUTTON_TIP}, // SLWW_CONTENT_DOWNLOAD
{ WWT_RESIZEBOX, RESIZE_LRTB, COLOUR_GREY, 245, 256, 142, 153, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END},
};
static const Widget _save_dialog_widgets[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_GREY, 0, 10, 0, 13, STR_BLACK_CROSS, STR_TOOLTIP_CLOSE_WINDOW},
-{ WWT_CAPTION, RESIZE_RIGHT, COLOUR_GREY, 11, 256, 0, 13, STR_NULL, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_GREY, 0, 127, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP},
-{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_GREY, 128, 256, 14, 25, STR_SORT_BY_DATE, STR_SORT_ORDER_TIP},
-{ WWT_PANEL, RESIZE_RIGHT, COLOUR_GREY, 0, 256, 26, 47, 0x0, STR_NULL},
-{ WWT_PANEL, RESIZE_RB, COLOUR_GREY, 0, 256, 48, 167, 0x0, STR_NULL},
-{ WWT_PUSHIMGBTN, RESIZE_LR, COLOUR_GREY, 245, 256, 48, 59, SPR_HOUSE_ICON, STR_SAVELOAD_HOME_BUTTON},
-{ WWT_INSET, RESIZE_RB, COLOUR_GREY, 2, 243, 50, 150, 0x0, STR_SAVELOAD_LIST_TOOLTIP},
-{ WWT_SCROLLBAR, RESIZE_LRB, COLOUR_GREY, 245, 256, 60, 151, 0x0, STR_TOOLTIP_VSCROLL_BAR_SCROLLS_LIST},
-{ WWT_PANEL, RESIZE_RTB, COLOUR_GREY, 0, 256, 152, 0, 0x0, STR_NULL},
-{ WWT_EDITBOX, RESIZE_RTB, COLOUR_GREY, 2, 254, 154, 165, STR_SAVE_OSKTITLE, STR_SAVELOAD_EDITBOX_TOOLTIP},
-{ WWT_PUSHTXTBTN, RESIZE_TB, COLOUR_GREY, 0, 127, 168, 179, STR_SAVELOAD_DELETE_BUTTON, STR_SAVELOAD_DELETE_TOOLTIP},
-{ WWT_PUSHTXTBTN, RESIZE_TB, COLOUR_GREY, 128, 244, 168, 179, STR_SAVELOAD_SAVE_BUTTON, STR_SAVELOAD_SAVE_TOOLTIP},
-{ WWT_RESIZEBOX, RESIZE_LRTB, COLOUR_GREY, 245, 256, 168, 179, 0x0, STR_RESIZE_BUTTON},
+{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_GREY, 0, 10, 0, 13, STR_BLACK_CROSS, STR_TOOLTIP_CLOSE_WINDOW}, // SLWW_CLOSE
+{ WWT_CAPTION, RESIZE_RIGHT, COLOUR_GREY, 11, 256, 0, 13, STR_NULL, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS}, // SLWW_WINDOWTITLE
+{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_GREY, 0, 127, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP}, // SLWW_SORT_BYNAME
+{ WWT_PUSHTXTBTN, RESIZE_NONE, COLOUR_GREY, 128, 256, 14, 25, STR_SORT_BY_DATE, STR_SORT_ORDER_TIP}, // SLWW_SORT_BYDATE
+{ WWT_PANEL, RESIZE_RIGHT, COLOUR_GREY, 0, 256, 26, 47, 0x0, STR_NULL}, // SLWW_BACKGROUND
+{ WWT_PANEL, RESIZE_RB, COLOUR_GREY, 0, 256, 48, 167, 0x0, STR_NULL}, // SLWW_FILE_BACKGROUND
+{ WWT_PUSHIMGBTN, RESIZE_LR, COLOUR_GREY, 245, 256, 48, 59, SPR_HOUSE_ICON, STR_SAVELOAD_HOME_BUTTON}, // SLWW_HOME_BUTTON
+{ WWT_INSET, RESIZE_RB, COLOUR_GREY, 2, 243, 50, 150, 0x0, STR_SAVELOAD_LIST_TOOLTIP}, // SLWW_DRIVES_DIRECTORIES_LIST
+{ WWT_SCROLLBAR, RESIZE_LRB, COLOUR_GREY, 245, 256, 60, 151, 0x0, STR_TOOLTIP_VSCROLL_BAR_SCROLLS_LIST}, // SLWW_SCROLLBAR
+{ WWT_PANEL, RESIZE_RTB, COLOUR_GREY, 0, 256, 152, 0, 0x0, STR_NULL}, // SLWW_CONTENT_DOWNLOAD
+{ WWT_EDITBOX, RESIZE_RTB, COLOUR_GREY, 2, 254, 154, 165, STR_SAVE_OSKTITLE, STR_SAVELOAD_EDITBOX_TOOLTIP}, // SLWW_SAVE_OSK_TITLE
+{ WWT_PUSHTXTBTN, RESIZE_TB, COLOUR_GREY, 0, 127, 168, 179, STR_SAVELOAD_DELETE_BUTTON, STR_SAVELOAD_DELETE_TOOLTIP}, // SLWW_DELETE_SELECTION
+{ WWT_PUSHTXTBTN, RESIZE_TB, COLOUR_GREY, 128, 244, 168, 179, STR_SAVELOAD_SAVE_BUTTON, STR_SAVELOAD_SAVE_TOOLTIP}, // SLWW_SAVE_GAME
+{ WWT_RESIZEBOX, RESIZE_LRTB, COLOUR_GREY, 245, 256, 168, 179, 0x0, STR_RESIZE_BUTTON}, // SLWW_RESIZE
{ WIDGETS_END},
};
@@ -1578,20 +1595,6 @@ extern void StartupEngines();
struct SaveLoadWindow : public QueryStringBaseWindow {
private:
- enum SaveLoadWindowWidgets {
- SLWW_CLOSE = 0,
- SLWW_WINDOWTITLE,
- SLWW_SORT_BYNAME,
- SLWW_SORT_BYDATE,
- SLWW_BACKGROUND,
- SLWW_HOME_BUTTON = 6,
- SLWW_DRIVES_DIRECTORIES_LIST,
- SLWW_CONTENT_DOWNLOAD = 9, ///< only available for play scenario/heightmap (content download)
- SLWW_SAVE_OSK_TITLE, ///< only available for save operations
- SLWW_DELETE_SELECTION, ///< same in here
- SLWW_SAVE_GAME, ///< not to mention in here too
- };
-
FiosItem o_dir;
public: