|
@@ -35,49 +35,49 @@ struct QueryString {
|
|
|
const char *orig;
|
|
|
CharSetFilter afilter;
|
|
|
bool handled;
|
|
|
|
|
|
/**
|
|
|
* Make sure everything gets initialized properly.
|
|
|
*/
|
|
|
QueryString() : orig(NULL)
|
|
|
{
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Make sure everything gets freed.
|
|
|
*/
|
|
|
~QueryString()
|
|
|
{
|
|
|
free((void*)this->orig);
|
|
|
}
|
|
|
|
|
|
private:
|
|
|
bool HasEditBoxFocus(const Window *w, int wid) const;
|
|
|
public:
|
|
|
void DrawEditBox(Window *w, int wid);
|
|
|
void HandleEditBox(Window *w, int wid);
|
|
|
HandleEditBoxResult HandleEditBoxKey(Window *w, int wid, uint16 key, uint16 keycode, Window::EventState &state);
|
|
|
HandleEditBoxResult HandleEditBoxKey(Window *w, int wid, uint16 key, uint16 keycode, EventState &state);
|
|
|
};
|
|
|
|
|
|
struct QueryStringBaseWindow : public Window, public QueryString {
|
|
|
char *edit_str_buf;
|
|
|
const uint16 edit_str_size; ///< maximum length of string (in bytes), including terminating '\0'
|
|
|
|
|
|
QueryStringBaseWindow(uint16 size) : Window(), edit_str_size(size)
|
|
|
{
|
|
|
assert(size != 0);
|
|
|
this->edit_str_buf = CallocT<char>(size);
|
|
|
}
|
|
|
|
|
|
~QueryStringBaseWindow()
|
|
|
{
|
|
|
free(this->edit_str_buf);
|
|
|
}
|
|
|
|
|
|
void DrawEditBox(int wid);
|
|
|
void HandleEditBox(int wid);
|
|
|
HandleEditBoxResult HandleEditBoxKey(int wid, uint16 key, uint16 keycode, EventState &state);
|
|
|
virtual void OnOpenOSKWindow(int wid);
|
|
|
virtual void OnOSKInput(int wid) {}
|
|
|
};
|
|
|
|