|
@@ -1111,48 +1111,48 @@ struct MainToolbarWindow : Window {
|
|
|
return ES_HANDLED;
|
|
|
}
|
|
|
|
|
|
virtual void OnPlaceObject(Point pt, TileIndex tile)
|
|
|
{
|
|
|
_place_proc(tile);
|
|
|
}
|
|
|
|
|
|
virtual void OnTick()
|
|
|
{
|
|
|
if (this->IsWidgetLowered(TBN_PAUSE) != !!_pause_mode) {
|
|
|
this->ToggleWidgetLoweredState(TBN_PAUSE);
|
|
|
this->InvalidateWidget(TBN_PAUSE);
|
|
|
this->SetWidgetDirty(TBN_PAUSE);
|
|
|
}
|
|
|
|
|
|
if (this->IsWidgetLowered(TBN_FASTFORWARD) != !!_fast_forward) {
|
|
|
this->ToggleWidgetLoweredState(TBN_FASTFORWARD);
|
|
|
this->InvalidateWidget(TBN_FASTFORWARD);
|
|
|
this->SetWidgetDirty(TBN_FASTFORWARD);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
virtual void OnResize(Point delta)
|
|
|
{
|
|
|
if (this->width <= TBP_NORMAL_MAXBUTTON * TBP_BUTTONWIDTH) {
|
|
|
SplitToolbar(this);
|
|
|
} else {
|
|
|
ResizeToolbar(this);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
virtual void OnTimeout()
|
|
|
{
|
|
|
for (uint i = TBN_SETTINGS; i < this->widget_count - 1; i++) {
|
|
|
if (this->IsWidgetLowered(i)) {
|
|
|
this->RaiseWidget(i);
|
|
|
this->InvalidateWidget(i);
|
|
|
this->SetWidgetDirty(i);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
virtual void OnInvalidateData(int data)
|
|
|
{
|
|
|
if (FindWindowById(WC_MAIN_WINDOW, 0) != NULL) HandleZoomMessage(this, FindWindowById(WC_MAIN_WINDOW, 0)->viewport, TBN_ZOOMIN, TBN_ZOOMOUT);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
static const Widget _toolb_normal_widgets[] = {
|
|
|
{ WWT_IMGBTN, RESIZE_LEFT, COLOUR_GREY, 0, 0, 0, 21, SPR_IMG_PAUSE, STR_TOOLBAR_TOOLTIP_PAUSE_GAME}, // TBN_PAUSE
|
|
@@ -1384,26 +1384,26 @@ public:
|
|
|
if (extra_spacing_at[j] == i) {
|
|
|
j++;
|
|
|
uint add = spacing / (lengthof(extra_spacing_at) - j);
|
|
|
spacing -= add;
|
|
|
x += add;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
virtual void OnTimeout()
|
|
|
{
|
|
|
this->SetWidgetsLoweredState(false, TBSE_DATEBACKWARD, TBSE_DATEFORWARD, WIDGET_LIST_END);
|
|
|
this->InvalidateWidget(TBSE_DATEBACKWARD);
|
|
|
this->InvalidateWidget(TBSE_DATEFORWARD);
|
|
|
this->SetWidgetDirty(TBSE_DATEBACKWARD);
|
|
|
this->SetWidgetDirty(TBSE_DATEFORWARD);
|
|
|
}
|
|
|
|
|
|
virtual void OnTick()
|
|
|
{
|
|
|
if (this->IsWidgetLowered(TBSE_PAUSE) != !!_pause_mode) {
|
|
|
this->ToggleWidgetLoweredState(TBSE_PAUSE);
|
|
|
this->SetDirty();
|
|
|
}
|
|
|
|
|
|
if (this->IsWidgetLowered(TBSE_FASTFORWARD) != !!_fast_forward) {
|
|
|
this->ToggleWidgetLoweredState(TBSE_FASTFORWARD);
|
|
|
this->SetDirty();
|