(svn r17674) -Codechange: replace SetDirty + OnInvalidateData with InvalidateData (which does the same). Also call InvalidateData in a few cases where that was actually meant.

pull/155/head
rubidium 15 years ago
parent e3bb9351a4
commit 0855ae61de

@ -586,8 +586,7 @@ struct AIConfigWindow : public Window {
if (slot == 0 || slot > _settings_newgame.difficulty.max_no_competitors) slot = INVALID_COMPANY; if (slot == 0 || slot > _settings_newgame.difficulty.max_no_competitors) slot = INVALID_COMPANY;
this->selected_slot = (CompanyID)slot; this->selected_slot = (CompanyID)slot;
this->OnInvalidateData(0); this->InvalidateData();
this->SetDirty();
break; break;
} }

@ -1176,7 +1176,7 @@ void QueryString::HandleEditBox(Window *w, int wid)
* so the caret changes appropriately. */ * so the caret changes appropriately. */
if (w->window_class != WC_OSK) { if (w->window_class != WC_OSK) {
Window *w_osk = FindWindowById(WC_OSK, 0); Window *w_osk = FindWindowById(WC_OSK, 0);
if (w_osk != NULL && w_osk->parent == w) w_osk->OnInvalidateData(); if (w_osk != NULL && w_osk->parent == w) w_osk->InvalidateData();
} }
} }
} }
@ -1322,7 +1322,7 @@ struct QueryStringWindow : public QueryStringBaseWindow
default: NOT_REACHED(); default: NOT_REACHED();
case HEBR_EDITING: { case HEBR_EDITING: {
Window *osk = FindWindowById(WC_OSK, 0); Window *osk = FindWindowById(WC_OSK, 0);
if (osk != NULL && osk->parent == this) osk->OnInvalidateData(); if (osk != NULL && osk->parent == this) osk->InvalidateData();
} break; } break;
case HEBR_CONFIRM: this->OnOk(); case HEBR_CONFIRM: this->OnOk();
/* FALL THROUGH */ /* FALL THROUGH */

@ -489,7 +489,7 @@ struct NetworkChatWindow : public QueryStringBaseWindow {
default: NOT_REACHED(); default: NOT_REACHED();
case HEBR_EDITING: { case HEBR_EDITING: {
Window *osk = FindWindowById(WC_OSK, 0); Window *osk = FindWindowById(WC_OSK, 0);
if (osk != NULL && osk->parent == this) osk->OnInvalidateData(); if (osk != NULL && osk->parent == this) osk->InvalidateData();
} break; } break;
case HEBR_CONFIRM: case HEBR_CONFIRM:
SendChat(this->text.buf, this->dtype, this->dest); SendChat(this->text.buf, this->dtype, this->dest);

@ -996,7 +996,6 @@ struct MessageHistoryWindow : Window {
virtual void OnResize(Point delta) virtual void OnResize(Point delta)
{ {
this->vscroll.UpdateCapacity(delta.y / this->line_height); this->vscroll.UpdateCapacity(delta.y / this->line_height);
this->OnInvalidateData(0);
} }
}; };
@ -1160,8 +1159,7 @@ struct MessageOptionsWindow : Window {
case WIDGET_NEWSOPT_SOUNDTICKER: // Change ticker sound on/off case WIDGET_NEWSOPT_SOUNDTICKER: // Change ticker sound on/off
_news_ticker_sound ^= 1; _news_ticker_sound ^= 1;
this->OnInvalidateData(0); this->InvalidateData();
this->SetWidgetDirty(widget);
break; break;
default: { // Clicked on the [<] .. [>] widgets default: { // Clicked on the [<] .. [>] widgets
@ -1187,8 +1185,7 @@ struct MessageOptionsWindow : Window {
this->SetMessageButtonStates(index, i); this->SetMessageButtonStates(index, i);
_news_type_data[i].display = (NewsDisplay)index; _news_type_data[i].display = (NewsDisplay)index;
} }
this->OnInvalidateData(0); this->InvalidateData();
this->SetDirty();
} }
}; };

@ -1632,8 +1632,7 @@ public:
default: break; default: break;
} }
this->SetDirty(); this->InvalidateData();
this->OnInvalidateData();
} }
virtual void OnInvalidateData(int data = 0) virtual void OnInvalidateData(int data = 0)

@ -353,8 +353,7 @@ struct GameOptionsWindow : Window {
T::SetSet(name); T::SetSet(name);
this->reload = true; this->reload = true;
this->SetDirty(); this->InvalidateData();
this->OnInvalidateData(0);
} }
} }
@ -625,8 +624,7 @@ public:
this->RaiseWidget(GDW_LVL_EASY + this->opt_mod_temp.difficulty.diff_level); this->RaiseWidget(GDW_LVL_EASY + this->opt_mod_temp.difficulty.diff_level);
SetDifficultyLevel(3, &this->opt_mod_temp.difficulty); // set difficulty level to custom SetDifficultyLevel(3, &this->opt_mod_temp.difficulty); // set difficulty level to custom
this->LowerWidget(GDW_LVL_CUSTOM); this->LowerWidget(GDW_LVL_CUSTOM);
this->OnInvalidateData(); this->InvalidateData();
this->SetDirty();
return; return;
} }
@ -639,8 +637,7 @@ public:
this->RaiseWidget(GDW_LVL_EASY + this->opt_mod_temp.difficulty.diff_level); this->RaiseWidget(GDW_LVL_EASY + this->opt_mod_temp.difficulty.diff_level);
SetDifficultyLevel(widget - GDW_LVL_EASY, &this->opt_mod_temp.difficulty); SetDifficultyLevel(widget - GDW_LVL_EASY, &this->opt_mod_temp.difficulty);
this->LowerWidget(GDW_LVL_EASY + this->opt_mod_temp.difficulty.diff_level); this->LowerWidget(GDW_LVL_EASY + this->opt_mod_temp.difficulty.diff_level);
this->OnInvalidateData(); this->InvalidateData();
this->SetDirty();
break; break;
case GDW_HIGHSCORE: // Highscore Table case GDW_HIGHSCORE: // Highscore Table

Loading…
Cancel
Save