Merge branch 'master' into jgrpp
# Conflicts: # cmake/CompileFlags.cmake # src/cargomonitor.cpp # src/core/CMakeLists.txt # src/economy.cpp # src/landscape.cpp # src/linkgraph/flowmapper.cpp # src/linkgraph/linkgraph_gui.cpp # src/linkgraph/linkgraphschedule.cpp # src/misc_gui.cpp # src/newgrf_generic.cpp # src/newgrf_storage.cpp # src/rail_gui.cpp # src/saveload/afterload.cpp # src/saveload/station_sl.cpp # src/script/script_gui.cpp # src/station_cmd.cpp # src/station_gui.cpp # src/string_func.h # src/terraform_cmd.cpp
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
#include "textbuf_gui.h"
|
||||
#include "window_gui.h"
|
||||
|
||||
#include <optional>
|
||||
|
||||
/**
|
||||
* Data stored about a string that can be modified in the GUI
|
||||
*/
|
||||
@@ -27,7 +29,7 @@ struct QueryString {
|
||||
int ok_button; ///< Widget button of parent window to simulate when pressing OK in OSK.
|
||||
int cancel_button; ///< Widget button of parent window to simulate when pressing CANCEL in OSK.
|
||||
Textbuf text;
|
||||
const char *orig;
|
||||
std::optional<std::string> orig;
|
||||
bool handled;
|
||||
|
||||
/**
|
||||
@@ -35,18 +37,10 @@ struct QueryString {
|
||||
* @param size Maximum size in bytes.
|
||||
* @param chars Maximum size in chars.
|
||||
*/
|
||||
QueryString(uint16 size, uint16 chars = UINT16_MAX) : ok_button(ACTION_NOTHING), cancel_button(ACTION_DESELECT), text(size, chars), orig(nullptr)
|
||||
QueryString(uint16 size, uint16 chars = UINT16_MAX) : ok_button(ACTION_NOTHING), cancel_button(ACTION_DESELECT), text(size, chars)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Make sure everything gets freed.
|
||||
*/
|
||||
~QueryString()
|
||||
{
|
||||
free(this->orig);
|
||||
}
|
||||
|
||||
public:
|
||||
void DrawEditBox(const Window *w, int wid) const;
|
||||
void ClickEditBox(Window *w, Point pt, int wid, int click_count, bool focus_changed);
|
||||
|
Reference in New Issue
Block a user