Add many missing override annotations
This mainly fixes cases caught by -Winconsistent-missing-override, so there are doubtless still many missing ones.
This commit is contained in:
parent
39a6726516
commit
0b15dfd0fc
28 changed files with 328 additions and 334 deletions
|
@ -98,41 +98,41 @@ class editor_controller : public controller_base,
|
|||
void custom_tods_dialog();
|
||||
|
||||
/** Save the map, open dialog if not named yet. */
|
||||
void save_map() {context_manager_->save_map();}
|
||||
void save_map() override {context_manager_->save_map();}
|
||||
|
||||
/** command_executor override */
|
||||
bool can_execute_command(const hotkey::hotkey_command& command, int index = -1) const;
|
||||
bool can_execute_command(const hotkey::hotkey_command& command, int index = -1) const override;
|
||||
|
||||
/** command_executor override */
|
||||
hotkey::ACTION_STATE get_action_state(hotkey::HOTKEY_COMMAND command, int index) const;
|
||||
hotkey::ACTION_STATE get_action_state(hotkey::HOTKEY_COMMAND command, int index) const override;
|
||||
|
||||
/** command_executor override */
|
||||
bool execute_command(const hotkey::hotkey_command& command, int index = -1, bool press=true);
|
||||
bool execute_command(const hotkey::hotkey_command& command, int index = -1, bool press=true) override;
|
||||
|
||||
/** controller_base override */
|
||||
void show_menu(const std::vector<std::string>& items_arg, int xloc, int yloc, bool context_menu, display& disp);
|
||||
void show_menu(const std::vector<std::string>& items_arg, int xloc, int yloc, bool context_menu, display& disp) override;
|
||||
|
||||
void show_help();
|
||||
void status_table();
|
||||
void show_help() override;
|
||||
void status_table() override;
|
||||
|
||||
/** Show the preferences dialog */
|
||||
void preferences();
|
||||
void preferences() override;
|
||||
|
||||
/** Handle hotkeys to scroll map */
|
||||
void scroll_up(bool on);
|
||||
void scroll_down(bool on);
|
||||
void scroll_left(bool on);
|
||||
void scroll_right(bool on);
|
||||
void scroll_up(bool on) override;
|
||||
void scroll_down(bool on) override;
|
||||
void scroll_left(bool on) override;
|
||||
void scroll_right(bool on) override;
|
||||
|
||||
/** Grid toggle */
|
||||
void toggle_grid();
|
||||
void toggle_grid() override;
|
||||
|
||||
void terrain_description();
|
||||
void unit_description();
|
||||
void terrain_description() override;
|
||||
void unit_description() override;
|
||||
void change_unit_id();
|
||||
void rename_unit();
|
||||
void rename_unit() override;
|
||||
|
||||
void unit_list();
|
||||
void unit_list() override;
|
||||
|
||||
/** Copy the selection on the current map to the clipboard */
|
||||
void copy_selection();
|
||||
|
@ -152,25 +152,25 @@ class editor_controller : public controller_base,
|
|||
void add_area();
|
||||
|
||||
/* mouse_handler_base overrides */
|
||||
void mouse_motion(int x, int y, const bool browse, bool update, map_location new_loc = map_location::null_location());
|
||||
editor_display& gui() { return *gui_; }
|
||||
const editor_display& gui() const { return *gui_; }
|
||||
bool allow_mouse_wheel_scroll(int x, int y);
|
||||
bool right_click_show_menu(int x, int y, const bool browse);
|
||||
bool left_click(int x, int y, const bool browse);
|
||||
void left_drag_end(int x, int y, const bool browse);
|
||||
void left_mouse_up(int x, int y, const bool browse);
|
||||
bool right_click(int x, int y, const bool browse);
|
||||
void right_drag_end(int x, int y, const bool browse);
|
||||
void right_mouse_up(int x, int y, const bool browse);
|
||||
void mouse_motion(int x, int y, const bool browse, bool update, map_location new_loc = map_location::null_location()) override;
|
||||
editor_display& gui() override { return *gui_; }
|
||||
const editor_display& gui() const override { return *gui_; }
|
||||
bool allow_mouse_wheel_scroll(int x, int y) override;
|
||||
bool right_click_show_menu(int x, int y, const bool browse) override;
|
||||
bool left_click(int x, int y, const bool browse) override;
|
||||
void left_drag_end(int x, int y, const bool browse) override;
|
||||
void left_mouse_up(int x, int y, const bool browse) override;
|
||||
bool right_click(int x, int y, const bool browse) override;
|
||||
void right_drag_end(int x, int y, const bool browse) override;
|
||||
void right_mouse_up(int x, int y, const bool browse) override;
|
||||
|
||||
virtual hotkey::command_executor * get_hotkey_command_executor();
|
||||
virtual hotkey::command_executor * get_hotkey_command_executor() override;
|
||||
|
||||
protected:
|
||||
/* controller_base overrides */
|
||||
void process_keyup_event(const SDL_Event& event);
|
||||
mouse_handler_base& get_mouse_handler_base() { return *this; }
|
||||
editor_display& get_display() { return *gui_; }
|
||||
void process_keyup_event(const SDL_Event& event) override;
|
||||
mouse_handler_base& get_mouse_handler_base() override { return *this; }
|
||||
editor_display& get_display() override { return *gui_; }
|
||||
|
||||
/** Get the current mouse action */
|
||||
mouse_action* get_mouse_action();
|
||||
|
@ -216,12 +216,12 @@ class editor_controller : public controller_base,
|
|||
/**
|
||||
* Undos an action in the current map context
|
||||
*/
|
||||
void undo();
|
||||
void undo() override;
|
||||
|
||||
/**
|
||||
* Redos an action in the current map context
|
||||
*/
|
||||
void redo();
|
||||
void redo() override;
|
||||
|
||||
editor::menu_type active_menu_;
|
||||
|
||||
|
|
|
@ -53,30 +53,30 @@ public:
|
|||
|
||||
|
||||
|
||||
virtual sdl_handler_vector handler_members();
|
||||
virtual sdl_handler_vector handler_members() override;
|
||||
|
||||
void set_start_item(size_t index) { items_start_ = index; }
|
||||
void set_start_item(size_t index) override { items_start_ = index; }
|
||||
|
||||
size_t start_num(void) { return items_start_; }
|
||||
size_t start_num(void) override { return items_start_; }
|
||||
|
||||
/** Menu expanding for palette group list */
|
||||
void expand_palette_groups_menu(std::vector< std::pair<std::string, std::string> >& items);
|
||||
void expand_palette_groups_menu(std::vector<std::string>& items);
|
||||
void expand_palette_groups_menu(std::vector< std::pair<std::string, std::string> >& items) override;
|
||||
void expand_palette_groups_menu(std::vector<std::string>& items) override;
|
||||
|
||||
void set_group(size_t index);
|
||||
void set_group(size_t index) override;
|
||||
// int active_group();
|
||||
|
||||
const std::vector<item_group>& get_groups() const { return groups_; }
|
||||
const std::vector<item_group>& get_groups() const override { return groups_; }
|
||||
|
||||
virtual void draw() {
|
||||
virtual void draw() override {
|
||||
widget::draw();
|
||||
}
|
||||
virtual void draw_contents();
|
||||
virtual void draw_contents() override;
|
||||
|
||||
void next_group() {
|
||||
void next_group() override {
|
||||
set_group( (active_group_index() +1) % (groups_.size()) );
|
||||
}
|
||||
void prev_group() {
|
||||
void prev_group() override {
|
||||
set_group( (active_group_index() -1) % (groups_.size()) );
|
||||
}
|
||||
|
||||
|
@ -85,14 +85,14 @@ public:
|
|||
*
|
||||
* Use if the size_specs have changed.
|
||||
*/
|
||||
void adjust_size(const SDL_Rect& target);
|
||||
void adjust_size(const SDL_Rect& target) override;
|
||||
|
||||
virtual bool scroll_up();
|
||||
virtual bool can_scroll_up();
|
||||
virtual bool scroll_down();
|
||||
virtual bool can_scroll_down();
|
||||
virtual bool scroll_up() override;
|
||||
virtual bool can_scroll_up() override;
|
||||
virtual bool scroll_down() override;
|
||||
virtual bool can_scroll_down() override;
|
||||
|
||||
void swap();
|
||||
void swap() override;
|
||||
|
||||
virtual std::string get_help_string() = 0;
|
||||
|
||||
|
@ -123,12 +123,12 @@ private:
|
|||
virtual bool is_selected_bg_item(const std::string& id);
|
||||
|
||||
/** Return the number of items in the palette. */
|
||||
int num_items();
|
||||
int num_items() override;
|
||||
|
||||
/** Return the number of items in the palette. */
|
||||
int num_visible_items() { return buttons_.size(); }
|
||||
|
||||
void hide(bool hidden) {
|
||||
void hide(bool hidden) override {
|
||||
widget::hide(hidden);
|
||||
if (!hidden)
|
||||
help_handle_ = gui_.video().set_help_string(get_help_string());
|
||||
|
@ -149,8 +149,8 @@ protected:
|
|||
const std::vector<std::string>& active_group() { return group_map_[active_group_]; }
|
||||
|
||||
/** Select a foreground item. */
|
||||
virtual void select_fg_item(const std::string& item_id);
|
||||
virtual void select_bg_item(const std::string& item_id);
|
||||
virtual void select_fg_item(const std::string& item_id) override;
|
||||
virtual void select_bg_item(const std::string& item_id) override;
|
||||
|
||||
/**
|
||||
* The editor_groups as defined in editor-groups.cfg.
|
||||
|
|
|
@ -35,16 +35,16 @@ public:
|
|||
//event handling
|
||||
virtual bool mouse_click() { return false;}
|
||||
|
||||
virtual bool scroll_up() { return false;}
|
||||
virtual bool can_scroll_up() { return false;}
|
||||
virtual bool scroll_down() { return false;}
|
||||
virtual bool can_scroll_down() { return false;}
|
||||
virtual bool scroll_up() override { return false;}
|
||||
virtual bool can_scroll_up() override { return false;}
|
||||
virtual bool scroll_down() override { return false;}
|
||||
virtual bool can_scroll_down() override { return false;}
|
||||
|
||||
//drawing
|
||||
virtual void adjust_size(const SDL_Rect& /*target*/) {}
|
||||
virtual void draw() {}
|
||||
virtual void adjust_size(const SDL_Rect& /*target*/) override {}
|
||||
virtual void draw() override {}
|
||||
|
||||
void hide(bool hidden) {
|
||||
void hide(bool hidden) override {
|
||||
if (!hidden) {
|
||||
std::shared_ptr<gui::button> upscroll_button = gui_.find_action_button("upscroll-button-editor");
|
||||
upscroll_button->enable(false);
|
||||
|
@ -66,21 +66,21 @@ public:
|
|||
std::vector<gui::widget>* get_widgets() { return nullptr; }
|
||||
|
||||
//group
|
||||
virtual void set_group(size_t /*index*/) {}
|
||||
virtual void next_group() {}
|
||||
virtual void prev_group() {}
|
||||
virtual const std::vector<item_group>& get_groups() const { return empty_; }
|
||||
virtual void set_group(size_t /*index*/) override {}
|
||||
virtual void next_group() override {}
|
||||
virtual void prev_group() override {}
|
||||
virtual const std::vector<item_group>& get_groups() const override { return empty_; }
|
||||
|
||||
/** Menu expanding for palette group list */
|
||||
virtual void expand_palette_groups_menu(std::vector< std::pair< std::string, std::string> >& /*items*/) {}
|
||||
virtual void expand_palette_groups_menu(std::vector< std::string> & /*items*/) {}
|
||||
virtual void expand_palette_groups_menu(std::vector< std::pair< std::string, std::string> >& /*items*/) override {}
|
||||
virtual void expand_palette_groups_menu(std::vector< std::string> & /*items*/) override {}
|
||||
|
||||
//item
|
||||
virtual int num_items() {return 0;}
|
||||
virtual size_t start_num() {return 0;}
|
||||
virtual void set_start_item(size_t /*index*/) {}
|
||||
virtual bool supports_swap() { return false; }
|
||||
virtual void swap() {}
|
||||
virtual int num_items() override {return 0;}
|
||||
virtual size_t start_num() override {return 0;}
|
||||
virtual void set_start_item(size_t /*index*/) override {}
|
||||
virtual bool supports_swap() override { return false; }
|
||||
virtual void swap() override {}
|
||||
|
||||
private:
|
||||
display& gui_;
|
||||
|
|
|
@ -118,7 +118,7 @@ public:
|
|||
{
|
||||
state_.selected = selected;
|
||||
}
|
||||
void draw() { gui::widget::draw(); }
|
||||
void draw() override { gui::widget::draw(); }
|
||||
private:
|
||||
std::string id_;
|
||||
std::string desc_;
|
||||
|
|
|
@ -30,11 +30,11 @@ public:
|
|||
location_palette(editor_display &gui, const config& /*cfg*/, mouse_action** active_mouse_action);
|
||||
|
||||
|
||||
virtual sdl_handler_vector handler_members();
|
||||
virtual sdl_handler_vector handler_members() override;
|
||||
|
||||
void set_start_item(size_t index) { items_start_ = index; }
|
||||
void set_start_item(size_t index) override { items_start_ = index; }
|
||||
|
||||
size_t start_num(void) { return items_start_; }
|
||||
size_t start_num(void) override { return items_start_; }
|
||||
|
||||
/** Menu expanding for palette group list */
|
||||
void expand_palette_groups_menu(std::vector< std::pair<std::string, std::string> >&) override {}
|
||||
|
@ -45,22 +45,22 @@ public:
|
|||
virtual void prev_group() override {}
|
||||
virtual const std::vector<item_group>& get_groups() const override { static const std::vector<item_group> empty; return empty; }
|
||||
|
||||
virtual void draw() {
|
||||
virtual void draw() override {
|
||||
widget::draw();
|
||||
}
|
||||
virtual void draw_contents();
|
||||
virtual void draw_contents() override;
|
||||
|
||||
/**
|
||||
* Update the size of this widget.
|
||||
*
|
||||
* Use if the size_specs have changed.
|
||||
*/
|
||||
void adjust_size(const SDL_Rect& target);
|
||||
void adjust_size(const SDL_Rect& target) override;
|
||||
|
||||
virtual bool scroll_up();
|
||||
virtual bool can_scroll_up();
|
||||
virtual bool scroll_down();
|
||||
virtual bool can_scroll_down();
|
||||
virtual bool scroll_up() override;
|
||||
virtual bool can_scroll_up() override;
|
||||
virtual bool scroll_down() override;
|
||||
virtual bool can_scroll_down() override;
|
||||
|
||||
void swap() override {}
|
||||
bool can_swap() { return false; }
|
||||
|
@ -87,7 +87,7 @@ private:
|
|||
virtual bool is_selected_item(const std::string& id);
|
||||
|
||||
/** Return the number of items in the palette. */
|
||||
int num_items();
|
||||
int num_items() override;
|
||||
/** Return the maximum number of items shown at the same time. */
|
||||
int num_visible_items();
|
||||
protected:
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
void set_label(const std::string& val);
|
||||
|
||||
bool hit(int x, int y) const;
|
||||
virtual void enable(bool new_val=true);
|
||||
virtual void enable(bool new_val=true) override;
|
||||
void release();
|
||||
|
||||
void set_item_image(
|
||||
|
@ -66,18 +66,18 @@ public:
|
|||
item_id_ = id;
|
||||
}
|
||||
|
||||
void draw() {
|
||||
void draw() override {
|
||||
widget::draw();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
virtual void handle_event(const SDL_Event& event);
|
||||
virtual void handle_event(const SDL_Event& event) override;
|
||||
virtual void mouse_motion(const SDL_MouseMotionEvent& event);
|
||||
virtual void mouse_down(const SDL_MouseButtonEvent& event);
|
||||
virtual void mouse_up(const SDL_MouseButtonEvent& event);
|
||||
|
||||
virtual void draw_contents();
|
||||
virtual void draw_contents() override;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ public:
|
|||
* The methodes hide_children and layout_children are supposed to be
|
||||
* overridden by subclasses of this class which add new sub-widgets.
|
||||
*/
|
||||
void set_location(const SDL_Rect& rect);
|
||||
void set_location(const SDL_Rect& rect) override;
|
||||
using widget::set_location;
|
||||
const std::vector<std::string>& user_list() const { return user_list_; }
|
||||
void send_to_server(const config& cfg) override;
|
||||
|
@ -124,18 +124,18 @@ protected:
|
|||
*/
|
||||
const config& game_config() const;
|
||||
|
||||
virtual void draw_contents();
|
||||
virtual void draw_contents() override;
|
||||
|
||||
virtual void process_event();
|
||||
virtual void process_event() override;
|
||||
|
||||
virtual void handle_event(const SDL_Event& event);
|
||||
virtual void handle_event(const SDL_Event& event) override;
|
||||
virtual void handle_key_event(const SDL_KeyboardEvent& event);
|
||||
|
||||
/** Override chat_handler. */
|
||||
void add_chat_message(const time_t& time, const std::string& speaker,
|
||||
int side, const std::string& message,
|
||||
events::chat_handler::MESSAGE_TYPE type=events::chat_handler::MESSAGE_PRIVATE);
|
||||
void send_chat_message(const std::string& message, bool allies_only=false);
|
||||
events::chat_handler::MESSAGE_TYPE type=events::chat_handler::MESSAGE_PRIVATE) override;
|
||||
void send_chat_message(const std::string& message, bool allies_only=false) override;
|
||||
|
||||
/** Process chat messages. */
|
||||
void process_message(const config& msg, const bool whisper=false);
|
||||
|
|
|
@ -139,34 +139,34 @@ public:
|
|||
protected:
|
||||
/** inherited form chat_handler */
|
||||
virtual void send_chat_message(const std::string& message,
|
||||
bool /*allies_only*/);
|
||||
bool /*allies_only*/) override;
|
||||
|
||||
virtual void user_relation_changed(const std::string& name);
|
||||
virtual void user_relation_changed(const std::string& name) override;
|
||||
|
||||
/** inherited form chat_handler */
|
||||
/** inherited from chat_handler */
|
||||
virtual void add_chat_message(const time_t& time,
|
||||
const std::string& speaker,
|
||||
int side,
|
||||
const std::string& message,
|
||||
events::chat_handler::MESSAGE_TYPE type
|
||||
= events::chat_handler::MESSAGE_PRIVATE);
|
||||
= events::chat_handler::MESSAGE_PRIVATE) override;
|
||||
|
||||
/** inherited form chat_handler */
|
||||
/** inherited from chat_handler */
|
||||
virtual void add_whisper_sent(const std::string& receiver,
|
||||
const std::string& message);
|
||||
const std::string& message) override;
|
||||
|
||||
/** inherited form chat_handler */
|
||||
/** inherited from chat_handler */
|
||||
virtual void add_whisper_received(const std::string& sender,
|
||||
const std::string& message);
|
||||
const std::string& message) override;
|
||||
|
||||
/** inherited form chat_handler */
|
||||
/** inherited from chat_handler */
|
||||
virtual void add_chat_room_message_sent(const std::string& room,
|
||||
const std::string& message);
|
||||
const std::string& message) override;
|
||||
|
||||
/** inherited form chat_handler */
|
||||
/** inherited from chat_handler */
|
||||
virtual void add_chat_room_message_received(const std::string& room,
|
||||
const std::string& speaker,
|
||||
const std::string& message);
|
||||
const std::string& message) override;
|
||||
|
||||
private:
|
||||
void update_selected_game();
|
||||
|
@ -347,16 +347,16 @@ private:
|
|||
void skip_replay_changed_callback(twindow& window);
|
||||
|
||||
/** Inherited from tdialog, implemented by REGISTER_DIALOG. */
|
||||
virtual const std::string& window_id() const;
|
||||
virtual const std::string& window_id() const override;
|
||||
|
||||
/** Inherited from tdialog. */
|
||||
virtual void post_build(twindow& window);
|
||||
virtual void post_build(twindow& window) override;
|
||||
|
||||
/** Inherited from tdialog. */
|
||||
void pre_show(twindow& window);
|
||||
void pre_show(twindow& window) override;
|
||||
|
||||
/** Inherited from tdialog. */
|
||||
void post_show(twindow& window);
|
||||
void post_show(twindow& window) override;
|
||||
|
||||
const config& game_config_;
|
||||
|
||||
|
|
|
@ -200,8 +200,7 @@ struct thorizontal_list : public virtual tgenerator_
|
|||
}
|
||||
|
||||
/** See @ref twidget::request_reduce_height. */
|
||||
virtual void request_reduce_height(const unsigned /*maximum_height*/)
|
||||
override
|
||||
virtual void request_reduce_height(const unsigned /*maximum_height*/) override
|
||||
{
|
||||
/* DO NOTHING */
|
||||
}
|
||||
|
@ -220,7 +219,7 @@ struct thorizontal_list : public virtual tgenerator_
|
|||
*
|
||||
* @param rectangle The visible rectangle.
|
||||
*/
|
||||
void set_visible_rectangle(const SDL_Rect& rectangle);
|
||||
void set_visible_rectangle(const SDL_Rect& rectangle) override;
|
||||
|
||||
/** See @ref twidget::find_at. */
|
||||
virtual twidget* find_at(const tpoint& coordinate,
|
||||
|
@ -233,22 +232,22 @@ struct thorizontal_list : public virtual tgenerator_
|
|||
/***** ***** ***** ***** keyboard functions ***** ***** ***** *****/
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_up_arrow(SDLMod /*modifier*/, bool& /*handled*/)
|
||||
void handle_key_up_arrow(SDLMod /*modifier*/, bool& /*handled*/) override
|
||||
{
|
||||
/* do nothing */
|
||||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_down_arrow(SDLMod /*modifier*/, bool& /*handled*/)
|
||||
void handle_key_down_arrow(SDLMod /*modifier*/, bool& /*handled*/) override
|
||||
{
|
||||
/* do nothing */
|
||||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_left_arrow(SDLMod modifier, bool& handled);
|
||||
void handle_key_left_arrow(SDLMod modifier, bool& handled) override;
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_right_arrow(SDLMod modifier, bool& handled);
|
||||
void handle_key_right_arrow(SDLMod modifier, bool& handled) override;
|
||||
|
||||
private:
|
||||
/**
|
||||
|
@ -279,8 +278,7 @@ struct tvertical_list : public virtual tgenerator_
|
|||
}
|
||||
|
||||
/** See @ref twidget::request_reduce_height. */
|
||||
virtual void request_reduce_height(const unsigned /*maximum_height*/)
|
||||
override
|
||||
virtual void request_reduce_height(const unsigned /*maximum_height*/) override
|
||||
{
|
||||
/* DO NOTHING */
|
||||
}
|
||||
|
@ -295,7 +293,7 @@ struct tvertical_list : public virtual tgenerator_
|
|||
virtual void set_origin(const tpoint& origin) override;
|
||||
|
||||
/** See @ref thorizontal_list::set_visible_rectangle(). */
|
||||
void set_visible_rectangle(const SDL_Rect& rectangle);
|
||||
void set_visible_rectangle(const SDL_Rect& rectangle) override;
|
||||
|
||||
/** See @ref twidget::find_at. */
|
||||
virtual twidget* find_at(const tpoint& coordinate,
|
||||
|
@ -308,18 +306,18 @@ struct tvertical_list : public virtual tgenerator_
|
|||
/***** ***** ***** ***** keyboard functions ***** ***** ***** *****/
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_up_arrow(SDLMod modifier, bool& handled);
|
||||
void handle_key_up_arrow(SDLMod modifier, bool& handled) override;
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_down_arrow(SDLMod modifier, bool& handled);
|
||||
void handle_key_down_arrow(SDLMod modifier, bool& handled) override;
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_left_arrow(SDLMod /*modifier*/, bool& /*handled*/)
|
||||
void handle_key_left_arrow(SDLMod /*modifier*/, bool& /*handled*/) override
|
||||
{ /* do nothing */
|
||||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_right_arrow(SDLMod /*modifier*/, bool& /*handled*/)
|
||||
void handle_key_right_arrow(SDLMod /*modifier*/, bool& /*handled*/) override
|
||||
{ /* do nothing */
|
||||
}
|
||||
|
||||
|
@ -364,8 +362,7 @@ struct tmatrix : public virtual tgenerator_
|
|||
}
|
||||
|
||||
/** See @ref twidget::request_reduce_height. */
|
||||
virtual void request_reduce_height(const unsigned /*maximum_height*/)
|
||||
override
|
||||
virtual void request_reduce_height(const unsigned /*maximum_height*/) override
|
||||
{
|
||||
/* DO NOTHING */
|
||||
}
|
||||
|
@ -381,7 +378,7 @@ struct tmatrix : public virtual tgenerator_
|
|||
virtual void set_origin(const tpoint& /*origin*/) override;
|
||||
|
||||
/** See @ref thorizontal_list::set_visible_rectangle(). */
|
||||
void set_visible_rectangle(const SDL_Rect& /*rectangle*/);
|
||||
void set_visible_rectangle(const SDL_Rect& /*rectangle*/) override;
|
||||
|
||||
/** See @ref twidget::find_at. */
|
||||
virtual twidget* find_at(const tpoint& /*coordinate*/
|
||||
|
@ -394,16 +391,16 @@ struct tmatrix : public virtual tgenerator_
|
|||
/***** ***** ***** ***** keyboard functions ***** ***** ***** *****/
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_up_arrow(SDLMod, bool&);
|
||||
void handle_key_up_arrow(SDLMod, bool&) override;
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_down_arrow(SDLMod, bool&);
|
||||
void handle_key_down_arrow(SDLMod, bool&) override;
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_left_arrow(SDLMod, bool&);
|
||||
void handle_key_left_arrow(SDLMod, bool&) override;
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_right_arrow(SDLMod, bool&);
|
||||
void handle_key_right_arrow(SDLMod, bool&) override;
|
||||
private:
|
||||
/**
|
||||
* Has the grid already been placed?
|
||||
|
@ -437,7 +434,7 @@ struct tindependent : public virtual tgenerator_
|
|||
virtual void request_reduce_width(const unsigned maximum_width) override;
|
||||
|
||||
/** See thorizontal_list::request_reduce_height. */
|
||||
virtual void request_reduce_height(const unsigned maximum_height);
|
||||
virtual void request_reduce_height(const unsigned maximum_height) override;
|
||||
|
||||
/** See @ref twidget::calculate_best_size. */
|
||||
virtual tpoint calculate_best_size() const override;
|
||||
|
@ -449,7 +446,7 @@ struct tindependent : public virtual tgenerator_
|
|||
virtual void set_origin(const tpoint& origin) override;
|
||||
|
||||
/** See @ref thorizontal_list::set_visible_rectangle(). */
|
||||
void set_visible_rectangle(const SDL_Rect& rectangle);
|
||||
void set_visible_rectangle(const SDL_Rect& rectangle) override;
|
||||
|
||||
/** See @ref twidget::find_at. */
|
||||
virtual twidget* find_at(const tpoint& coordinate,
|
||||
|
@ -469,25 +466,25 @@ struct tindependent : public virtual tgenerator_
|
|||
/***** ***** ***** ***** keyboard functions ***** ***** ***** *****/
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_up_arrow(SDLMod, bool&)
|
||||
void handle_key_up_arrow(SDLMod, bool&) override
|
||||
{
|
||||
/* DO NOTHING */
|
||||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_down_arrow(SDLMod, bool&)
|
||||
void handle_key_down_arrow(SDLMod, bool&) override
|
||||
{
|
||||
/* DO NOTHING */
|
||||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_left_arrow(SDLMod, bool&)
|
||||
void handle_key_left_arrow(SDLMod, bool&) override
|
||||
{
|
||||
/* DO NOTHING */
|
||||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_right_arrow(SDLMod, bool&)
|
||||
void handle_key_right_arrow(SDLMod, bool&) override
|
||||
{
|
||||
/* DO NOTHING */
|
||||
}
|
||||
|
@ -590,7 +587,7 @@ public:
|
|||
/***** ***** ***** inherited ***** ****** *****/
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void delete_item(const unsigned index)
|
||||
void delete_item(const unsigned index) override
|
||||
{
|
||||
assert(index < items_.size());
|
||||
|
||||
|
@ -609,7 +606,7 @@ public:
|
|||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void clear()
|
||||
void clear() override
|
||||
{
|
||||
for(auto item : items_)
|
||||
{
|
||||
|
@ -620,7 +617,7 @@ public:
|
|||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void select_item(const unsigned index, const bool select = true)
|
||||
void select_item(const unsigned index, const bool select = true) override
|
||||
{
|
||||
assert(index < items_.size());
|
||||
|
||||
|
@ -637,14 +634,14 @@ public:
|
|||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
bool is_selected(const unsigned index) const
|
||||
bool is_selected(const unsigned index) const override
|
||||
{
|
||||
assert(index < items_.size());
|
||||
return (*items_[index]).selected;
|
||||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void set_item_shown(const unsigned index, const bool show)
|
||||
void set_item_shown(const unsigned index, const bool show) override
|
||||
{
|
||||
assert(index < items_.size());
|
||||
if(items_[index]->shown != show) {
|
||||
|
@ -661,7 +658,7 @@ public:
|
|||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
virtual bool get_item_shown(const unsigned index) const
|
||||
virtual bool get_item_shown(const unsigned index) const override
|
||||
{
|
||||
assert(index < items_.size());
|
||||
return items_[index]->shown;
|
||||
|
@ -669,19 +666,19 @@ public:
|
|||
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
unsigned get_item_count() const
|
||||
unsigned get_item_count() const override
|
||||
{
|
||||
return items_.size();
|
||||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
unsigned get_selected_item_count() const
|
||||
unsigned get_selected_item_count() const override
|
||||
{
|
||||
return selected_item_count_;
|
||||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
int get_selected_item() const
|
||||
int get_selected_item() const override
|
||||
{
|
||||
|
||||
if(selected_item_count_ == 0) {
|
||||
|
@ -703,21 +700,21 @@ public:
|
|||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
tgrid& item(const unsigned index)
|
||||
tgrid& item(const unsigned index) override
|
||||
{
|
||||
assert(index < items_.size());
|
||||
return items_[index]->grid;
|
||||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
const tgrid& item(const unsigned index) const
|
||||
const tgrid& item(const unsigned index) const override
|
||||
{
|
||||
assert(index < items_.size());
|
||||
return items_[index]->grid;
|
||||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
tgrid& item_ordered(const unsigned index)
|
||||
tgrid& item_ordered(const unsigned index) override
|
||||
{
|
||||
calculate_order();
|
||||
assert(index < items_.size());
|
||||
|
@ -725,7 +722,7 @@ public:
|
|||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
const tgrid& item_ordered(const unsigned index) const
|
||||
const tgrid& item_ordered(const unsigned index) const override
|
||||
{
|
||||
calculate_order();
|
||||
assert(index < items_.size());
|
||||
|
@ -737,7 +734,7 @@ public:
|
|||
tgrid& create_item(const int index,
|
||||
tbuilder_grid_const_ptr list_builder,
|
||||
const string_map& item_data,
|
||||
const std::function<void(twidget&)>& callback)
|
||||
const std::function<void(twidget&)>& callback) override
|
||||
{
|
||||
std::map<std::string, string_map> data;
|
||||
|
||||
|
@ -750,7 +747,7 @@ public:
|
|||
const int index,
|
||||
tbuilder_grid_const_ptr list_builder,
|
||||
const std::map<std::string /* widget id */, string_map>& item_data,
|
||||
const std::function<void(twidget&)>& callback)
|
||||
const std::function<void(twidget&)>& callback) override
|
||||
{
|
||||
assert(list_builder);
|
||||
assert(index == -1 || static_cast<unsigned>(index) < items_.size());
|
||||
|
@ -777,7 +774,7 @@ public:
|
|||
tbuilder_grid_const_ptr list_builder,
|
||||
const std::vector<std::map<std::string /*widget id*/, string_map> >&
|
||||
data,
|
||||
const std::function<void(twidget&)>& callback)
|
||||
const std::function<void(twidget&)>& callback) override
|
||||
{
|
||||
impl_create_items(index, list_builder, data, callback);
|
||||
}
|
||||
|
@ -786,7 +783,7 @@ public:
|
|||
virtual void create_items(const int index,
|
||||
tbuilder_grid_const_ptr list_builder,
|
||||
const std::vector<string_map>& data,
|
||||
const std::function<void(twidget&)>& callback)
|
||||
const std::function<void(twidget&)>& callback) override
|
||||
{
|
||||
impl_create_items(index, list_builder, data, callback);
|
||||
}
|
||||
|
@ -915,32 +912,32 @@ public:
|
|||
/***** ***** ***** ***** keyboard functions ***** ***** ***** *****/
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_up_arrow(SDLMod modifier, bool& handled)
|
||||
void handle_key_up_arrow(SDLMod modifier, bool& handled) override
|
||||
{
|
||||
placement::handle_key_up_arrow(modifier, handled);
|
||||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_down_arrow(SDLMod modifier, bool& handled)
|
||||
void handle_key_down_arrow(SDLMod modifier, bool& handled) override
|
||||
{
|
||||
placement::handle_key_down_arrow(modifier, handled);
|
||||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_left_arrow(SDLMod modifier, bool& handled)
|
||||
void handle_key_left_arrow(SDLMod modifier, bool& handled) override
|
||||
{
|
||||
placement::handle_key_left_arrow(modifier, handled);
|
||||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void handle_key_right_arrow(SDLMod modifier, bool& handled)
|
||||
void handle_key_right_arrow(SDLMod modifier, bool& handled) override
|
||||
{
|
||||
placement::handle_key_right_arrow(modifier, handled);
|
||||
}
|
||||
|
||||
protected:
|
||||
/** Inherited from tgenerator_. */
|
||||
void do_select_item(const unsigned index) // fixme rename to impl
|
||||
void do_select_item(const unsigned index) override
|
||||
{
|
||||
assert(index < items_.size());
|
||||
|
||||
|
@ -949,7 +946,7 @@ protected:
|
|||
}
|
||||
|
||||
/** Inherited from tgenerator_. */
|
||||
void do_deselect_item(const unsigned index)
|
||||
void do_deselect_item(const unsigned index) override
|
||||
{
|
||||
assert(index < items_.size());
|
||||
|
||||
|
@ -1029,14 +1026,14 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
virtual unsigned get_ordered_index(unsigned index) const
|
||||
virtual unsigned get_ordered_index(unsigned index) const override
|
||||
{
|
||||
assert(index < items_.size());
|
||||
calculate_order();
|
||||
return items_[index]->ordered_index;
|
||||
}
|
||||
|
||||
virtual unsigned get_item_at_ordered(unsigned index_ordered) const
|
||||
virtual unsigned get_item_at_ordered(unsigned index_ordered) const override
|
||||
{
|
||||
assert(index_ordered < items_.size());
|
||||
calculate_order();
|
||||
|
|
|
@ -35,35 +35,34 @@ public:
|
|||
|
||||
private:
|
||||
/** Inherited from tscrollbar. */
|
||||
unsigned get_length() const
|
||||
unsigned get_length() const override
|
||||
{
|
||||
return get_width();
|
||||
}
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
unsigned minimum_positioner_length() const;
|
||||
unsigned minimum_positioner_length() const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
unsigned maximum_positioner_length() const;
|
||||
unsigned maximum_positioner_length() const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
unsigned offset_before() const;
|
||||
unsigned offset_before() const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
unsigned offset_after() const;
|
||||
unsigned offset_after() const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
bool on_positioner(const tpoint& coordinate) const;
|
||||
bool on_positioner(const tpoint& coordinate) const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
int on_bar(const tpoint& coordinate) const;
|
||||
int on_bar(const tpoint& coordinate) const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
bool in_orthogonal_range(const tpoint& coordinate) const;
|
||||
bool in_orthogonal_range(const tpoint& coordinate) const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
int get_length_difference(const tpoint& original, const tpoint& current)
|
||||
const
|
||||
int get_length_difference(const tpoint& original, const tpoint& current) const override
|
||||
{
|
||||
return current.x - original.x;
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ public:
|
|||
virtual unsigned num_states() const override { return values_.size(); }
|
||||
|
||||
/** Inherited from tselectable_ */
|
||||
virtual void set_callback_state_change(std::function<void(twidget&)> callback)
|
||||
virtual void set_callback_state_change(std::function<void(twidget&)> callback) override
|
||||
{
|
||||
selected_callback_ = callback;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
}
|
||||
|
||||
/** Inherited from ttext_. */
|
||||
virtual void set_value(const std::string& text);
|
||||
virtual void set_value(const std::string& text) override;
|
||||
std::string get_real_value() const
|
||||
{
|
||||
return real_value_;
|
||||
|
@ -48,9 +48,9 @@ public:
|
|||
|
||||
|
||||
protected:
|
||||
void insert_char(const utf8::string& unicode);
|
||||
void paste_selection(const bool mouse);
|
||||
void delete_selection();
|
||||
void insert_char(const utf8::string& unicode) override;
|
||||
void paste_selection(const bool mouse) override;
|
||||
void delete_selection() override;
|
||||
|
||||
// We do not override copy_selection because we
|
||||
// actually want it to copy just the stars
|
||||
|
|
|
@ -63,13 +63,13 @@ public:
|
|||
virtual unsigned get_state() const override;
|
||||
|
||||
/** Inherited from tclickable. */
|
||||
void connect_click_handler(const event::tsignal_function& signal)
|
||||
void connect_click_handler(const event::tsignal_function& signal) override
|
||||
{
|
||||
connect_signal_mouse_left_down(signal);
|
||||
}
|
||||
|
||||
/** Inherited from tclickable. */
|
||||
void disconnect_click_handler(const event::tsignal_function& signal)
|
||||
void disconnect_click_handler(const event::tsignal_function& signal) override
|
||||
{
|
||||
disconnect_signal_mouse_left_down(signal);
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
/** See @ref tcontrol::get_state. */
|
||||
virtual unsigned get_state() const override;
|
||||
|
||||
bool can_wrap() const;
|
||||
bool can_wrap() const override;
|
||||
void set_can_wrap(bool can_wrap);
|
||||
|
||||
private:
|
||||
|
@ -91,7 +91,7 @@ private:
|
|||
tstate state_;
|
||||
bool wrap_on;
|
||||
|
||||
void finalize_subclass();
|
||||
void finalize_subclass() override;
|
||||
|
||||
/***** ***** ***** inherited ****** *****/
|
||||
|
||||
|
|
|
@ -42,28 +42,28 @@ public:
|
|||
/***** ***** ***** ***** Inherited ***** ***** ***** *****/
|
||||
|
||||
/** Inherited from tinteger_selector_. */
|
||||
void set_value(const int value);
|
||||
void set_value(const int value) override;
|
||||
|
||||
/** Inherited from tinteger_selector_. */
|
||||
int get_value() const
|
||||
int get_value() const override
|
||||
{
|
||||
return minimum_value_ + get_item_position() * get_step_size();
|
||||
}
|
||||
|
||||
/** Inherited from tinteger_selector_. */
|
||||
void set_minimum_value(const int minimum_value);
|
||||
void set_minimum_value(const int minimum_value) override;
|
||||
|
||||
/** Inherited from tinteger_selector_. */
|
||||
int get_minimum_value() const
|
||||
int get_minimum_value() const override
|
||||
{
|
||||
return minimum_value_;
|
||||
}
|
||||
|
||||
/** Inherited from tinteger_selector_. */
|
||||
void set_maximum_value(const int maximum_value);
|
||||
void set_maximum_value(const int maximum_value) override;
|
||||
|
||||
/** Inherited from tinteger_selector_. */
|
||||
int get_maximum_value() const
|
||||
int get_maximum_value() const override
|
||||
// The number of items needs to include the begin and end so count - 1.
|
||||
{
|
||||
return minimum_value_ + get_item_count() - 1;
|
||||
|
@ -105,7 +105,7 @@ public:
|
|||
|
||||
protected:
|
||||
/** Inherited from tscrollbar. */
|
||||
void child_callback_positioner_moved();
|
||||
void child_callback_positioner_moved() override;
|
||||
|
||||
private:
|
||||
/** The best size for the slider part itself, if 0 ignored. */
|
||||
|
@ -120,35 +120,34 @@ private:
|
|||
int minimum_value_;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
unsigned get_length() const
|
||||
unsigned get_length() const override
|
||||
{
|
||||
return get_width();
|
||||
}
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
unsigned minimum_positioner_length() const;
|
||||
unsigned minimum_positioner_length() const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
unsigned maximum_positioner_length() const;
|
||||
unsigned maximum_positioner_length() const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
unsigned offset_before() const;
|
||||
unsigned offset_before() const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
unsigned offset_after() const;
|
||||
unsigned offset_after() const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
bool on_positioner(const tpoint& coordinate) const;
|
||||
bool on_positioner(const tpoint& coordinate) const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
int on_bar(const tpoint& coordinate) const;
|
||||
int on_bar(const tpoint& coordinate) const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
bool in_orthogonal_range(const tpoint& coordinate) const;
|
||||
bool in_orthogonal_range(const tpoint& coordinate) const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
int get_length_difference(const tpoint& original, const tpoint& current)
|
||||
const
|
||||
int get_length_difference(const tpoint& original, const tpoint& current) const override
|
||||
{
|
||||
return current.x - original.x;
|
||||
}
|
||||
|
|
|
@ -155,22 +155,22 @@ protected:
|
|||
virtual void update_canvas() override;
|
||||
|
||||
/** Inherited from ttext_. */
|
||||
void goto_end_of_line(const bool select = false)
|
||||
void goto_end_of_line(const bool select = false) override
|
||||
{
|
||||
goto_end_of_data(select);
|
||||
}
|
||||
|
||||
/** Inherited from ttext_. */
|
||||
void goto_start_of_line(const bool select = false)
|
||||
void goto_start_of_line(const bool select = false) override
|
||||
{
|
||||
goto_start_of_data(select);
|
||||
}
|
||||
|
||||
/** Inherited from ttext_. */
|
||||
void delete_char(const bool before_cursor);
|
||||
void delete_char(const bool before_cursor) override;
|
||||
|
||||
/** Inherited from ttext_. */
|
||||
void delete_selection();
|
||||
void delete_selection() override;
|
||||
|
||||
void handle_mouse_selection(tpoint mouse, const bool start_selection);
|
||||
|
||||
|
@ -217,7 +217,7 @@ private:
|
|||
* Shift Ignored.
|
||||
* Alt Ignored.
|
||||
*/
|
||||
void handle_key_up_arrow(SDLMod /*modifier*/, bool& /*handled*/)
|
||||
void handle_key_up_arrow(SDLMod /*modifier*/, bool& /*handled*/) override
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -229,7 +229,7 @@ private:
|
|||
* Shift Ignored.
|
||||
* Alt Ignored.
|
||||
*/
|
||||
void handle_key_down_arrow(SDLMod /*modifier*/, bool& /*handled*/)
|
||||
void handle_key_down_arrow(SDLMod /*modifier*/, bool& /*handled*/) override
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -251,16 +251,16 @@ private:
|
|||
void handle_key_default(bool& handled,
|
||||
SDLKey key,
|
||||
SDLMod modifier,
|
||||
const utf8::string& unicode);
|
||||
const utf8::string& unicode) override;
|
||||
|
||||
/** Inherited from ttext_. */
|
||||
void handle_key_clear_line(SDLMod modifier, bool& handled);
|
||||
void handle_key_clear_line(SDLMod modifier, bool& handled) override;
|
||||
|
||||
/** See @ref tcontrol::get_control_type. */
|
||||
virtual const std::string& get_control_type() const override;
|
||||
|
||||
/** Inherited from tcontrol. */
|
||||
void load_config_extra();
|
||||
void load_config_extra() override;
|
||||
|
||||
/***** ***** ***** signal handlers ***** ****** *****/
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
/***** ***** ***** ***** Inherited ***** ***** ***** *****/
|
||||
|
||||
/** See @ref tcontrol::set_members. */
|
||||
void set_members(const string_map& data);
|
||||
void set_members(const string_map& data) override;
|
||||
|
||||
/** See @ref tcontrol::set_active. */
|
||||
virtual void set_active(const bool active) override;
|
||||
|
@ -49,7 +49,7 @@ public:
|
|||
virtual unsigned get_state() const override;
|
||||
|
||||
/** Inherited from tcontrol. */
|
||||
void update_canvas();
|
||||
void update_canvas() override;
|
||||
|
||||
/** Inherited from tselectable_ */
|
||||
unsigned get_value() const override
|
||||
|
@ -59,14 +59,14 @@ public:
|
|||
/** Inherited from tselectable_ */
|
||||
unsigned num_states() const override;
|
||||
/** Inherited from tselectable_ */
|
||||
void set_value(const unsigned selected);
|
||||
void set_value(const unsigned selected) override;
|
||||
|
||||
/***** ***** ***** setters / getters for members ***** ****** *****/
|
||||
|
||||
void set_retval(const int retval);
|
||||
|
||||
/** Inherited from tselectable_. */
|
||||
void set_callback_state_change(std::function<void(twidget&)> callback)
|
||||
void set_callback_state_change(std::function<void(twidget&)> callback) override
|
||||
{
|
||||
callback_state_change_ = callback;
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ public:
|
|||
}
|
||||
|
||||
/** Inherited from tselectable_ */
|
||||
void set_value(const unsigned selected);
|
||||
void set_value(const unsigned selected) override;
|
||||
|
||||
/** Inherited from tselectable_ */
|
||||
unsigned num_states() const override;
|
||||
|
@ -102,7 +102,7 @@ public:
|
|||
void set_retval(const int retval);
|
||||
|
||||
/** Inherited from tselectable_. */
|
||||
void set_callback_state_change(std::function<void(twidget&)> callback)
|
||||
void set_callback_state_change(std::function<void(twidget&)> callback) override
|
||||
{
|
||||
callback_state_change_ = callback;
|
||||
}
|
||||
|
|
|
@ -99,16 +99,16 @@ public:
|
|||
protected:
|
||||
/***** ***** ***** ***** keyboard functions ***** ***** ***** *****/
|
||||
/** Inherited from tscrollbar_container. */
|
||||
void handle_key_up_arrow(SDLMod modifier, bool& handled);
|
||||
void handle_key_up_arrow(SDLMod modifier, bool& handled) override;
|
||||
|
||||
/** Inherited from tscrollbar_container. */
|
||||
void handle_key_down_arrow(SDLMod modifier, bool& handled);
|
||||
void handle_key_down_arrow(SDLMod modifier, bool& handled) override;
|
||||
|
||||
/** Inherited from tscrollbar_container. */
|
||||
void handle_key_left_arrow(SDLMod modifier, bool& handled);
|
||||
void handle_key_left_arrow(SDLMod modifier, bool& handled) override;
|
||||
|
||||
/** Inherited from tscrollbar_container. */
|
||||
void handle_key_right_arrow(SDLMod modifier, bool& handled);
|
||||
void handle_key_right_arrow(SDLMod modifier, bool& handled) override;
|
||||
private:
|
||||
/**
|
||||
* @todo evaluate which way the dependancy should go.
|
||||
|
|
|
@ -220,7 +220,7 @@ public:
|
|||
ttree_view_node* get_selectable_node_below();
|
||||
void select_node();
|
||||
tgrid& get_grid() { return grid_; }
|
||||
void layout_initialise(const bool full_initialisation);
|
||||
void layout_initialise(const bool full_initialisation) override;
|
||||
private:
|
||||
|
||||
int calculate_ypos();
|
||||
|
|
|
@ -32,35 +32,34 @@ public:
|
|||
|
||||
private:
|
||||
/** Inherited from tscrollbar. */
|
||||
unsigned get_length() const
|
||||
unsigned get_length() const override
|
||||
{
|
||||
return get_height();
|
||||
}
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
unsigned minimum_positioner_length() const;
|
||||
unsigned minimum_positioner_length() const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
unsigned maximum_positioner_length() const;
|
||||
unsigned maximum_positioner_length() const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
unsigned offset_before() const;
|
||||
unsigned offset_before() const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
unsigned offset_after() const;
|
||||
unsigned offset_after() const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
bool on_positioner(const tpoint& coordinate) const;
|
||||
bool on_positioner(const tpoint& coordinate) const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
int on_bar(const tpoint& coordinate) const;
|
||||
int on_bar(const tpoint& coordinate) const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
bool in_orthogonal_range(const tpoint& coordinate) const;
|
||||
bool in_orthogonal_range(const tpoint& coordinate) const override;
|
||||
|
||||
/** Inherited from tscrollbar. */
|
||||
int get_length_difference(const tpoint& original, const tpoint& current)
|
||||
const
|
||||
int get_length_difference(const tpoint& original, const tpoint& current) const override
|
||||
{
|
||||
return current.y - original.y;
|
||||
}
|
||||
|
|
|
@ -27,14 +27,14 @@ class help_button : public gui::dialog_button, public hotkey::command_executor {
|
|||
public:
|
||||
help_button(CVideo& video, const std::string &help_topic);
|
||||
~help_button();
|
||||
int action(gui::dialog_process_info &info);
|
||||
int action(gui::dialog_process_info &info) override;
|
||||
std::string topic() const { return topic_; }
|
||||
void join();
|
||||
void leave();
|
||||
void join() override;
|
||||
void leave() override;
|
||||
CVideo& get_video() override { return video_; }
|
||||
private:
|
||||
void show_help();
|
||||
bool can_execute_command(const hotkey::hotkey_command& command, int/*index*/ =-1) const;
|
||||
void show_help() override;
|
||||
bool can_execute_command(const hotkey::hotkey_command& command, int/*index*/ =-1) const override;
|
||||
|
||||
CVideo &video_;
|
||||
const std::string topic_;
|
||||
|
|
|
@ -36,7 +36,7 @@ class team;
|
|||
class play_controller::hotkey_handler : public hotkey::command_executor_default {
|
||||
|
||||
protected:
|
||||
display& get_display() { return play_controller_.get_display(); }
|
||||
display& get_display() override { return play_controller_.get_display(); }
|
||||
|
||||
/** References to parent object / constituents */
|
||||
play_controller & play_controller_;
|
||||
|
@ -83,49 +83,49 @@ public:
|
|||
static const std::string wml_menu_hotkey_prefix;
|
||||
|
||||
//event handlers, overridden from command_executor
|
||||
virtual void objectives();
|
||||
virtual void show_statistics();
|
||||
virtual void unit_list();
|
||||
virtual void left_mouse_click();
|
||||
virtual void move_action();
|
||||
virtual void select_and_action();
|
||||
virtual void select_hex();
|
||||
virtual void deselect_hex();
|
||||
virtual void right_mouse_click();
|
||||
virtual void status_table();
|
||||
virtual void save_game();
|
||||
virtual void save_replay();
|
||||
virtual void save_map();
|
||||
virtual void load_game();
|
||||
virtual void preferences();
|
||||
virtual void show_chat_log();
|
||||
virtual void show_help();
|
||||
virtual void cycle_units();
|
||||
virtual void cycle_back_units();
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
virtual void show_enemy_moves(bool ignore_units);
|
||||
virtual void goto_leader();
|
||||
virtual void unit_description();
|
||||
virtual void terrain_description();
|
||||
virtual void toggle_ellipses();
|
||||
virtual void toggle_grid();
|
||||
virtual void search();
|
||||
virtual void toggle_accelerated_speed();
|
||||
virtual void scroll_up(bool on);
|
||||
virtual void scroll_down(bool on);
|
||||
virtual void scroll_left(bool on);
|
||||
virtual void scroll_right(bool on);
|
||||
virtual void objectives() override;
|
||||
virtual void show_statistics() override;
|
||||
virtual void unit_list() override;
|
||||
virtual void left_mouse_click() override;
|
||||
virtual void move_action() override;
|
||||
virtual void select_and_action() override;
|
||||
virtual void select_hex() override;
|
||||
virtual void deselect_hex() override;
|
||||
virtual void right_mouse_click() override;
|
||||
virtual void status_table() override;
|
||||
virtual void save_game() override;
|
||||
virtual void save_replay() override;
|
||||
virtual void save_map() override;
|
||||
virtual void load_game() override;
|
||||
virtual void preferences() override;
|
||||
virtual void show_chat_log() override;
|
||||
virtual void show_help() override;
|
||||
virtual void cycle_units() override;
|
||||
virtual void cycle_back_units() override;
|
||||
virtual void undo() override;
|
||||
virtual void redo() override;
|
||||
virtual void show_enemy_moves(bool ignore_units) override;
|
||||
virtual void goto_leader() override;
|
||||
virtual void unit_description() override;
|
||||
virtual void terrain_description() override;
|
||||
virtual void toggle_ellipses() override;
|
||||
virtual void toggle_grid() override;
|
||||
virtual void search() override;
|
||||
virtual void toggle_accelerated_speed() override;
|
||||
virtual void scroll_up(bool on) override;
|
||||
virtual void scroll_down(bool on) override;
|
||||
virtual void scroll_left(bool on) override;
|
||||
virtual void scroll_right(bool on) override;
|
||||
virtual void replay_skip_animation() override
|
||||
{ return play_controller_.toggle_skipping_replay(); }
|
||||
|
||||
virtual std::string get_action_image(hotkey::HOTKEY_COMMAND, int index) const;
|
||||
virtual std::string get_action_image(hotkey::HOTKEY_COMMAND, int index) const override;
|
||||
virtual void load_autosave(const std::string& filename);
|
||||
virtual hotkey::ACTION_STATE get_action_state(hotkey::HOTKEY_COMMAND command, int index) const;
|
||||
virtual hotkey::ACTION_STATE get_action_state(hotkey::HOTKEY_COMMAND command, int index) const override;
|
||||
/** Check if a command can be executed. */
|
||||
virtual bool can_execute_command(const hotkey::hotkey_command& command, int index=-1) const;
|
||||
virtual bool execute_command(const hotkey::hotkey_command& command, int index=-1, bool press=true);
|
||||
void show_menu(const std::vector<std::string>& items_arg, int xloc, int yloc, bool context_menu, display& disp);
|
||||
virtual bool can_execute_command(const hotkey::hotkey_command& command, int index=-1) const override;
|
||||
virtual bool execute_command(const hotkey::hotkey_command& command, int index=-1, bool press=true) override;
|
||||
void show_menu(const std::vector<std::string>& items_arg, int xloc, int yloc, bool context_menu, display& disp) override;
|
||||
|
||||
/**
|
||||
* Determines whether the command should be in the context menu or not.
|
||||
|
|
|
@ -33,12 +33,12 @@ public:
|
|||
hotkey_handler(playmp_controller &, saved_game &);
|
||||
~hotkey_handler();
|
||||
|
||||
virtual void speak();
|
||||
virtual void whisper();
|
||||
virtual void shout();
|
||||
virtual void start_network();
|
||||
virtual void stop_network();
|
||||
virtual bool can_execute_command(const hotkey::hotkey_command& command, int index=-1) const;
|
||||
virtual void speak() override;
|
||||
virtual void whisper() override;
|
||||
virtual void shout() override;
|
||||
virtual void start_network() override;
|
||||
virtual void stop_network() override;
|
||||
virtual bool can_execute_command(const hotkey::hotkey_command& command, int index=-1) const override;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -38,35 +38,35 @@ public:
|
|||
hotkey_handler(playsingle_controller &, saved_game &);
|
||||
~hotkey_handler();
|
||||
|
||||
virtual void recruit();
|
||||
virtual void repeat_recruit();
|
||||
virtual void recall();
|
||||
virtual bool can_execute_command(const hotkey::hotkey_command& command, int index=-1) const;
|
||||
virtual void toggle_shroud_updates();
|
||||
virtual void update_shroud_now();
|
||||
virtual void end_turn();
|
||||
virtual void rename_unit();
|
||||
virtual void create_unit();
|
||||
virtual void change_side();
|
||||
virtual void kill_unit();
|
||||
virtual void label_terrain(bool);
|
||||
virtual void clear_labels();
|
||||
virtual void label_settings();
|
||||
virtual void continue_move();
|
||||
virtual void unit_hold_position();
|
||||
virtual void end_unit_turn();
|
||||
virtual void user_command();
|
||||
virtual void custom_command();
|
||||
virtual void ai_formula();
|
||||
virtual void clear_messages();
|
||||
virtual void recruit() override;
|
||||
virtual void repeat_recruit() override;
|
||||
virtual void recall() override;
|
||||
virtual bool can_execute_command(const hotkey::hotkey_command& command, int index=-1) const override;
|
||||
virtual void toggle_shroud_updates() override;
|
||||
virtual void update_shroud_now() override;
|
||||
virtual void end_turn() override;
|
||||
virtual void rename_unit() override;
|
||||
virtual void create_unit() override;
|
||||
virtual void change_side() override;
|
||||
virtual void kill_unit() override;
|
||||
virtual void label_terrain(bool) override;
|
||||
virtual void clear_labels() override;
|
||||
virtual void label_settings() override;
|
||||
virtual void continue_move() override;
|
||||
virtual void unit_hold_position() override;
|
||||
virtual void end_unit_turn() override;
|
||||
virtual void user_command() override;
|
||||
virtual void custom_command() override;
|
||||
virtual void ai_formula() override;
|
||||
virtual void clear_messages() override;
|
||||
// Whiteboard hotkeys
|
||||
virtual void whiteboard_toggle();
|
||||
virtual void whiteboard_execute_action();
|
||||
virtual void whiteboard_execute_all_actions();
|
||||
virtual void whiteboard_delete_action();
|
||||
virtual void whiteboard_bump_up_action();
|
||||
virtual void whiteboard_bump_down_action();
|
||||
virtual void whiteboard_suppose_dead();
|
||||
virtual void whiteboard_toggle() override;
|
||||
virtual void whiteboard_execute_action() override;
|
||||
virtual void whiteboard_execute_all_actions() override;
|
||||
virtual void whiteboard_delete_action() override;
|
||||
virtual void whiteboard_bump_up_action() override;
|
||||
virtual void whiteboard_bump_down_action() override;
|
||||
virtual void whiteboard_suppose_dead() override;
|
||||
|
||||
//replay
|
||||
replay_controller& get_replay_controller()
|
||||
|
@ -93,8 +93,8 @@ public:
|
|||
virtual void reset_replay() override
|
||||
{ return playsingle_controller_.reset_replay(); }
|
||||
virtual void replay_exit() override;
|
||||
virtual void load_autosave(const std::string& filename);
|
||||
virtual hotkey::ACTION_STATE get_action_state(hotkey::HOTKEY_COMMAND command, int index) const;
|
||||
virtual void load_autosave(const std::string& filename) override;
|
||||
virtual hotkey::ACTION_STATE get_action_state(hotkey::HOTKEY_COMMAND command, int index) const override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -30,11 +30,11 @@ public:
|
|||
mp_campaign_info* mp_info);
|
||||
virtual ~playmp_controller();
|
||||
|
||||
void maybe_linger();
|
||||
void process_oos(const std::string& err_msg) const;
|
||||
void maybe_linger() override;
|
||||
void process_oos(const std::string& err_msg) const override;
|
||||
|
||||
void pull_remote_choice();
|
||||
void send_user_choice();
|
||||
void pull_remote_choice() override;
|
||||
void send_user_choice() override;
|
||||
|
||||
class hotkey_handler;
|
||||
|
||||
|
@ -42,18 +42,18 @@ public:
|
|||
void send_to_wesnothd(const config& cfg, const std::string& packet_type = "unknown") const override;
|
||||
bool recieve_from_wesnothd(config& cfg) const override;
|
||||
protected:
|
||||
virtual void handle_generic_event(const std::string& name);
|
||||
virtual void handle_generic_event(const std::string& name) override;
|
||||
|
||||
void start_network();
|
||||
void stop_network();
|
||||
|
||||
virtual void play_side_impl();
|
||||
virtual void play_human_turn();
|
||||
virtual void play_side_impl() override;
|
||||
virtual void play_human_turn() override;
|
||||
virtual void play_linger_turn();
|
||||
virtual void after_human_turn();
|
||||
virtual void play_network_turn();
|
||||
virtual void do_idle_notification();
|
||||
virtual void play_idle_loop();
|
||||
virtual void after_human_turn() override;
|
||||
virtual void play_network_turn() override;
|
||||
virtual void do_idle_notification() override;
|
||||
virtual void play_idle_loop() override;
|
||||
|
||||
void linger();
|
||||
/** Wait for the host to upload the next scenario. */
|
||||
|
@ -61,7 +61,7 @@ protected:
|
|||
|
||||
mutable bool network_processing_stopped_;
|
||||
|
||||
virtual void on_not_observer();
|
||||
virtual void on_not_observer() override;
|
||||
bool is_host() const;
|
||||
void remove_blindfold();
|
||||
|
||||
|
|
|
@ -45,27 +45,27 @@ public:
|
|||
void play_scenario_init();
|
||||
void play_scenario_main_loop();
|
||||
|
||||
virtual void handle_generic_event(const std::string& name);
|
||||
virtual void handle_generic_event(const std::string& name) override;
|
||||
|
||||
virtual void check_objectives();
|
||||
virtual void on_not_observer() {}
|
||||
virtual void check_objectives() override;
|
||||
virtual void on_not_observer() override {}
|
||||
virtual void maybe_linger();
|
||||
|
||||
void end_turn();
|
||||
void force_end_turn();
|
||||
void force_end_turn() override;
|
||||
|
||||
class hotkey_handler;
|
||||
std::string describe_result() const;
|
||||
|
||||
bool get_player_type_changed() const { return player_type_changed_; }
|
||||
void set_player_type_changed() { player_type_changed_ = true; }
|
||||
virtual bool should_return_to_play_side();
|
||||
virtual bool should_return_to_play_side() override;
|
||||
replay_controller * get_replay_controller() { return replay_.get(); }
|
||||
bool is_replay() { return get_replay_controller() != nullptr; }
|
||||
bool is_replay() override { return get_replay_controller() != nullptr; }
|
||||
void enable_replay(bool is_unit_test = false);
|
||||
void on_replay_end(bool is_unit_test);
|
||||
protected:
|
||||
virtual void play_side_impl();
|
||||
virtual void play_side_impl() override;
|
||||
void before_human_turn();
|
||||
void show_turn_dialog();
|
||||
void execute_gotos();
|
||||
|
@ -76,7 +76,7 @@ protected:
|
|||
virtual void play_idle_loop();
|
||||
virtual void do_idle_notification();
|
||||
virtual void play_network_turn();
|
||||
virtual void init_gui();
|
||||
virtual void init_gui() override;
|
||||
void store_recalls();
|
||||
void store_gold(bool obs = false);
|
||||
|
||||
|
@ -99,8 +99,8 @@ protected:
|
|||
bool skip_next_turn_;
|
||||
std::unique_ptr<replay_controller> replay_;
|
||||
void linger();
|
||||
void sync_end_turn();
|
||||
void update_viewing_player();
|
||||
void sync_end_turn() override;
|
||||
void update_viewing_player() override;
|
||||
void reset_replay();
|
||||
};
|
||||
|
||||
|
|
|
@ -2581,7 +2581,7 @@ namespace
|
|||
, desc(descr)
|
||||
{}
|
||||
|
||||
virtual config query_user(int side) const
|
||||
virtual config query_user(int side) const override
|
||||
{
|
||||
bool is_local_ai = lua_kernel_base::get_lua_kernel<game_lua_kernel>(L).teams()[side - 1].is_local_ai();
|
||||
config cfg;
|
||||
|
@ -2589,7 +2589,7 @@ namespace
|
|||
return cfg;
|
||||
}
|
||||
|
||||
virtual config random_choice(int side) const
|
||||
virtual config random_choice(int side) const override
|
||||
{
|
||||
config cfg;
|
||||
if(random_choice_index != 0 && lua_isfunction(L, random_choice_index)) {
|
||||
|
@ -2617,7 +2617,7 @@ namespace
|
|||
//Although luas sync_choice can show a dialog, (and will in most cases)
|
||||
//we return false to enable other possible things that do not contain UI things.
|
||||
//it's in the responsibility of the umc dev to not show dialogs during prestart events.
|
||||
virtual bool is_visible() const { return false; }
|
||||
virtual bool is_visible() const override { return false; }
|
||||
};
|
||||
}//unnamed namespace for lua_synchronize
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue