author | truelight |
Thu, 24 Mar 2005 14:43:40 +0000 | |
changeset 1540 | 6eef12dab5bf |
parent 1363 | 775a7ee52369 |
child 1657 | af84fedacc6d |
permissions | -rw-r--r-- |
0 | 1 |
#include "stdafx.h" |
2 |
#include "ttd.h" |
|
1363
775a7ee52369
(svn r1867) Include tables/sprites.h only in files which need it
tron
parents:
1177
diff
changeset
|
3 |
#include "table/sprites.h" |
507
04b5403aaf6b
(svn r815) Include strings.h only in the files which need it.
tron
parents:
193
diff
changeset
|
4 |
#include "table/strings.h" |
0 | 5 |
#include "window.h" |
6 |
#include "gfx.h" |
|
7 |
#include "viewport.h" |
|
8 |
||
9 |
static Point HandleScrollbarHittest(Scrollbar *sb, int top, int bottom) |
|
10 |
{ |
|
11 |
Point pt; |
|
12 |
int height, count, pos, cap; |
|
13 |
||
14 |
top += 10; |
|
15 |
bottom -= 9; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
16 |
|
0 | 17 |
height = (bottom - top); |
18 |
||
19 |
pos = sb->pos; |
|
20 |
count = sb->count; |
|
21 |
cap = sb->cap; |
|
22 |
||
23 |
if (count != 0) top += height * pos / count; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
24 |
|
0 | 25 |
if (cap > count) cap = count; |
26 |
if (count != 0) |
|
27 |
bottom -= (count - pos - cap) * height / count; |
|
28 |
||
29 |
pt.x = top; |
|
30 |
pt.y = bottom - 1; |
|
31 |
return pt; |
|
32 |
} |
|
33 |
||
34 |
/***************************************************** |
|
35 |
* Special handling for the scrollbar widget type. |
|
36 |
* Handles the special scrolling buttons and other |
|
37 |
* scrolling. |
|
38 |
* Parameters: |
|
39 |
* w - Window. |
|
40 |
* wi - Pointer to the scrollbar widget. |
|
41 |
* x - The X coordinate of the mouse click. |
|
42 |
* y - The Y coordinate of the mouse click. |
|
43 |
*/ |
|
44 |
||
45 |
void ScrollbarClickHandler(Window *w, const Widget *wi, int x, int y) |
|
46 |
{ |
|
47 |
int mi, ma, pos; |
|
48 |
Scrollbar *sb; |
|
49 |
||
842 | 50 |
switch (wi->type) { |
51 |
case WWT_SCROLLBAR: { |
|
52 |
// vertical scroller |
|
53 |
w->flags4 &= ~WF_HSCROLL; |
|
54 |
w->flags4 &= ~WF_SCROLL2; |
|
55 |
mi = wi->top; |
|
56 |
ma = wi->bottom; |
|
57 |
pos = y; |
|
58 |
sb = &w->vscroll; |
|
59 |
break; |
|
60 |
} |
|
61 |
case WWT_SCROLL2BAR: { |
|
62 |
// 2nd vertical scroller |
|
63 |
w->flags4 &= ~WF_HSCROLL; |
|
64 |
w->flags4 |= WF_SCROLL2; |
|
65 |
mi = wi->top; |
|
66 |
ma = wi->bottom; |
|
67 |
pos = y; |
|
68 |
sb = &w->vscroll2; |
|
69 |
break; |
|
70 |
} |
|
71 |
case WWT_HSCROLLBAR: { |
|
72 |
// horizontal scroller |
|
867
dffd33233237
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
860
diff
changeset
|
73 |
w->flags4 &= ~WF_SCROLL2; |
842 | 74 |
w->flags4 |= WF_HSCROLL; |
75 |
mi = wi->left; |
|
76 |
ma = wi->right; |
|
77 |
pos = x; |
|
78 |
sb = &w->hscroll; |
|
867
dffd33233237
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
860
diff
changeset
|
79 |
break; |
842 | 80 |
} |
845
4960e265d25b
(svn r1326) fixed compiler warnings in vehicle_gui.c and widget.c
bjarni
parents:
842
diff
changeset
|
81 |
default: return; //this should never happen |
0 | 82 |
} |
83 |
if (pos <= mi+9) { |
|
84 |
// Pressing the upper button? |
|
85 |
if (!_demo_mode) { |
|
86 |
w->flags4 |= WF_SCROLL_UP; |
|
87 |
if (_scroller_click_timeout == 0) { |
|
88 |
_scroller_click_timeout = 6; |
|
89 |
if (sb->pos != 0) sb->pos--; |
|
90 |
} |
|
91 |
_left_button_clicked = false; |
|
92 |
} |
|
93 |
} else if (pos >= ma-10) { |
|
94 |
// Pressing the lower button? |
|
95 |
if (!_demo_mode) { |
|
96 |
w->flags4 |= WF_SCROLL_DOWN; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
97 |
|
0 | 98 |
if (_scroller_click_timeout == 0) { |
99 |
_scroller_click_timeout = 6; |
|
100 |
if ((byte)(sb->pos + sb->cap) < sb->count) |
|
101 |
sb->pos++; |
|
102 |
} |
|
103 |
_left_button_clicked = false; |
|
104 |
} |
|
105 |
} else { |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
106 |
// |
0 | 107 |
Point pt = HandleScrollbarHittest(sb, mi, ma); |
108 |
||
109 |
if (pos < pt.x) { |
|
110 |
sb->pos = max(sb->pos - sb->cap, 0); |
|
111 |
} else if (pos > pt.y) { |
|
112 |
sb->pos = min( |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
113 |
sb->pos + sb->cap, |
0 | 114 |
max(sb->count - sb->cap, 0) |
115 |
); |
|
116 |
} else { |
|
117 |
_scrollbar_start_pos = pt.x - mi - 9; |
|
118 |
_scrollbar_size = ma - mi - 23; |
|
119 |
w->flags4 |= WF_SCROLL_MIDDLE; |
|
120 |
_scrolling_scrollbar = true; |
|
121 |
_cursorpos_drag_start = _cursor.pos; |
|
122 |
} |
|
123 |
} |
|
124 |
||
125 |
SetWindowDirty(w); |
|
126 |
} |
|
127 |
||
128 |
/***************************************************** |
|
129 |
* Returns the index for the widget located at the given |
|
130 |
* position relative to the window. |
|
131 |
* Parameters: |
|
132 |
* w - Window |
|
133 |
* x/y - Window client coordinates |
|
134 |
* Returns: |
|
135 |
* A widget index, or -1 if no widget was found. |
|
136 |
*/ |
|
137 |
int GetWidgetFromPos(Window *w, int x, int y) |
|
138 |
{ |
|
139 |
const Widget *wi; |
|
140 |
int index, found_index = -1; |
|
141 |
||
142 |
// Go through the widgets and check if we find the widget that the coordinate is |
|
143 |
// inside. |
|
144 |
for(index=0,wi=w->widget; wi->type != WWT_LAST; index++, wi++) { |
|
145 |
if (wi->type == WWT_EMPTY || wi->type == WWT_FRAME) |
|
146 |
continue; |
|
147 |
||
148 |
if (x >= wi->left && |
|
149 |
x < wi->right && |
|
150 |
y >= wi->top && |
|
151 |
y < wi->bottom && !HASBIT(w->hidden_state,index)) { |
|
152 |
found_index = index; |
|
153 |
} |
|
154 |
} |
|
155 |
||
156 |
// Return the index |
|
157 |
return found_index; |
|
158 |
} |
|
159 |
||
160 |
||
161 |
void DrawWindowWidgets(Window *w) |
|
162 |
{ |
|
163 |
const Widget *wi; |
|
164 |
DrawPixelInfo *dpi = _cur_dpi; |
|
165 |
Rect r; |
|
674
9604d4d8de7d
(svn r1112) -Fix: _decode_parameters was increased to [20], but not all temp-dparams were
truelight
parents:
507
diff
changeset
|
166 |
uint32 dparam_backup[20]; |
0 | 167 |
uint32 cur_click, cur_disabled, cur_hidden; |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
168 |
|
0 | 169 |
if (w->desc_flags & WDF_RESTORE_DPARAM) COPY_OUT_DPARAM(dparam_backup, 0, lengthof(dparam_backup)); |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
170 |
|
0 | 171 |
wi = w->widget; |
172 |
||
173 |
cur_click = w->click_state; |
|
174 |
cur_disabled = w->disabled_state; |
|
175 |
cur_hidden = w->hidden_state; |
|
176 |
||
177 |
do { |
|
178 |
if (dpi->left > (r.right=/*w->left + */wi->right) || |
|
179 |
dpi->left + dpi->width <= (r.left=wi->left/* + w->left*/) || |
|
180 |
dpi->top > (r.bottom=/*w->top +*/ wi->bottom) || |
|
181 |
dpi->top + dpi->height <= (r.top = /*w->top +*/ wi->top) || |
|
182 |
(cur_hidden&1)) |
|
183 |
continue; |
|
184 |
||
185 |
switch(wi->type&WWT_MASK) { |
|
186 |
case WWT_PANEL: |
|
187 |
case WWT_PANEL_2: { |
|
188 |
int img; |
|
189 |
||
190 |
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, |
|
191 |
(cur_click & 1) ? 0x20 : 0); |
|
192 |
||
193 |
if ((img=wi->unkA) != 0) { |
|
194 |
if ((wi->type&WWT_MASK) == WWT_PANEL_2 && (cur_click&1)) img++; |
|
195 |
DrawSprite(img, r.left+1, r.top+1); |
|
196 |
} |
|
197 |
goto draw_default; |
|
198 |
} |
|
199 |
||
200 |
case WWT_CLOSEBOX: |
|
201 |
case WWT_4: { |
|
202 |
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, |
|
203 |
(cur_click & 1) ? 0x20 : 0); |
|
204 |
} |
|
205 |
/* fall through */ |
|
206 |
||
207 |
case WWT_5: { |
|
208 |
StringID str = wi->unkA; |
|
209 |
||
210 |
if ((wi->type&WWT_MASK) == WWT_4 && (cur_click&1)) str++; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
211 |
|
0 | 212 |
DrawStringCentered((r.left + r.right+1)>>1, ((r.top+r.bottom + 1)>>1) - 5, str, 0); |
213 |
goto restore_dparam; |
|
214 |
} |
|
215 |
||
216 |
case WWT_6: { |
|
217 |
StringID str; |
|
218 |
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, 0x60); |
|
219 |
||
220 |
if ((str = wi->unkA) != 0) { |
|
221 |
DrawString(r.left+2, r.top+1, str, 0); |
|
222 |
goto restore_dparam; |
|
223 |
} |
|
224 |
goto draw_default; |
|
225 |
} |
|
226 |
||
227 |
case WWT_MATRIX: { |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
228 |
int c, d, ctr; |
0 | 229 |
int x, amt1, amt2; |
230 |
int color; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
231 |
|
0 | 232 |
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, |
233 |
(cur_click & 1) ? 0x20 : 0); |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
234 |
|
0 | 235 |
c = (wi->unkA&0xFF); |
236 |
amt1 = (wi->right - wi->left + 1) / c; |
|
237 |
||
238 |
d = (wi->unkA >> 8); |
|
239 |
amt2 = (wi->bottom - wi->top + 1) / d; |
|
240 |
||
241 |
color = _color_list[wi->color&0xF].window_color_bgb; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
242 |
|
0 | 243 |
x = r.left; |
244 |
for(ctr=c; --ctr; ) { |
|
245 |
x += amt1; |
|
246 |
GfxFillRect(x, r.top+1, x, r.bottom-1, color); |
|
247 |
} |
|
248 |
||
249 |
x = r.top; |
|
250 |
for(ctr=d; --ctr; ) { |
|
251 |
x += amt2; |
|
252 |
GfxFillRect(r.left+1, x, r.right-1, x, color); |
|
253 |
} |
|
254 |
||
255 |
color = _color_list[wi->color&0xF].window_color_1b; |
|
256 |
||
257 |
x = r.left-1; |
|
258 |
for(ctr=c; --ctr; ) { |
|
259 |
x += amt1; |
|
260 |
GfxFillRect(x, r.top+1, x, r.bottom-1, color); |
|
261 |
} |
|
262 |
||
263 |
x = r.top-1; |
|
264 |
for(ctr=d; --ctr; ) { |
|
265 |
x += amt2; |
|
266 |
GfxFillRect(r.left+1, x, r.right-1, x, color); |
|
267 |
} |
|
268 |
||
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
269 |
goto draw_default; |
0 | 270 |
} |
271 |
||
272 |
// vertical scrollbar |
|
273 |
case WWT_SCROLLBAR: { |
|
274 |
Point pt; |
|
275 |
int c1,c2; |
|
276 |
||
893
f4698309dec7
(svn r1379) -Fix: various GUI glitches. Added default sizes to various widgets. Sticky/Resize- and Scrollbar must be 11 pixels wide, Horizontal scrollbar 11 pixels high, caption must be 13 pixels. I hope I didn't forget any widgets, the game will assert for that so report them to me!
darkvater
parents:
884
diff
changeset
|
277 |
assert(r.right - r.left == 11); // XXX - to ensure the same sizes are used everywhere! |
f4698309dec7
(svn r1379) -Fix: various GUI glitches. Added default sizes to various widgets. Sticky/Resize- and Scrollbar must be 11 pixels wide, Horizontal scrollbar 11 pixels high, caption must be 13 pixels. I hope I didn't forget any widgets, the game will assert for that so report them to me!
darkvater
parents:
884
diff
changeset
|
278 |
|
0 | 279 |
// draw up/down buttons |
842 | 280 |
DrawFrameRect(r.left, r.top, r.right, r.top+9, wi->color, (w->flags4 & (WF_SCROLL_UP | WF_HSCROLL | WF_SCROLL2)) == WF_SCROLL_UP ? 0x20 : 0); |
281 |
DrawFrameRect(r.left, r.bottom-9, r.right, r.bottom, wi->color, (w->flags4 & (WF_SCROLL_DOWN | WF_HSCROLL | WF_SCROLL2)) == WF_SCROLL_DOWN ? 0x20 : 0); |
|
0 | 282 |
|
283 |
// draw icons in up/down buttons |
|
284 |
DoDrawString("\xA0", r.left+2, r.top, 0x10); |
|
285 |
DoDrawString("\xAA", r.left+2, r.bottom-9, 0x10); |
|
286 |
||
287 |
c1 = _color_list[wi->color&0xF].window_color_1a; |
|
288 |
c2 = _color_list[wi->color&0xF].window_color_2; |
|
289 |
||
290 |
// draw "shaded" background |
|
291 |
GfxFillRect(r.left, r.top+10, r.right, r.bottom-10, c2); |
|
292 |
GfxFillRect(r.left, r.top+10, r.right, r.bottom-10, c1 | 0x8000); |
|
293 |
||
294 |
// draw shaded lines |
|
295 |
GfxFillRect(r.left+2, r.top+10, r.left+2, r.bottom-10, c1); |
|
296 |
GfxFillRect(r.left+3, r.top+10, r.left+3, r.bottom-10, c2); |
|
297 |
GfxFillRect(r.left+7, r.top+10, r.left+7, r.bottom-10, c1); |
|
298 |
GfxFillRect(r.left+8, r.top+10, r.left+8, r.bottom-10, c2); |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
299 |
|
0 | 300 |
pt = HandleScrollbarHittest(&w->vscroll, r.top, r.bottom); |
842 | 301 |
DrawFrameRect(r.left, pt.x, r.right, pt.y, wi->color, (w->flags4 & (WF_SCROLL_MIDDLE | WF_HSCROLL | WF_SCROLL2)) == WF_SCROLL_MIDDLE ? 0x20 : 0); |
302 |
break; |
|
303 |
} |
|
304 |
case WWT_SCROLL2BAR: { |
|
305 |
Point pt; |
|
306 |
int c1,c2; |
|
307 |
||
893
f4698309dec7
(svn r1379) -Fix: various GUI glitches. Added default sizes to various widgets. Sticky/Resize- and Scrollbar must be 11 pixels wide, Horizontal scrollbar 11 pixels high, caption must be 13 pixels. I hope I didn't forget any widgets, the game will assert for that so report them to me!
darkvater
parents:
884
diff
changeset
|
308 |
assert(r.right - r.left == 11); // XXX - to ensure the same sizes are used everywhere! |
f4698309dec7
(svn r1379) -Fix: various GUI glitches. Added default sizes to various widgets. Sticky/Resize- and Scrollbar must be 11 pixels wide, Horizontal scrollbar 11 pixels high, caption must be 13 pixels. I hope I didn't forget any widgets, the game will assert for that so report them to me!
darkvater
parents:
884
diff
changeset
|
309 |
|
842 | 310 |
// draw up/down buttons |
311 |
DrawFrameRect(r.left, r.top, r.right, r.top+9, wi->color, (w->flags4 & (WF_SCROLL_UP | WF_HSCROLL | WF_SCROLL2)) == (WF_SCROLL_UP | WF_SCROLL2) ? 0x20 : 0); |
|
312 |
DrawFrameRect(r.left, r.bottom-9, r.right, r.bottom, wi->color, (w->flags4 & (WF_SCROLL_DOWN | WF_HSCROLL | WF_SCROLL2)) == (WF_SCROLL_DOWN | WF_SCROLL2) ? 0x20 : 0); |
|
313 |
||
314 |
// draw icons in up/down buttons |
|
315 |
DoDrawString("\xA0", r.left+2, r.top, 0x10); |
|
316 |
DoDrawString("\xAA", r.left+2, r.bottom-9, 0x10); |
|
317 |
||
318 |
c1 = _color_list[wi->color&0xF].window_color_1a; |
|
319 |
c2 = _color_list[wi->color&0xF].window_color_2; |
|
320 |
||
321 |
// draw "shaded" background |
|
322 |
GfxFillRect(r.left, r.top+10, r.right, r.bottom-10, c2); |
|
323 |
GfxFillRect(r.left, r.top+10, r.right, r.bottom-10, c1 | 0x8000); |
|
324 |
||
325 |
// draw shaded lines |
|
326 |
GfxFillRect(r.left+2, r.top+10, r.left+2, r.bottom-10, c1); |
|
327 |
GfxFillRect(r.left+3, r.top+10, r.left+3, r.bottom-10, c2); |
|
328 |
GfxFillRect(r.left+7, r.top+10, r.left+7, r.bottom-10, c1); |
|
329 |
GfxFillRect(r.left+8, r.top+10, r.left+8, r.bottom-10, c2); |
|
330 |
||
331 |
pt = HandleScrollbarHittest(&w->vscroll2, r.top, r.bottom); |
|
332 |
DrawFrameRect(r.left, pt.x, r.right, pt.y, wi->color, (w->flags4 & (WF_SCROLL_MIDDLE | WF_HSCROLL | WF_SCROLL2)) == (WF_SCROLL_MIDDLE | WF_SCROLL2) ? 0x20 : 0); |
|
0 | 333 |
break; |
334 |
} |
|
335 |
||
336 |
// horizontal scrollbar |
|
337 |
case WWT_HSCROLLBAR: { |
|
338 |
Point pt; |
|
339 |
int c1,c2; |
|
340 |
||
894
8b59c639837d
(svn r1380) -Fix: missed widget fixes; thanks Jango and TestMan57
darkvater
parents:
893
diff
changeset
|
341 |
assert(r.bottom - r.top == 11); // XXX - to ensure the same sizes are used everywhere! |
893
f4698309dec7
(svn r1379) -Fix: various GUI glitches. Added default sizes to various widgets. Sticky/Resize- and Scrollbar must be 11 pixels wide, Horizontal scrollbar 11 pixels high, caption must be 13 pixels. I hope I didn't forget any widgets, the game will assert for that so report them to me!
darkvater
parents:
884
diff
changeset
|
342 |
|
0 | 343 |
DrawFrameRect(r.left, r.top, r.left + 9, r.bottom, wi->color, (w->flags4 & (WF_SCROLL_UP | WF_HSCROLL)) == (WF_SCROLL_UP | WF_HSCROLL) ? 0x20 : 0); |
344 |
DrawFrameRect(r.right-9, r.top, r.right, r.bottom, wi->color, (w->flags4 & (WF_SCROLL_DOWN | WF_HSCROLL)) == (WF_SCROLL_DOWN | WF_HSCROLL) ? 0x20 : 0); |
|
345 |
||
346 |
// draw icons in up/down buttons |
|
884
c5bf8b3dbab4
(svn r1369) -Feature(ish): Added sprites for up/down and left/right arrows. Anywhere where there are horizontal scrollers these are now left/right arrows
darkvater
parents:
883
diff
changeset
|
347 |
DrawSprite(SPR_ARROW_LEFT, r.left + 3, r.top + 2); |
c5bf8b3dbab4
(svn r1369) -Feature(ish): Added sprites for up/down and left/right arrows. Anywhere where there are horizontal scrollers these are now left/right arrows
darkvater
parents:
883
diff
changeset
|
348 |
DrawSprite(SPR_ARROW_RIGHT, r.right - 6, r.top + 2); |
0 | 349 |
|
350 |
c1 = _color_list[wi->color&0xF].window_color_1a; |
|
351 |
c2 = _color_list[wi->color&0xF].window_color_2; |
|
352 |
||
353 |
// draw "shaded" background |
|
354 |
GfxFillRect(r.left+10, r.top, r.right-10, r.bottom, c2); |
|
355 |
GfxFillRect(r.left+10, r.top, r.right-10, r.bottom, c1 | 0x8000); |
|
356 |
||
357 |
// draw shaded lines |
|
358 |
GfxFillRect(r.left+10, r.top+2, r.right-10, r.top+2, c1); |
|
359 |
GfxFillRect(r.left+10, r.top+3, r.right-10, r.top+3, c2); |
|
360 |
GfxFillRect(r.left+10, r.top+7, r.right-10, r.top+7, c1); |
|
361 |
GfxFillRect(r.left+10, r.top+8, r.right-10, r.top+8, c2); |
|
362 |
||
363 |
// draw actual scrollbar |
|
364 |
pt = HandleScrollbarHittest(&w->hscroll, r.left, r.right); |
|
365 |
DrawFrameRect(pt.x, r.top, pt.y, r.bottom, wi->color, (w->flags4 & (WF_SCROLL_MIDDLE | WF_HSCROLL)) == (WF_SCROLL_MIDDLE | WF_HSCROLL) ? 0x20 : 0); |
|
366 |
||
367 |
break; |
|
368 |
} |
|
369 |
||
370 |
case WWT_FRAME: { |
|
371 |
int c1,c2; |
|
860
fad6642f6217
(svn r1341) -Fix: fix WWT_FRAME drawing when there is no text there (STR_NULL)
darkvater
parents:
845
diff
changeset
|
372 |
int x2 = r.left; // by default the left side is the left side of the widget |
0 | 373 |
|
374 |
if (wi->unkA != 0) { |
|
375 |
x2 = DrawString(r.left+6, r.top, wi->unkA, 0); |
|
376 |
} |
|
377 |
||
378 |
c1 = _color_list[wi->color].window_color_1a; |
|
379 |
c2 = _color_list[wi->color].window_color_2; |
|
380 |
||
381 |
//Line from upper left corner to start of text |
|
382 |
GfxFillRect(r.left, r.top+4, r.left+4,r.top+4, c1); |
|
383 |
GfxFillRect(r.left+1, r.top+5, r.left+4,r.top+5, c2); |
|
384 |
||
385 |
// Line from end of text to upper right corner |
|
386 |
GfxFillRect(x2, r.top+4, r.right-1,r.top+4,c1); |
|
387 |
GfxFillRect(x2, r.top+5, r.right-2,r.top+5,c2); |
|
388 |
||
389 |
// Line from upper left corner to bottom left corner |
|
390 |
GfxFillRect(r.left, r.top+5, r.left, r.bottom-1, c1); |
|
391 |
GfxFillRect(r.left+1, r.top+6, r.left+1, r.bottom-2, c2); |
|
392 |
||
393 |
//Line from upper right corner to bottom right corner |
|
394 |
GfxFillRect(r.right-1, r.top+5, r.right-1, r.bottom-2, c1); |
|
395 |
GfxFillRect(r.right, r.top+4, r.right, r.bottom-1, c2); |
|
396 |
||
397 |
GfxFillRect(r.left+1, r.bottom-1, r.right-1, r.bottom-1, c1); |
|
398 |
GfxFillRect(r.left, r.bottom, r.right, r.bottom, c2); |
|
399 |
||
400 |
goto restore_dparam; |
|
401 |
} |
|
402 |
||
682
74c70f645d95
(svn r1121) -Feature: Added sticky windows feature. A small pin allows the user to set the window as undeletable and can only be closed by hand. As an example the viewport window has been stickied (thanks to Neko-San)
darkvater
parents:
674
diff
changeset
|
403 |
case WWT_STICKYBOX: { |
893
f4698309dec7
(svn r1379) -Fix: various GUI glitches. Added default sizes to various widgets. Sticky/Resize- and Scrollbar must be 11 pixels wide, Horizontal scrollbar 11 pixels high, caption must be 13 pixels. I hope I didn't forget any widgets, the game will assert for that so report them to me!
darkvater
parents:
884
diff
changeset
|
404 |
assert(r.right - r.left == 11); // XXX - to ensure the same sizes are used everywhere! |
682
74c70f645d95
(svn r1121) -Feature: Added sticky windows feature. A small pin allows the user to set the window as undeletable and can only be closed by hand. As an example the viewport window has been stickied (thanks to Neko-San)
darkvater
parents:
674
diff
changeset
|
405 |
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, (cur_click & 1) ? 0x20 : 0); |
867
dffd33233237
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
860
diff
changeset
|
406 |
DrawSprite((cur_click & 1) ? SPR_PIN_UP : SPR_PIN_DOWN, r.left + 2, r.top + 3); |
682
74c70f645d95
(svn r1121) -Feature: Added sticky windows feature. A small pin allows the user to set the window as undeletable and can only be closed by hand. As an example the viewport window has been stickied (thanks to Neko-San)
darkvater
parents:
674
diff
changeset
|
407 |
break; |
74c70f645d95
(svn r1121) -Feature: Added sticky windows feature. A small pin allows the user to set the window as undeletable and can only be closed by hand. As an example the viewport window has been stickied (thanks to Neko-San)
darkvater
parents:
674
diff
changeset
|
408 |
} |
867
dffd33233237
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
860
diff
changeset
|
409 |
|
dffd33233237
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
860
diff
changeset
|
410 |
case WWT_RESIZEBOX: { |
893
f4698309dec7
(svn r1379) -Fix: various GUI glitches. Added default sizes to various widgets. Sticky/Resize- and Scrollbar must be 11 pixels wide, Horizontal scrollbar 11 pixels high, caption must be 13 pixels. I hope I didn't forget any widgets, the game will assert for that so report them to me!
darkvater
parents:
884
diff
changeset
|
411 |
assert(r.right - r.left == 11); // XXX - to ensure the same sizes are used everywhere! |
915 | 412 |
|
867
dffd33233237
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
860
diff
changeset
|
413 |
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, 0); |
893
f4698309dec7
(svn r1379) -Fix: various GUI glitches. Added default sizes to various widgets. Sticky/Resize- and Scrollbar must be 11 pixels wide, Horizontal scrollbar 11 pixels high, caption must be 13 pixels. I hope I didn't forget any widgets, the game will assert for that so report them to me!
darkvater
parents:
884
diff
changeset
|
414 |
DrawSprite(SPR_WINDOW_RESIZE, r.left + 3, r.top + 3); |
867
dffd33233237
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
860
diff
changeset
|
415 |
break; |
dffd33233237
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
860
diff
changeset
|
416 |
} |
dffd33233237
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
860
diff
changeset
|
417 |
|
0 | 418 |
case WWT_CAPTION: { |
893
f4698309dec7
(svn r1379) -Fix: various GUI glitches. Added default sizes to various widgets. Sticky/Resize- and Scrollbar must be 11 pixels wide, Horizontal scrollbar 11 pixels high, caption must be 13 pixels. I hope I didn't forget any widgets, the game will assert for that so report them to me!
darkvater
parents:
884
diff
changeset
|
419 |
assert(r.bottom - r.top == 13); // XXX - to ensure the same sizes are used everywhere! |
0 | 420 |
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, 0x10); |
421 |
DrawFrameRect(r.left+1, r.top+1, r.right-1, r.bottom-1, wi->color, (w->caption_color == 0xFF) ? 0x60 : 0x70); |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
422 |
|
0 | 423 |
if (w->caption_color != 0xFF) { |
424 |
GfxFillRect(r.left+2, r.top+2, r.right-2, r.bottom-2, _color_list[_player_colors[w->caption_color]].window_color_1b); |
|
425 |
} |
|
426 |
||
427 |
DrawStringCentered( (r.left+r.right+1)>>1, r.top+2, wi->unkA, 0x84); |
|
428 |
restore_dparam:; |
|
429 |
if (w->desc_flags & WDF_RESTORE_DPARAM) COPY_IN_DPARAM(0, dparam_backup, lengthof(dparam_backup)); |
|
430 |
draw_default:; |
|
431 |
if (cur_disabled & 1) { |
|
432 |
GfxFillRect(r.left+1, r.top+1, r.right-1, r.bottom-1, _color_list[wi->color&0xF].unk2 | 0x8000); |
|
433 |
} |
|
434 |
} |
|
435 |
} |
|
436 |
} while (cur_click>>=1, cur_disabled>>=1, cur_hidden >>= 1, (++wi)->type != WWT_LAST); |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
437 |
|
0 | 438 |
|
439 |
if (w->flags4 & WF_WHITE_BORDER_MASK) { |
|
440 |
//DrawFrameRect(w->left, w->top, w->left + w->width-1, w->top+w->height-1, 0xF, 0x10); |
|
441 |
DrawFrameRect(0, 0, w->width-1, w->height-1, 0xF, 0x10); |
|
442 |
} |
|
443 |
||
444 |
} |
|
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
445 |
|
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
446 |
static uint _dropdown_item_count; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
447 |
static uint32 _dropdown_disabled; |
842 | 448 |
static bool _dropdown_hide_disabled; |
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
449 |
static const StringID *_dropdown_items; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
450 |
static int _dropdown_selindex; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
451 |
static byte _dropdown_button; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
452 |
static WindowClass _dropdown_windowclass; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
453 |
static WindowNumber _dropdown_windownum; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
454 |
static byte _dropdown_var1; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
455 |
static byte _dropdown_var2; |
1177
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
456 |
static uint32 _dropdown_disabled_items; |
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
457 |
|
883
9bfde7bab1f9
(svn r1368) -Fix: Disabled dropdown menu options are gray again (instead of blue)
truelight
parents:
876
diff
changeset
|
458 |
static const Widget _dropdown_menu_widgets[] = { |
867
dffd33233237
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
860
diff
changeset
|
459 |
{ WWT_IMGBTN, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, |
176
84990c4b9212
(svn r177) -Fix: padded out Widget code to solve warnings on C99 compiler (Tron)
darkvater
parents:
164
diff
changeset
|
460 |
{ WIDGETS_END}, |
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
461 |
}; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
462 |
|
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
463 |
static int GetDropdownItem(Window *w) |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
464 |
{ |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
465 |
uint item; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
466 |
int y; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
467 |
|
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
468 |
if (GetWidgetFromPos(w, _cursor.pos.x - w->left, _cursor.pos.y - w->top) < 0) |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
469 |
return -1; |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
470 |
|
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
471 |
y = _cursor.pos.y - w->top - 2; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
472 |
|
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
473 |
if (y < 0) |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
474 |
return - 1; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
475 |
|
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
476 |
item = y / 10; |
1177
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
477 |
if (item >= _dropdown_item_count || (HASBIT(_dropdown_disabled,item) && !_dropdown_disabled_items) || _dropdown_items[item] == 0) |
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
478 |
return - 1; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
479 |
|
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
480 |
return item; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
481 |
} |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
482 |
|
1095 | 483 |
static void DropdownMenuWndProc(Window *w, WindowEvent *e) |
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
484 |
{ |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
485 |
int item; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
486 |
|
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
487 |
switch(e->event) { |
842 | 488 |
case WE_PAINT: { |
489 |
int x,y,i,sel; |
|
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
490 |
|
842 | 491 |
DrawWindowWidgets(w); |
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
492 |
|
842 | 493 |
x = 1; |
494 |
y = 2; |
|
495 |
sel = _dropdown_selindex; |
|
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
496 |
|
842 | 497 |
for(i=0; _dropdown_items[i] != INVALID_STRING_ID; i++) { |
1177
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
498 |
if (HASBIT(_dropdown_disabled_items, i)) { |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
499 |
sel--; |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
500 |
continue; |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
501 |
} |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
502 |
if (_dropdown_items[i] != 0) { |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
503 |
if (sel == 0) { |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
504 |
GfxFillRect(x+1, y, x+w->width-4, y + 9, 0); |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
505 |
} |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
506 |
DrawString(x+2, y, _dropdown_items[i], sel==0 ? 12 : 16); |
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
507 |
|
1177
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
508 |
if (HASBIT(_dropdown_disabled, i) && !_dropdown_disabled_items) { |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
509 |
GfxFillRect(x, y, x+w->width-3, y + 9, 0x8000 + |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
510 |
_color_list[_dropdown_menu_widgets[0].color].window_color_bga); |
842 | 511 |
} |
1177
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
512 |
} else { |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
513 |
int color_1 = _color_list[_dropdown_menu_widgets[0].color].window_color_1a; |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
514 |
int color_2 = _color_list[_dropdown_menu_widgets[0].color].window_color_2; |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
515 |
GfxFillRect(x+1, y+3, x+w->width-5, y+3, color_1); |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
516 |
GfxFillRect(x+1, y+4, x+w->width-5, y+4, color_2); |
842 | 517 |
} |
1177
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
518 |
y += 10; |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
519 |
sel--; |
842 | 520 |
} |
521 |
} break; |
|
522 |
||
523 |
case WE_CLICK: { |
|
524 |
item = GetDropdownItem(w); |
|
525 |
if (item >= 0) { |
|
1177
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
526 |
// make sure that item match the index of the string, that was clicked |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
527 |
// basically we just add one for each hidden item before the clicked one |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
528 |
byte counter; |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
529 |
for (counter = 0 ; item >= counter; ++counter) { |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
530 |
if (HASBIT(_dropdown_disabled_items, counter)) item++; |
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
531 |
} |
842 | 532 |
_dropdown_var1 = 4; |
533 |
_dropdown_selindex = item; |
|
534 |
SetWindowDirty(w); |
|
535 |
} |
|
536 |
} break; |
|
537 |
||
538 |
case WE_MOUSELOOP: { |
|
539 |
Window *w2 = FindWindowById(_dropdown_windowclass, _dropdown_windownum); |
|
540 |
if (w2 == NULL) { |
|
541 |
DeleteWindow(w); |
|
542 |
return; |
|
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
543 |
} |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
544 |
|
842 | 545 |
if (_dropdown_var1 != 0 && --_dropdown_var1 == 0) { |
546 |
WindowEvent e; |
|
547 |
e.event = WE_DROPDOWN_SELECT; |
|
548 |
e.dropdown.button = _dropdown_button; |
|
549 |
e.dropdown.index = _dropdown_selindex; |
|
550 |
w2->wndproc(w2, &e); |
|
551 |
DeleteWindow(w); |
|
552 |
return; |
|
553 |
} |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
554 |
|
842 | 555 |
if (_dropdown_var2 != 0) { |
556 |
item = GetDropdownItem(w); |
|
557 |
||
558 |
if (!_left_button_clicked) { |
|
559 |
_dropdown_var2 = 0; |
|
560 |
if (item < 0) |
|
561 |
return; |
|
562 |
_dropdown_var1 = 2; |
|
563 |
} else { |
|
564 |
if (item < 0) |
|
565 |
return; |
|
566 |
} |
|
567 |
||
568 |
_dropdown_selindex = item; |
|
569 |
SetWindowDirty(w); |
|
570 |
} |
|
571 |
} break; |
|
572 |
||
573 |
case WE_DESTROY: { |
|
574 |
Window *w2 = FindWindowById(_dropdown_windowclass, _dropdown_windownum); |
|
575 |
if (w2 != NULL) { |
|
576 |
CLRBIT(w2->click_state, _dropdown_button); |
|
577 |
InvalidateWidget(w2, _dropdown_button); |
|
578 |
} |
|
579 |
} break; |
|
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
580 |
} |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
581 |
} |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
582 |
|
842 | 583 |
void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int button, uint32 disabled_mask, bool remove_filtered_strings) |
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
584 |
{ |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
585 |
WindowNumber num; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
586 |
WindowClass cls; |
867
dffd33233237
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
860
diff
changeset
|
587 |
int i; |
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
588 |
const Widget *wi; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
589 |
Window *w2; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
590 |
uint32 old_click_state = w->click_state; |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
591 |
|
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
592 |
_dropdown_disabled = disabled_mask; |
842 | 593 |
_dropdown_hide_disabled = remove_filtered_strings; |
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
594 |
|
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
595 |
cls = w->window_class; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
596 |
num = w->window_number; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
597 |
DeleteWindowById(WC_DROPDOWN_MENU, 0); |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
598 |
w = FindWindowById(cls, num); |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
599 |
|
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
600 |
if (HASBIT(old_click_state, button)) |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
601 |
return; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
602 |
|
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
603 |
SETBIT(w->click_state, button); |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
604 |
|
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
605 |
InvalidateWidget(w, button); |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
606 |
|
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
607 |
for(i=0;strings[i] != INVALID_STRING_ID;i++); |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
608 |
if (i == 0) |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
609 |
return; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
610 |
|
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
611 |
_dropdown_items = strings; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
612 |
_dropdown_item_count = i; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
613 |
_dropdown_selindex = selected; |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
614 |
|
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
615 |
_dropdown_windowclass = w->window_class; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
616 |
_dropdown_windownum = w->window_number; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
617 |
_dropdown_button = button; |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
176
diff
changeset
|
618 |
|
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
619 |
_dropdown_var1 = 0; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
620 |
_dropdown_var2 = 1; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
621 |
|
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
622 |
wi = &w->widget[button]; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
623 |
|
842 | 624 |
if ( remove_filtered_strings ) { |
625 |
int j; |
|
626 |
for(j=0; _dropdown_items[j] != INVALID_STRING_ID; j++) { |
|
627 |
if ( disabled_mask & ( 1 << j )) { |
|
628 |
_dropdown_item_count--; |
|
629 |
i--; |
|
630 |
} |
|
631 |
} |
|
632 |
} |
|
633 |
||
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
634 |
w2 = AllocateWindow( |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
635 |
w->left + wi[-1].left + 1, |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
636 |
w->top + wi->bottom + 2, |
867
dffd33233237
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
860
diff
changeset
|
637 |
wi->right - wi[-1].left + 1, |
dffd33233237
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
860
diff
changeset
|
638 |
i * 10 + 4, |
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
639 |
DropdownMenuWndProc, |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
640 |
0x3F, |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
641 |
_dropdown_menu_widgets); |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
642 |
|
867
dffd33233237
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
860
diff
changeset
|
643 |
w2->widget[0].color = wi->color; |
dffd33233237
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
860
diff
changeset
|
644 |
w2->widget[0].right = wi->right - wi[-1].left; |
dffd33233237
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
truelight
parents:
860
diff
changeset
|
645 |
w2->widget[0].bottom = i * 10 + 3; |
1177
9a250d8f0794
(svn r1679) Fix: dropdown menus now returns the index of the string that was clicked even if a previous item is hidden
bjarni
parents:
1095
diff
changeset
|
646 |
_dropdown_disabled_items = remove_filtered_strings ? disabled_mask : 0; |
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
647 |
|
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
648 |
w2->flags4 &= ~WF_WHITE_BORDER_MASK; |
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
0
diff
changeset
|
649 |
} |