Merge branch 'save_ext' into jgrpp

# Conflicts:
#	config.lib
#	src/misc_gui.cpp
#	src/network/network_gui.cpp
#	src/settings_type.h
#	src/smallmap_gui.cpp
#	src/smallmap_gui.h
#	src/station_cmd.cpp
#	src/toolbar_gui.cpp
#	src/vehicle_gui.cpp
#	src/window.cpp
This commit is contained in:
Jonathan G Rennison
2019-01-14 00:01:44 +00:00
147 changed files with 1026 additions and 330 deletions

View File

@@ -14,6 +14,7 @@
#include "../string_func.h"
#include "../strings_func.h"
#include "../window_func.h"
#include "../guitimer_func.h"
#include "dropdown_type.h"
#include "dropdown_widget.h"
@@ -97,6 +98,7 @@ struct DropdownWindow : Window {
bool drag_mode;
bool instant_close; ///< Close the window when the mouse button is raised.
int scrolling; ///< If non-zero, auto-scroll the item list (one time).
GUITimer scrolling_timer; ///< Timer for auto-scroll of the item list.
Point position; ///< Position of the topleft corner of the window.
Scrollbar *vscroll;
DropDownSyncFocus sync_parent_focus; ///< Call parent window's OnFocus[Lost]().
@@ -157,6 +159,7 @@ struct DropdownWindow : Window {
this->click_delay = 0;
this->drag_mode = true;
this->instant_close = instant_close;
this->scrolling_timer = GUITimer(MILLISECONDS_PER_TICK);
}
~DropdownWindow()
@@ -259,8 +262,11 @@ struct DropdownWindow : Window {
}
}
virtual void OnTick()
virtual void OnRealtimeTick(uint delta_ms)
{
if (!this->scrolling_timer.Elapsed(delta_ms)) return;
this->scrolling_timer.SetInterval(MILLISECONDS_PER_TICK);
if (this->scrolling != 0) {
int pos = this->vscroll->GetPosition();