diff options
author | glx <glx@openttd.org> | 2007-12-07 18:05:49 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2007-12-07 18:05:49 +0000 |
commit | b00f62123960a9beaf85da92df2537b24d5c0295 (patch) | |
tree | d911871e265f9cc64abdaac46967f9c90de70315 /src | |
parent | 30a5f9abf3c004d381cde4248040c7698686c827 (diff) | |
download | openttd-b00f62123960a9beaf85da92df2537b24d5c0295.tar.xz |
(svn r11588) -Codechange: use the new member introduced in r11551
Diffstat (limited to 'src')
-rw-r--r-- | src/depot_gui.cpp | 4 | ||||
-rw-r--r-- | src/genworld_gui.cpp | 8 | ||||
-rw-r--r-- | src/main_gui.cpp | 16 | ||||
-rw-r--r-- | src/misc_gui.cpp | 14 | ||||
-rw-r--r-- | src/network/network_gui.cpp | 2 | ||||
-rw-r--r-- | src/news_gui.cpp | 2 | ||||
-rw-r--r-- | src/order_gui.cpp | 6 | ||||
-rw-r--r-- | src/player_gui.cpp | 4 | ||||
-rw-r--r-- | src/rail_gui.cpp | 2 | ||||
-rw-r--r-- | src/signs_gui.cpp | 2 | ||||
-rw-r--r-- | src/viewport.cpp | 4 | ||||
-rw-r--r-- | src/widget.cpp | 4 | ||||
-rw-r--r-- | src/window.cpp | 10 |
13 files changed, 39 insertions, 39 deletions
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index e61765762..17d8b06d1 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -794,7 +794,7 @@ static void DepotWndProc(Window *w, WindowEvent *e) break; case DEPOT_WIDGET_CLONE: // Clone button - InvalidateWidget(w, DEPOT_WIDGET_CLONE); + w->InvalidateWidget(DEPOT_WIDGET_CLONE); w->ToggleWidgetLoweredState(DEPOT_WIDGET_CLONE); if (w->IsWidgetLowered(DEPOT_WIDGET_CLONE)) { @@ -856,7 +856,7 @@ static void DepotWndProc(Window *w, WindowEvent *e) case WE_ABORT_PLACE_OBJ: { w->RaiseWidget(DEPOT_WIDGET_CLONE); - InvalidateWidget(w, DEPOT_WIDGET_CLONE); + w->InvalidateWidget(DEPOT_WIDGET_CLONE); } break; /* check if a vehicle in a depot was clicked.. */ diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index 4da42dab7..a65cf90fc 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -493,11 +493,11 @@ static void GenerateLandscapeWndProc(Window *w, WindowEvent *e) switch (WP(w, generate_d).widget_id) { case GLAND_START_DATE_TEXT: - InvalidateWidget(w, GLAND_START_DATE_TEXT); + w->InvalidateWidget(GLAND_START_DATE_TEXT); _patches_newgame.starting_year = Clamp(value, MIN_YEAR, MAX_YEAR); break; case GLAND_SNOW_LEVEL_TEXT: - InvalidateWidget(w, GLAND_SNOW_LEVEL_TEXT); + w->InvalidateWidget(GLAND_SNOW_LEVEL_TEXT); _patches_newgame.snow_line_height = Clamp(value, 2, MAX_SNOWLINE_HEIGHT); break; } @@ -698,11 +698,11 @@ static void CreateScenarioWndProc(Window *w, WindowEvent *e) switch (WP(w, generate_d).widget_id) { case CSCEN_START_DATE_TEXT: - InvalidateWidget(w, CSCEN_START_DATE_TEXT); + w->InvalidateWidget(CSCEN_START_DATE_TEXT); _patches_newgame.starting_year = Clamp(value, MIN_YEAR, MAX_YEAR); break; case CSCEN_FLAT_LAND_HEIGHT_TEXT: - InvalidateWidget(w, CSCEN_FLAT_LAND_HEIGHT_TEXT); + w->InvalidateWidget(CSCEN_FLAT_LAND_HEIGHT_TEXT); _patches_newgame.se_flat_world_height = Clamp(value, 0, MAX_TILE_HEIGHT); break; } diff --git a/src/main_gui.cpp b/src/main_gui.cpp index 40172f27c..e5f28d29c 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -706,7 +706,7 @@ static Window *PopupMainToolbMenu(Window *w, uint16 parent_button, StringID base assert(disabled_mask == 0 || item_count <= 8); w->LowerWidget(parent_button); - InvalidateWidget(w, parent_button); + w->InvalidateWidget(parent_button); DeleteWindowById(WC_TOOLBAR_MENU, 0); @@ -741,7 +741,7 @@ static Window *PopupMainPlayerToolbMenu(Window *w, int main_button, int gray) int x = w->widget[main_button].left + w->left; w->LowerWidget(main_button); - InvalidateWidget(w, main_button); + w->InvalidateWidget(main_button); DeleteWindowById(WC_TOOLBAR_MENU, 0); w = AllocateWindow(x, 0x16, 0xF1, 0x52, PlayerMenuWndProc, WC_TOOLBAR_MENU, _player_menu_widgets); @@ -1361,7 +1361,7 @@ static void ScenEditLandGenWndProc(Window *w, WindowEvent *e) for (i = 0; i < w->widget_count; i++) { if (w->IsWidgetLowered(i)) { w->RaiseWidget(i); - InvalidateWidget(w, i); + w->InvalidateWidget(i); } if (i == 3) i = 11; } @@ -1679,12 +1679,12 @@ static void MainToolbarWndProc(Window *w, WindowEvent *e) case WE_MOUSELOOP: if (w->IsWidgetLowered(0) != !!_pause_game) { w->ToggleWidgetLoweredState(0); - InvalidateWidget(w, 0); + w->InvalidateWidget(0); } if (w->IsWidgetLowered(1) != !!_fast_forward) { w->ToggleWidgetLoweredState(1); - InvalidateWidget(w, 1); + w->InvalidateWidget(1); } break; @@ -1720,7 +1720,7 @@ static void MainToolbarWndProc(Window *w, WindowEvent *e) for (i = 2; i < w->widget_count; i++) { if (w->IsWidgetLowered(i)) { w->RaiseWidget(i); - InvalidateWidget(w, i); + w->InvalidateWidget(i); } } break; @@ -2109,14 +2109,14 @@ static void StatusBarWndProc(Window *w, WindowEvent *e) if (WP(w, def_d).data_1 > -1280) { // Scrolling text WP(w, def_d).data_1 -= 2; - InvalidateWidget(w, 1); + w->InvalidateWidget(1); } if (WP(w, def_d).data_2 > 0) { // Red blot to show there are new unread newsmessages WP(w, def_d).data_2 -= 2; } else if (WP(w, def_d).data_2 < 0) { WP(w, def_d).data_2 = 0; - InvalidateWidget(w, 1); + w->InvalidateWidget(1); } break; diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index b6b698cfb..e95c59fbd 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -1016,24 +1016,24 @@ int HandleEditBoxKey(Window *w, querystr_d *string, int wid, WindowEvent *e) case WKC_RETURN: case WKC_NUM_ENTER: return 1; case (WKC_CTRL | 'V'): if (InsertTextBufferClipboard(&string->text)) - InvalidateWidget(w, wid); + w->InvalidateWidget(wid); break; case (WKC_CTRL | 'U'): DeleteTextBufferAll(&string->text); - InvalidateWidget(w, wid); + w->InvalidateWidget(wid); break; case WKC_BACKSPACE: case WKC_DELETE: if (DeleteTextBufferChar(&string->text, e->we.keypress.keycode)) - InvalidateWidget(w, wid); + w->InvalidateWidget(wid); break; case WKC_LEFT: case WKC_RIGHT: case WKC_END: case WKC_HOME: if (MoveTextBufferPos(&string->text, e->we.keypress.keycode)) - InvalidateWidget(w, wid); + w->InvalidateWidget(wid); break; default: if (IsValidChar(e->we.keypress.key, string->afilter)) { if (InsertTextBufferChar(&string->text, e->we.keypress.key)) { - InvalidateWidget(w, wid); + w->InvalidateWidget(wid); } } else { // key wasn't caught. Continue only if standard entry specified e->we.keypress.cont = (string->afilter == CS_ALPHANUMERAL); @@ -1057,7 +1057,7 @@ bool HandleCaret(Textbuf *tb) void HandleEditBox(Window *w, querystr_d *string, int wid) { - if (HandleCaret(&string->text)) InvalidateWidget(w, wid); + if (HandleCaret(&string->text)) w->InvalidateWidget(wid); } void DrawEditBox(Window *w, querystr_d *string, int wid) @@ -1564,7 +1564,7 @@ static void SaveLoadDlgWndProc(Window *w, WindowEvent *e) /* SLD_SAVE_GAME, SLD_SAVE_SCENARIO copy clicked name to editbox */ ttd_strlcpy(WP(w, querystr_d).text.buf, file->title, WP(w, querystr_d).text.maxlength); UpdateTextBufferSize(&WP(w, querystr_d).text); - InvalidateWidget(w, 10); + w->InvalidateWidget(10); } } else { /* Changed directory, need repaint. */ diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 5e5cdfb9c..de1ace134 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -860,7 +860,7 @@ static void NetworkStartServerWindowWndProc(Window *w, WindowEvent *e) _network_game_info.use_password = (_network_server_password[0] != '\0'); } else { int32 value = atoi(e->we.edittext.str); - InvalidateWidget(w, nd->widget_id); + w->InvalidateWidget(nd->widget_id); switch (nd->widget_id) { default: NOT_REACHED(); case NSSW_CLIENTS_TXT: _network_game_info.clients_max = Clamp(value, 2, MAX_CLIENTS); break; diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 2bf4c5acd..859786c12 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -860,7 +860,7 @@ static void MessageOptionsWndProc(Window *w, WindowEvent *e) case WIDGET_NEWSOPT_SOUNDTICKER: // Change ticker sound on/off _news_ticker_sound ^= 1; w->ToggleWidgetLoweredState(e->we.click.widget); - InvalidateWidget(w, e->we.click.widget); + w->InvalidateWidget(e->we.click.widget); break; default: { // Clicked on the [<] .. [>] widgets diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 42641a39e..8c3ff29b4 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -397,7 +397,7 @@ static void OrdersPlaceObj(const Vehicle *v, TileIndex tile, Window *w) */ static void OrderClick_Goto(Window *w, const Vehicle *v) { - InvalidateWidget(w, ORDER_WIDGET_GOTO); + w->InvalidateWidget(ORDER_WIDGET_GOTO); w->ToggleWidgetLoweredState(ORDER_WIDGET_GOTO); if (w->IsWidgetLowered(ORDER_WIDGET_GOTO)) { _place_clicked_vehicle = NULL; @@ -700,7 +700,7 @@ static void OrdersWndProc(Window *w, WindowEvent *e) case WE_ABORT_PLACE_OBJ: { w->RaiseWidget(ORDER_WIDGET_GOTO); - InvalidateWidget( w, ORDER_WIDGET_GOTO); + w->InvalidateWidget(ORDER_WIDGET_GOTO); } break; // check if a vehicle in a depot was clicked.. @@ -731,7 +731,7 @@ static void OrdersWndProc(Window *w, WindowEvent *e) for (i = 0; i < w->widget_count; i++) { if (w->IsWidgetLowered(i) && i != ORDER_WIDGET_GOTO) { w->RaiseWidget(i); - InvalidateWidget(w, i); + w->InvalidateWidget(i); } } } break; diff --git a/src/player_gui.cpp b/src/player_gui.cpp index 33bc61abf..16d5ff3f3 100644 --- a/src/player_gui.cpp +++ b/src/player_gui.cpp @@ -1179,7 +1179,7 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e) SetObjectToPlaceWnd(SPR_CURSOR_HQ, PAL_NONE, VHM_RECT, w); SetTileSelectSize(2, 2); w->LowerWidget(PCW_WIDGET_BUILD_VIEW_HQ); - InvalidateWidget(w, PCW_WIDGET_BUILD_VIEW_HQ); + w->InvalidateWidget(PCW_WIDGET_BUILD_VIEW_HQ); } else { ScrollMainWindowToTile(tile); } @@ -1190,7 +1190,7 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e) SetObjectToPlaceWnd(SPR_CURSOR_HQ, PAL_NONE, VHM_RECT, w); SetTileSelectSize(2, 2); w->LowerWidget(PCW_WIDGET_RELOCATE_HQ); - InvalidateWidget(w, PCW_WIDGET_RELOCATE_HQ); + w->InvalidateWidget(PCW_WIDGET_RELOCATE_HQ); break; case PCW_WIDGET_BUY_SHARE: diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 1df4f5807..a31399d40 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -580,7 +580,7 @@ static void BuildRailToolbWndProc(Window *w, WindowEvent *e) case WE_ABORT_PLACE_OBJ: RaiseWindowButtons(w); w->DisableWidget(RTW_REMOVE); - InvalidateWidget(w, RTW_REMOVE); + w->InvalidateWidget(RTW_REMOVE); w = FindWindowById(WC_BUILD_SIGNAL, 0); if (w != NULL) WP(w, def_d).close = true; diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index 81b7abd93..b0d7877fe 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -184,7 +184,7 @@ static void UpdateSignEditWindow(Window *w, const Sign *si) WP(w, editsign_d).cur_sign = si->index; InitializeTextBuffer(&WP(w, querystr_d).text, _edit_str_buf, 31, 255); // Allow 31 characters (including \0) - InvalidateWidget(w, QUERY_EDIT_SIGN_WIDGET_TEXT); + w->InvalidateWidget(QUERY_EDIT_SIGN_WIDGET_TEXT); } static void RenameSign(SignID index, const char *text) diff --git a/src/viewport.cpp b/src/viewport.cpp index 806f7e2c9..96dbe753c 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -443,10 +443,10 @@ Point GetTileZoomCenterWindow(bool in, Window * w) void HandleZoomMessage(Window *w, const ViewPort *vp, byte widget_zoom_in, byte widget_zoom_out) { w->SetWidgetDisabledState(widget_zoom_in, vp->zoom == ZOOM_LVL_MIN); - InvalidateWidget(w, widget_zoom_in); + w->InvalidateWidget(widget_zoom_in); w->SetWidgetDisabledState(widget_zoom_out, vp->zoom == ZOOM_LVL_MAX); - InvalidateWidget(w, widget_zoom_out); + w->InvalidateWidget(widget_zoom_out); } /** diff --git a/src/widget.cpp b/src/widget.cpp index 4453350fc..46900d5ed 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -603,7 +603,7 @@ static void DropdownMenuWndProc(Window *w, WindowEvent *e) Window *w2 = FindWindowById(WP(w,dropdown_d).parent_wnd_class, WP(w,dropdown_d).parent_wnd_num); if (w2 != NULL) { w2->RaiseWidget(WP(w,dropdown_d).parent_button); - InvalidateWidget(w2, WP(w,dropdown_d).parent_button); + w2->InvalidateWidget(WP(w,dropdown_d).parent_button); } } break; } @@ -626,7 +626,7 @@ void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int butt w->LowerWidget(button); - InvalidateWidget(w, button); + w->InvalidateWidget(button); for (i = 0; strings[i] != INVALID_STRING_ID; i++) {} if (i == 0) return; diff --git a/src/window.cpp b/src/window.cpp index 41dd28df9..5298dee89 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -75,7 +75,7 @@ void RaiseWindowButtons(Window *w) for (i = 0; i < w->widget_count; i++) { if (w->IsWidgetLowered(i)) { w->RaiseWidget(i); - InvalidateWidget(w, i); + w->InvalidateWidget(i); } } } @@ -148,7 +148,7 @@ void HandleButtonClick(Window *w, byte widget) { w->LowerWidget(widget); w->flags4 |= 5 << WF_TIMEOUT_SHL; - InvalidateWidget(w, widget); + w->InvalidateWidget(widget); } @@ -200,13 +200,13 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, bool double_click) if (w->desc_flags & WDF_RESIZABLE && wi->type == WWT_RESIZEBOX) { StartWindowSizing(w); - InvalidateWidget(w, e.we.click.widget); + w->InvalidateWidget(e.we.click.widget); return; } if (w->desc_flags & WDF_STICKY_BUTTON && wi->type == WWT_STICKYBOX) { w->flags4 ^= WF_STICKY; - InvalidateWidget(w, e.we.click.widget); + w->InvalidateWidget(e.we.click.widget); return; } } @@ -2008,7 +2008,7 @@ void InvalidateWindowWidget(WindowClass cls, WindowNumber number, byte widget_in FOR_ALL_WINDOWS(wz) { const Window *w = *wz; if (w->window_class == cls && w->window_number == number) { - InvalidateWidget(w, widget_index); + w->InvalidateWidget(widget_index); } } } |