(svn r19574) -Fix: graphs were not properly updated when going toggling keys (i.e. companies)

This commit is contained in:
rubidium 2010-04-07 15:20:24 +00:00
parent 1fbde179d9
commit c2945f0bb0

View File

@ -88,11 +88,11 @@ struct GraphLegendWindow : Window {
ToggleBit(_legend_excluded_companies, widget - GLW_FIRST_COMPANY);
this->ToggleWidgetLoweredState(widget);
this->SetDirty();
SetWindowDirty(WC_INCOME_GRAPH, 0);
SetWindowDirty(WC_OPERATING_PROFIT, 0);
SetWindowDirty(WC_DELIVERED_CARGO, 0);
SetWindowDirty(WC_PERFORMANCE_HISTORY, 0);
SetWindowDirty(WC_COMPANY_VALUE, 0);
InvalidateWindowData(WC_INCOME_GRAPH, 0);
InvalidateWindowData(WC_OPERATING_PROFIT, 0);
InvalidateWindowData(WC_DELIVERED_CARGO, 0);
InvalidateWindowData(WC_PERFORMANCE_HISTORY, 0);
InvalidateWindowData(WC_COMPANY_VALUE, 0);
}
virtual void OnInvalidateData(int data)
@ -526,6 +526,11 @@ public:
this->UpdateStatistics(false);
}
virtual void OnInvalidateData(int data)
{
this->OnTick();
}
/**
* Update the statistics.
* @param initialize Initialize the data structure.
@ -956,6 +961,11 @@ struct PaymentRatesGraphWindow : BaseGraphWindow {
/* Override default OnTick */
}
virtual void OnInvalidateData(int data)
{
this->OnHundredthTick();
}
virtual void OnHundredthTick()
{
this->UpdateExcludedData();