src/signs_gui.cpp
author Tero Marttila <terom@fixme.fi>
Tue, 22 Jul 2008 21:51:14 +0300
changeset 11180 982e9f814f97
parent 10947 10533a7545b6
permissions -rw-r--r--
scan for tarfiles in CACHE_DIR, remember what Subdirectory a tar was found in, set the GCF_FLAG on GRFs loaded from there, and hide those in the NewGRF GUI
2186
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2163
diff changeset
     1
/* $Id$ */
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2163
diff changeset
     2
10429
1b99254f9607 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents: 10229
diff changeset
     3
/** @file signs_gui.cpp The GUI for signs. */
6916
e87d54a598ea (svn r9556) -Documentation: doxygen and comment-style changes. 'R', 'S'.. The end of the preliminary work is near
belugas
parents: 6573
diff changeset
     4
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     5
#include "stdafx.h"
1891
92a3b0aa0946 (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.
Darkvater
parents: 1575
diff changeset
     6
#include "openttd.h"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     7
#include "gui.h"
8603
88c5ce6a5215 (svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found.
rubidium
parents: 8602
diff changeset
     8
#include "textbuf_gui.h"
88c5ce6a5215 (svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found.
rubidium
parents: 8602
diff changeset
     9
#include "window_gui.h"
8750
fdd6054e7bae (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents: 8720
diff changeset
    10
#include "player_gui.h"
10947
10533a7545b6 (svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
smatz
parents: 10641
diff changeset
    11
#include "player_func.h"
9286
d446bf9f4a68 (svn r12501) -Codechange: split signs.h.
rubidium
parents: 9245
diff changeset
    12
#include "signs_base.h"
d446bf9f4a68 (svn r12501) -Codechange: split signs.h.
rubidium
parents: 9245
diff changeset
    13
#include "signs_func.h"
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    14
#include "debug.h"
2159
3b634157c3b2 (svn r2669) Shuffle some more stuff around to reduce dependencies
tron
parents: 2135
diff changeset
    15
#include "variables.h"
8612
6414fc21c2f3 (svn r11677) -Codechange: move price and command related types/functions to their respective places.
rubidium
parents: 8610
diff changeset
    16
#include "command_func.h"
8610
17cc343a23dd (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents: 8603
diff changeset
    17
#include "strings_func.h"
8626
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8617
diff changeset
    18
#include "core/alloc_func.hpp"
8627
448ebf3a8291 (svn r11692) -Codechange: move some functions from 'functions.h' to a more logical place and remove about 50% of the includes of 'functions.h'
rubidium
parents: 8626
diff changeset
    19
#include "window_func.h"
8635
3bbb6f87fced (svn r11701) -Codechange: removal unnecessary inclusions of map.h (and split map.h).
rubidium
parents: 8627
diff changeset
    20
#include "map_func.h"
8720
4e60c30e2006 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 8635
diff changeset
    21
#include "gfx_func.h"
4e60c30e2006 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 8635
diff changeset
    22
#include "viewport_func.h"
10499
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
    23
#include "querystring_gui.h"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    24
8760
ce0891c412ce (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 8754
diff changeset
    25
#include "table/strings.h"
ce0891c412ce (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 8754
diff changeset
    26
#include "table/sprites.h"
ce0891c412ce (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 8754
diff changeset
    27
4353
2b941f2c325c (svn r6054) Change the sign sorter in a similar way as the other sorters: Remember a list of pointers to signs instead of a list of SignIDs - This removes a layer of indirection
tron
parents: 4349
diff changeset
    28
static const Sign **_sign_sort;
2b941f2c325c (svn r6054) Change the sign sorter in a similar way as the other sorters: Remember a list of pointers to signs instead of a list of SignIDs - This removes a layer of indirection
tron
parents: 4349
diff changeset
    29
static uint _num_sign_sort;
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    30
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    31
static char _bufcache[64];
4353
2b941f2c325c (svn r6054) Change the sign sorter in a similar way as the other sorters: Remember a list of pointers to signs instead of a list of SignIDs - This removes a layer of indirection
tron
parents: 4349
diff changeset
    32
static const Sign *_last_sign;
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    33
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    34
static int CDECL SignNameSorter(const void *a, const void *b)
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    35
{
4353
2b941f2c325c (svn r6054) Change the sign sorter in a similar way as the other sorters: Remember a list of pointers to signs instead of a list of SignIDs - This removes a layer of indirection
tron
parents: 4349
diff changeset
    36
	const Sign *sign0 = *(const Sign**)a;
2b941f2c325c (svn r6054) Change the sign sorter in a similar way as the other sorters: Remember a list of pointers to signs instead of a list of SignIDs - This removes a layer of indirection
tron
parents: 4349
diff changeset
    37
	const Sign *sign1 = *(const Sign**)b;
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    38
	char buf1[64];
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    39
8754
5dae65402806 (svn r11822) -Codechange: Replaced fixed size custom name array. Names are now attached to their object directly and there is
peter1138
parents: 8750
diff changeset
    40
	SetDParam(0, sign0->index);
5dae65402806 (svn r11822) -Codechange: Replaced fixed size custom name array. Names are now attached to their object directly and there is
peter1138
parents: 8750
diff changeset
    41
	GetString(buf1, STR_SIGN_NAME, lastof(buf1));
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    42
4353
2b941f2c325c (svn r6054) Change the sign sorter in a similar way as the other sorters: Remember a list of pointers to signs instead of a list of SignIDs - This removes a layer of indirection
tron
parents: 4349
diff changeset
    43
	if (sign1 != _last_sign) {
2b941f2c325c (svn r6054) Change the sign sorter in a similar way as the other sorters: Remember a list of pointers to signs instead of a list of SignIDs - This removes a layer of indirection
tron
parents: 4349
diff changeset
    44
		_last_sign = sign1;
8754
5dae65402806 (svn r11822) -Codechange: Replaced fixed size custom name array. Names are now attached to their object directly and there is
peter1138
parents: 8750
diff changeset
    45
		SetDParam(0, sign1->index);
5dae65402806 (svn r11822) -Codechange: Replaced fixed size custom name array. Names are now attached to their object directly and there is
peter1138
parents: 8750
diff changeset
    46
		GetString(_bufcache, STR_SIGN_NAME, lastof(_bufcache));
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    47
	}
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    48
3801
866d8cb1d707 (svn r4809) Codechange : Merged two loops in only one.
belugas
parents: 3733
diff changeset
    49
	return strcmp(buf1, _bufcache); // sort by name
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    50
}
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    51
6573
7624f942237f (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6144
diff changeset
    52
static void GlobalSortSignList()
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    53
{
4349
2fc39ff2626e (svn r6050) -Codechange: mass-renamed SignStruct -> Sign and ss -> si. Now functions and variables all match eachother
truelight
parents: 4346
diff changeset
    54
	const Sign *si;
4353
2b941f2c325c (svn r6054) Change the sign sorter in a similar way as the other sorters: Remember a list of pointers to signs instead of a list of SignIDs - This removes a layer of indirection
tron
parents: 4349
diff changeset
    55
	uint n = 0;
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    56
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    57
	/* Create array for sorting */
5860
7fdc9b423ba1 (svn r8066) - Codechange: MallocT(), CallocT(), ReallocT() now return the pointer to allocated memory instead of modifying the pointer given as parameter
KUDr
parents: 5852
diff changeset
    58
	_sign_sort = ReallocT(_sign_sort, GetMaxSignIndex() + 1);
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    59
4353
2b941f2c325c (svn r6054) Change the sign sorter in a similar way as the other sorters: Remember a list of pointers to signs instead of a list of SignIDs - This removes a layer of indirection
tron
parents: 4349
diff changeset
    60
	FOR_ALL_SIGNS(si) _sign_sort[n++] = si;
2b941f2c325c (svn r6054) Change the sign sorter in a similar way as the other sorters: Remember a list of pointers to signs instead of a list of SignIDs - This removes a layer of indirection
tron
parents: 4349
diff changeset
    61
	_num_sign_sort = n;
2b941f2c325c (svn r6054) Change the sign sorter in a similar way as the other sorters: Remember a list of pointers to signs instead of a list of SignIDs - This removes a layer of indirection
tron
parents: 4349
diff changeset
    62
2b941f2c325c (svn r6054) Change the sign sorter in a similar way as the other sorters: Remember a list of pointers to signs instead of a list of SignIDs - This removes a layer of indirection
tron
parents: 4349
diff changeset
    63
	qsort((void*)_sign_sort, n, sizeof(_sign_sort[0]), SignNameSorter);
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    64
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    65
	_sign_sort_dirty = false;
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    66
5568
75f13d7bfaed (svn r7565) -Codechange: Rework DEBUG functionality. Look for appropiate debugging levels to
Darkvater
parents: 5291
diff changeset
    67
	DEBUG(misc, 3, "Resorting global signs list");
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    68
}
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    69
10640
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    70
struct SignListWindow : Window {
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    71
	SignListWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number)
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    72
	{
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    73
		this->vscroll.cap = 12;
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    74
		this->resize.step_height = 10;
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    75
		this->resize.height = this->height - 10 * 7; // minimum if 5 in the list
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    76
10640
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    77
		this->FindWindowPlacementAndResize(desc);
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    78
	}
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    79
10640
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    80
	virtual void OnPaint()
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    81
	{
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    82
		if (_sign_sort_dirty) GlobalSortSignList();
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
    83
10640
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    84
		SetVScrollCount(this, _num_sign_sort);
10166
9124595d2295 (svn r12697) -Codechange: give signs_gui.cpp a touch of coding style.
rubidium
parents: 9286
diff changeset
    85
10640
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    86
		SetDParam(0, this->vscroll.count);
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    87
		this->DrawWidgets();
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    88
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    89
		/* No signs? */
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    90
		int y = 16; // offset from top of widget
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    91
		if (this->vscroll.count == 0) {
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    92
			DrawString(2, y, STR_304A_NONE, TC_FROMSTRING);
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    93
			return;
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    94
		}
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    95
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    96
		/* Start drawing the signs */
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    97
		for (uint16 i = this->vscroll.pos; i < this->vscroll.cap + this->vscroll.pos && i < this->vscroll.count; i++) {
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    98
			const Sign *si = _sign_sort[i];
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
    99
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   100
			if (si->owner != OWNER_NONE) DrawPlayerIcon(si->owner, 4, y + 1);
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   101
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   102
			SetDParam(0, si->index);
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   103
			DrawString(22, y, STR_SIGN_NAME, TC_YELLOW);
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   104
			y += 10;
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   105
		}
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
   106
	}
10640
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   107
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   108
	virtual void OnClick(Point pt, int widget)
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   109
	{
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   110
		if (widget == 3) {
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   111
			uint32 id_v = (pt.y - 15) / 10;
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   112
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   113
			if (id_v >= this->vscroll.cap) return;
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   114
			id_v += this->vscroll.pos;
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   115
			if (id_v >= this->vscroll.count) return;
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   116
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   117
			const Sign *si = _sign_sort[id_v];
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   118
			ScrollMainWindowToTile(TileVirtXY(si->x, si->y));
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   119
		}
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   120
	}
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   121
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   122
	virtual void OnResize(Point new_size, Point delta)
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   123
	{
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   124
		this->vscroll.cap += delta.y / 10;
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   125
	}
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   126
};
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
   127
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
   128
static const Widget _sign_list_widget[] = {
4344
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4293
diff changeset
   129
{   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,              STR_018B_CLOSE_WINDOW},
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4293
diff changeset
   130
{    WWT_CAPTION,  RESIZE_RIGHT,    14,    11,   345,     0,    13, STR_SIGN_LIST_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4293
diff changeset
   131
{  WWT_STICKYBOX,     RESIZE_LR,    14,   346,   357,     0,    13, 0x0,                   STR_STICKY_BUTTON},
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4293
diff changeset
   132
{      WWT_PANEL,     RESIZE_RB,    14,     0,   345,    14,   137, 0x0,                   STR_NULL},
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4293
diff changeset
   133
{  WWT_SCROLLBAR,    RESIZE_LRB,    14,   346,   357,    14,   125, 0x0,                   STR_0190_SCROLL_BAR_SCROLLS_LIST},
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4293
diff changeset
   134
{  WWT_RESIZEBOX,   RESIZE_LRTB,    14,   346,   357,   126,   137, 0x0,                   STR_RESIZE_BUTTON},
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
   135
{   WIDGETS_END},
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
   136
};
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
   137
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
   138
static const WindowDesc _sign_list_desc = {
7837
65d7362153a6 (svn r10704) -Codechange: provide an infrastructure to have resizable windows that are smaller than the default window size.
rubidium
parents: 7623
diff changeset
   139
	WDP_AUTO, WDP_AUTO, 358, 138, 358, 138,
6144
5a0ffbf27ced (svn r8511) -Codechange: make WindowClass an enumerated value.
rubidium
parents: 6002
diff changeset
   140
	WC_SIGN_LIST, WC_NONE,
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
   141
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
   142
	_sign_list_widget,
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
   143
};
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
   144
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
   145
6573
7624f942237f (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6144
diff changeset
   146
void ShowSignList()
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
   147
{
10640
5bef905df159 (svn r13184) -Codechange: make a window class of the signs list.
rubidium
parents: 10629
diff changeset
   148
	AllocateWindowDescFront<SignListWindow>(&_sign_list_desc, 0);
1575
a566a645401f (svn r2079) -Add: signlist, shows all signs in the map. Clicking on them, and you go
truelight
parents: 1130
diff changeset
   149
}
7623
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   150
10499
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   151
static void RenameSign(SignID index, const char *text)
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   152
{
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   153
	_cmd_text = text;
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   154
	DoCommandP(0, index, 0, NULL, CMD_RENAME_SIGN | CMD_MSG(STR_280C_CAN_T_CHANGE_SIGN_NAME));
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   155
}
7623
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   156
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   157
enum QueryEditSignWidgets {
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   158
	QUERY_EDIT_SIGN_WIDGET_TEXT = 3,
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   159
	QUERY_EDIT_SIGN_WIDGET_OK,
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   160
	QUERY_EDIT_SIGN_WIDGET_CANCEL,
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   161
	QUERY_EDIT_SIGN_WIDGET_DELETE,
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   162
	QUERY_EDIT_SIGN_WIDGET_PREVIOUS = QUERY_EDIT_SIGN_WIDGET_DELETE + 2,
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   163
	QUERY_EDIT_SIGN_WIDGET_NEXT,
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   164
};
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   165
10499
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   166
struct SignWindow : QueryStringBaseWindow {
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   167
	SignID cur_sign;
7623
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   168
10499
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   169
	SignWindow(const WindowDesc *desc, const Sign *si) : QueryStringBaseWindow(desc)
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   170
	{
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   171
		SetBit(_no_scroll, SCROLL_EDIT);
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   172
		this->caption = STR_280B_EDIT_SIGN_TEXT;
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   173
		this->afilter = CS_ALPHANUMERAL;
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   174
		this->LowerWidget(QUERY_EDIT_SIGN_WIDGET_TEXT);
7623
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   175
10499
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   176
		UpdateSignEditWindow(si);
10629
0e8f3403b378 (svn r13173) -Codechange: make windows of the main toolbars.
rubidium
parents: 10607
diff changeset
   177
		this->FindWindowPlacementAndResize(desc);
10499
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   178
	}
7623
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   179
10499
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   180
	~SignWindow()
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   181
	{
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   182
		ClrBit(_no_scroll, SCROLL_EDIT);
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   183
	}
7623
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   184
10499
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   185
	void UpdateSignEditWindow(const Sign *si)
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   186
	{
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   187
		/* Display an empty string when the sign hasnt been edited yet */
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   188
		if (si->name != NULL) {
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   189
			SetDParam(0, si->index);
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   190
			GetString(this->edit_str_buf, STR_SIGN_NAME, lastof(this->edit_str_buf));
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   191
		} else {
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   192
			GetString(this->edit_str_buf, STR_EMPTY, lastof(this->edit_str_buf));
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   193
		}
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   194
		this->edit_str_buf[lengthof(this->edit_str_buf) - 1] = '\0';
7623
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   195
10499
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   196
		this->cur_sign = si->index;
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   197
		InitializeTextBuffer(&this->text, this->edit_str_buf, 31, 255); // Allow 31 characters (including \0)
7623
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   198
10499
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   199
		this->InvalidateWidget(QUERY_EDIT_SIGN_WIDGET_TEXT);
7623
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   200
	}
10499
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   201
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   202
	virtual void OnPaint()
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   203
	{
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   204
		SetDParam(0, this->caption);
10595
7957c71b0dfe (svn r13139) -Codechange: move DrawWindowWidgets and DrawWindowViewport to the Window class and remove Window from their naming.
rubidium
parents: 10499
diff changeset
   205
		this->DrawWidgets();
10499
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   206
		this->DrawEditBox(QUERY_EDIT_SIGN_WIDGET_TEXT);
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   207
	}
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   208
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   209
	virtual void OnClick(Point pt, int widget)
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   210
	{
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   211
		switch (widget) {
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   212
			case QUERY_EDIT_SIGN_WIDGET_PREVIOUS: {
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   213
				if (_sign_sort_dirty) GlobalSortSignList();
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   214
				SignID sign_index = _sign_sort[_num_sign_sort - 1]->index;
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   215
				for (uint i = 1; i < _num_sign_sort; i++) {
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   216
					if (this->cur_sign == _sign_sort[i]->index) {
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   217
						sign_index = _sign_sort[i - 1]->index;
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   218
						break;
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   219
					}
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   220
				}
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   221
				const Sign *si = GetSign(sign_index);
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   222
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   223
				/* Scroll to sign and reopen window */
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   224
				ScrollMainWindowToTile(TileVirtXY(si->x, si->y));
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   225
				UpdateSignEditWindow(si);
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   226
			} break;
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   227
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   228
			case QUERY_EDIT_SIGN_WIDGET_NEXT: {
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   229
				if (_sign_sort_dirty) GlobalSortSignList();
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   230
				SignID sign_index = _sign_sort[0]->index;
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   231
				for (uint i = 0; i < _num_sign_sort - 1; i++) {
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   232
					if (this->cur_sign == _sign_sort[i]->index) {
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   233
						sign_index = _sign_sort[i + 1]->index;
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   234
						break;
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   235
					}
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   236
				}
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   237
				const Sign *si = GetSign(sign_index);
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   238
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   239
				/* Scroll to sign and reopen window */
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   240
				ScrollMainWindowToTile(TileVirtXY(si->x, si->y));
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   241
				UpdateSignEditWindow(si);
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   242
			} break;
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   243
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   244
			case QUERY_EDIT_SIGN_WIDGET_TEXT:
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   245
				ShowOnScreenKeyboard(this, widget, QUERY_EDIT_SIGN_WIDGET_CANCEL, QUERY_EDIT_SIGN_WIDGET_OK);
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   246
				break;
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   247
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   248
			case QUERY_EDIT_SIGN_WIDGET_DELETE:
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   249
				/* Only need to set the buffer to null, the rest is handled as the OK button */
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   250
				DeleteTextBufferAll(&this->text);
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   251
				/* FALL THROUGH */
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   252
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   253
			case QUERY_EDIT_SIGN_WIDGET_OK:
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   254
				RenameSign(this->cur_sign, this->text.buf);
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   255
				/* FALL THROUGH */
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   256
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   257
			case QUERY_EDIT_SIGN_WIDGET_CANCEL:
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   258
				delete this;
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   259
				break;
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   260
		}
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   261
	}
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   262
10607
1ab30cead125 (svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
rubidium
parents: 10595
diff changeset
   263
	virtual EventState OnKeyPress(uint16 key, uint16 keycode)
10499
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   264
	{
10607
1ab30cead125 (svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
rubidium
parents: 10595
diff changeset
   265
		EventState state = ES_NOT_HANDLED;
1ab30cead125 (svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
rubidium
parents: 10595
diff changeset
   266
		switch (this->HandleEditBoxKey(QUERY_EDIT_SIGN_WIDGET_TEXT, key, keycode, state)) {
10499
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   267
			case 1: // Enter pressed, confirms change
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   268
				RenameSign(this->cur_sign, this->text.buf);
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   269
				/* FALL THROUGH */
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   270
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   271
			case 2: // ESC pressed, closes window, abandons changes
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   272
				delete this;
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   273
				break;
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   274
		}
10607
1ab30cead125 (svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
rubidium
parents: 10595
diff changeset
   275
		return state;
10499
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   276
	}
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   277
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   278
	virtual void OnMouseLoop()
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   279
	{
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   280
		this->HandleEditBox(QUERY_EDIT_SIGN_WIDGET_TEXT);
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   281
	}
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   282
};
7623
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   283
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   284
static const Widget _query_sign_edit_widgets[] = {
9233
4daa9bb8dbf7 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium
parents: 8760
diff changeset
   285
{ WWT_CLOSEBOX, RESIZE_NONE,  14,   0,  10,   0,  13, STR_00C5,          STR_018B_CLOSE_WINDOW},
4daa9bb8dbf7 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium
parents: 8760
diff changeset
   286
{  WWT_CAPTION, RESIZE_NONE,  14,  11, 259,   0,  13, STR_012D,          STR_NULL },
4daa9bb8dbf7 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium
parents: 8760
diff changeset
   287
{    WWT_PANEL, RESIZE_NONE,  14,   0, 259,  14,  29, STR_NULL,          STR_NULL },
4daa9bb8dbf7 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium
parents: 8760
diff changeset
   288
{  WWT_EDITBOX, RESIZE_NONE,  14,   2, 257,  16,  27, STR_SIGN_OSKTITLE, STR_NULL },  // Text field
4daa9bb8dbf7 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium
parents: 8760
diff changeset
   289
{  WWT_TEXTBTN, RESIZE_NONE,  14,   0,  60,  30,  41, STR_012F_OK,       STR_NULL },
4daa9bb8dbf7 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium
parents: 8760
diff changeset
   290
{  WWT_TEXTBTN, RESIZE_NONE,  14,  61, 120,  30,  41, STR_012E_CANCEL,   STR_NULL },
4daa9bb8dbf7 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium
parents: 8760
diff changeset
   291
{  WWT_TEXTBTN, RESIZE_NONE,  14, 121, 180,  30,  41, STR_0290_DELETE,   STR_NULL },
4daa9bb8dbf7 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium
parents: 8760
diff changeset
   292
{    WWT_PANEL, RESIZE_NONE,  14, 181, 237,  30,  41, STR_NULL,          STR_NULL },
4daa9bb8dbf7 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium
parents: 8760
diff changeset
   293
{  WWT_TEXTBTN, RESIZE_NONE,  14, 238, 248,  30,  41, STR_6819,          STR_PREVIOUS_SIGN_TOOLTIP },
4daa9bb8dbf7 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium
parents: 8760
diff changeset
   294
{  WWT_TEXTBTN, RESIZE_NONE,  14, 249, 259,  30,  41, STR_681A,          STR_NEXT_SIGN_TOOLTIP },
7623
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   295
{ WIDGETS_END },
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   296
};
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   297
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   298
static const WindowDesc _query_sign_edit_desc = {
7837
65d7362153a6 (svn r10704) -Codechange: provide an infrastructure to have resizable windows that are smaller than the default window size.
rubidium
parents: 7623
diff changeset
   299
	190, 170, 260, 42, 260, 42,
7623
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   300
	WC_QUERY_STRING, WC_NONE,
8515
d0401d967e99 (svn r11579) -Revert(r11578): some cases of key propagation are not handled correctly.
belugas
parents: 8514
diff changeset
   301
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
7623
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   302
	_query_sign_edit_widgets,
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   303
};
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   304
10947
10533a7545b6 (svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
smatz
parents: 10641
diff changeset
   305
void HandleClickOnSign(const Sign *si)
10533a7545b6 (svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
smatz
parents: 10641
diff changeset
   306
{
10533a7545b6 (svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
smatz
parents: 10641
diff changeset
   307
	if (_ctrl_pressed && si->owner == _local_player) {
10533a7545b6 (svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
smatz
parents: 10641
diff changeset
   308
		RenameSign(si->index, "");
10533a7545b6 (svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
smatz
parents: 10641
diff changeset
   309
		return;
10533a7545b6 (svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
smatz
parents: 10641
diff changeset
   310
	}
10533a7545b6 (svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
smatz
parents: 10641
diff changeset
   311
	ShowRenameSignWindow(si);
10533a7545b6 (svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
smatz
parents: 10641
diff changeset
   312
}
10533a7545b6 (svn r13501) -Feature(tte): ctrl+click on sign you own to remove it (Osai, planetmaker)
smatz
parents: 10641
diff changeset
   313
7623
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   314
void ShowRenameSignWindow(const Sign *si)
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   315
{
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   316
	/* Delete all other edit windows and the save window */
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   317
	DeleteWindowById(WC_QUERY_STRING, 0);
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   318
	DeleteWindowById(WC_SAVELOAD, 0);
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   319
10499
9c2d9bdea61a (svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
rubidium
parents: 10462
diff changeset
   320
	new SignWindow(&_query_sign_edit_desc, si);
7623
74bc263b1f4c (svn r10401) -Feature: new sign editor features including switching to previous/next sign (XeryusTC)
peter1138
parents: 7552
diff changeset
   321
}