(svn r11588) -Codechange: use the new member introduced in r11551

This commit is contained in:
glx 2007-12-07 18:05:49 +00:00
parent 98bd772119
commit c21f588a14
13 changed files with 39 additions and 39 deletions

View File

@ -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.. */

View File

@ -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;
}

View File

@ -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;

View File

@ -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. */

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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:

View File

@ -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;

View File

@ -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)

View File

@ -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);
}
/**

View File

@ -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;

View File

@ -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);
}
}
}