#include <location_palette.hpp>
Public Member Functions | |
location_palette (editor_display &gui, const config &, mouse_action **active_mouse_action) | |
virtual sdl_handler_vector | handler_members () |
void | set_start_item (size_t index) |
size_t | start_num (void) |
void | expand_palette_groups_menu (std::vector< std::pair< std::string, std::string > > &) override |
Menu expanding for palette group list. More... | |
void | expand_palette_groups_menu (std::vector< std::string > &) override |
Menu expanding for palette group list. More... | |
virtual void | set_group (size_t) override |
virtual void | next_group () override |
virtual void | prev_group () override |
virtual const std::vector < item_group > & | get_groups () const override |
virtual void | draw () |
virtual void | draw_contents () |
void | adjust_size (const SDL_Rect &target) |
Update the size of this widget. More... | |
virtual bool | scroll_up () |
Scroll the editor-palette up one step if possible. More... | |
virtual bool | can_scroll_up () |
virtual bool | scroll_down () |
Scroll the editor-palette down one step if possible. More... | |
virtual bool | can_scroll_down () |
void | swap () override |
bool | can_swap () |
virtual std::string | get_help_string () |
const std::string & | selected_item () const |
Return the currently selected item. More... | |
virtual void | select_item (const std::string &item_id) |
virtual std::vector< std::string > | action_pressed () const override |
void | add_item (const std::string &id) |
~location_palette () | |
void | hide (bool hidden) override |
Public Member Functions inherited from editor::common_palette | |
common_palette (display &gui) | |
virtual | ~common_palette () |
virtual bool | supports_swap () |
Public Member Functions inherited from gui::widget | |
SDL_Rect const & | location () const |
virtual void | set_location (SDL_Rect const &rect) |
void | set_location (int x, int y) |
void | set_width (int w) |
void | set_height (int h) |
void | set_measurements (int w, int h) |
int | width () const |
int | height () const |
bool | focus (const SDL_Event *event) |
void | set_focus (bool focus) |
bool | hidden () const |
virtual void | enable (bool new_val=true) |
bool | enabled () const |
void | set_clip_rect (const SDL_Rect &rect) |
void | set_volatile (bool val=true) |
void | set_dirty (bool dirty=true) |
bool | dirty () const |
const std::string & | id () const |
void | set_id (const std::string &id) |
void | set_help_string (const std::string &str) |
void | set_tooltip_string (const std::string &str) |
virtual void | process_help_string (int mousex, int mousey) |
virtual void | process_tooltip_string (int mousex, int mousey) |
Public Member Functions inherited from events::sdl_handler | |
virtual void | process_event () |
virtual bool | requires_event_focus (const SDL_Event *=nullptr) const |
virtual void | join () |
virtual void | join (context &c) |
virtual void | join_same (sdl_handler *parent) |
virtual void | leave () |
virtual void | join_global () |
virtual void | leave_global () |
Protected Attributes | |
editor_display & | gui_ |
int | item_size_ |
int | item_space_ |
int | items_start_ |
Protected Attributes inherited from gui::widget | |
bool | focus_ |
Private Member Functions | |
void | scroll_top () |
Scroll the editor-palette to the top. More... | |
void | scroll_bottom () |
Scroll the editor-palette to the bottom. More... | |
virtual bool | is_selected_item (const std::string &id) |
int | num_items () |
Return the number of items in the palette. More... | |
int | num_visible_items () |
Return the maximum number of items shown at the same time. More... | |
Private Attributes | |
unsigned int | palette_y_ |
unsigned int | palette_x_ |
std::string | selected_item_ |
std::vector< std::string > | items_ |
mouse_action ** | active_mouse_action_ |
boost::ptr_vector < location_palette_item > | buttons_ |
std::unique_ptr < location_palette_button > | button_add_ |
std::unique_ptr < location_palette_button > | button_delete_ |
std::unique_ptr < location_palette_button > | button_goto_ |
int | help_handle_ |
editor_display & | disp_ |
Additional Inherited Members | |
Protected Member Functions inherited from gui::widget | |
widget (widget const &o) | |
widget (CVideo &video, const bool auto_join=true) | |
virtual | ~widget () |
void | bg_register (SDL_Rect const &rect) |
void | bg_restore () const |
void | bg_restore (SDL_Rect const &rect) const |
void | bg_update () |
void | bg_cancel () |
CVideo & | video () const |
virtual void | update_location (SDL_Rect const &rect) |
const SDL_Rect * | clip_rect () const |
virtual sdl_handler_vector | member_handlers () |
virtual void | handle_event (SDL_Event const &) |
virtual void | handle_window_event (SDL_Event const &event) |
bool | mouse_locked () const |
void | aquire_mouse_lock () |
void | free_mouse_lock () |
Protected Member Functions inherited from events::sdl_handler | |
sdl_handler (const bool auto_join=true) | |
virtual | ~sdl_handler () |
Definition at line 26 of file location_palette.hpp.
editor::location_palette::location_palette | ( | editor_display & | gui, |
const config & | , | ||
mouse_action ** | active_mouse_action | ||
) |
Definition at line 153 of file location_palette.cpp.
References i, items_, and selected_item_.
editor::location_palette::~location_palette | ( | ) |
Definition at line 371 of file location_palette.cpp.
|
overridevirtual |
Reimplemented from editor::common_palette.
Definition at line 362 of file location_palette.cpp.
References button_delete_.
void editor::location_palette::add_item | ( | const std::string & | id | ) |
Definition at line 375 of file location_palette.cpp.
References adjust_size(), gui2::event::find(), gui::widget::id(), items_, items_start_, itor, gui::widget::location(), num_visible_items(), pos, and selected_item_.
Referenced by adjust_size(), and editor::mouse_action_starting_position::up_left().
|
virtual |
Update the size of this widget.
Use if the size_specs have changed.
Implements editor::common_palette.
Definition at line 238 of file location_palette.cpp.
References _(), add_item(), button_add_, button_delete_, button_goto_, buttons_, CVideo::clear_help_string(), disp_, gui2::tedit_text::execute(), get_help_string(), display::get_map(), gui_, help_handle_, item_space_, num_visible_items(), palette_x_, palette_y_, pos, display::scroll_to_tile(), selected_item_, gui::widget::set_dirty(), CVideo::set_help_string(), gui::widget::set_location(), gamemap::special_location(), map_location::valid(), gui::widget::video(), display::video(), and display::WARP.
Referenced by add_item().
|
virtual |
Implements editor::common_palette.
Definition at line 218 of file location_palette.cpp.
References items_start_, num_items(), and num_visible_items().
|
virtual |
Implements editor::common_palette.
Definition at line 213 of file location_palette.cpp.
References items_start_.
|
inline |
Definition at line 66 of file location_palette.hpp.
|
inlinevirtual |
Implements editor::common_palette.
Definition at line 48 of file location_palette.hpp.
References cursor::draw().
Referenced by scroll_down(), and scroll_up().
|
virtual |
Reimplemented from gui::widget.
Definition at line 303 of file location_palette.cpp.
References active_mouse_action_, button_add_, button_delete_, button_goto_, buttons_, location_palette_item::draw(), display::find_action_button(), gui_, gui::widget::hide(), i, is_selected_item(), item_size_, item_space_, items_, items_start_, gui::widget::location(), num_items(), num_visible_items(), palette_x_, palette_y_, gui::widget::set_dirty(), location_palette_item::set_item_id(), gui::widget::set_location(), location_palette_item::set_selected(), gui::widget::set_tooltip_string(), and update_rect().
|
inlineoverridevirtual |
Menu expanding for palette group list.
Implements editor::common_palette.
Definition at line 40 of file location_palette.hpp.
|
inlineoverridevirtual |
Menu expanding for palette group list.
Implements editor::common_palette.
Definition at line 41 of file location_palette.hpp.
|
inlineoverridevirtual |
Implements editor::common_palette.
Definition at line 46 of file location_palette.hpp.
|
inlinevirtual |
Definition at line 68 of file location_palette.hpp.
Referenced by adjust_size(), hide(), and select_item().
|
virtual |
Reimplemented from editor::common_palette.
Definition at line 178 of file location_palette.cpp.
References button_add_, button_delete_, button_goto_, buttons_, and h.
Referenced by hide().
|
overridevirtual |
Reimplemented from gui::widget.
Definition at line 190 of file location_palette.cpp.
References CVideo::clear_help_string(), get_help_string(), gui_, handler_members(), help_handle_, gui::widget::hide(), CVideo::set_help_string(), and display::video().
|
privatevirtual |
Definition at line 298 of file location_palette.cpp.
References gui::widget::id(), and selected_item_.
Referenced by draw_contents().
|
inlineoverridevirtual |
Implements editor::common_palette.
Definition at line 44 of file location_palette.hpp.
|
privatevirtual |
Return the number of items in the palette.
Implements editor::common_palette.
Definition at line 289 of file location_palette.cpp.
References items_.
Referenced by can_scroll_down(), draw_contents(), and scroll_down().
|
private |
Return the maximum number of items shown at the same time.
Definition at line 293 of file location_palette.cpp.
References buttons_.
Referenced by add_item(), adjust_size(), can_scroll_down(), draw_contents(), and scroll_down().
|
inlineoverridevirtual |
Implements editor::common_palette.
Definition at line 45 of file location_palette.hpp.
|
private |
Scroll the editor-palette to the bottom.
|
virtual |
Scroll the editor-palette down one step if possible.
Implements editor::common_palette.
Definition at line 223 of file location_palette.cpp.
References draw(), items_start_, num_items(), num_visible_items(), and gui::widget::set_dirty().
|
private |
Scroll the editor-palette to the top.
|
virtual |
Scroll the editor-palette up one step if possible.
Implements editor::common_palette.
Definition at line 203 of file location_palette.cpp.
References draw(), and items_start_.
|
virtual |
Definition at line 279 of file location_palette.cpp.
References CVideo::clear_help_string(), get_help_string(), gui_, help_handle_, selected_item_, gui::widget::set_dirty(), CVideo::set_help_string(), and display::video().
Referenced by location_palette_item::mouse_up().
|
inline |
Return the currently selected item.
Definition at line 71 of file location_palette.hpp.
References selected_item_.
Referenced by editor::editor_controller::execute_command(), and editor::mouse_action_starting_position::up_left().
|
inlineoverridevirtual |
Implements editor::common_palette.
Definition at line 43 of file location_palette.hpp.
|
inlinevirtual |
Implements editor::common_palette.
Definition at line 35 of file location_palette.hpp.
References items_start_.
|
inlinevirtual |
Implements editor::common_palette.
Definition at line 37 of file location_palette.hpp.
References items_start_.
|
inlineoverridevirtual |
Implements editor::common_palette.
Definition at line 65 of file location_palette.hpp.
|
private |
Definition at line 112 of file location_palette.hpp.
Referenced by draw_contents().
|
private |
Definition at line 114 of file location_palette.hpp.
Referenced by adjust_size(), draw_contents(), and handler_members().
|
private |
Definition at line 115 of file location_palette.hpp.
Referenced by action_pressed(), adjust_size(), draw_contents(), and handler_members().
|
private |
Definition at line 116 of file location_palette.hpp.
Referenced by adjust_size(), draw_contents(), and handler_members().
|
private |
Definition at line 113 of file location_palette.hpp.
Referenced by adjust_size(), draw_contents(), handler_members(), and num_visible_items().
|
private |
Definition at line 118 of file location_palette.hpp.
Referenced by adjust_size().
|
protected |
Definition at line 95 of file location_palette.hpp.
Referenced by adjust_size(), draw_contents(), hide(), and select_item().
|
private |
Definition at line 117 of file location_palette.hpp.
Referenced by adjust_size(), hide(), and select_item().
|
protected |
Definition at line 97 of file location_palette.hpp.
Referenced by draw_contents().
|
protected |
Definition at line 99 of file location_palette.hpp.
Referenced by adjust_size(), and draw_contents().
|
private |
Definition at line 111 of file location_palette.hpp.
Referenced by add_item(), draw_contents(), location_palette(), and num_items().
|
protected |
Definition at line 107 of file location_palette.hpp.
Referenced by add_item(), can_scroll_down(), can_scroll_up(), draw_contents(), scroll_down(), scroll_up(), set_start_item(), and start_num().
|
private |
Definition at line 103 of file location_palette.hpp.
Referenced by adjust_size(), and draw_contents().
|
private |
Definition at line 102 of file location_palette.hpp.
Referenced by adjust_size(), and draw_contents().
|
private |
Definition at line 110 of file location_palette.hpp.
Referenced by add_item(), adjust_size(), is_selected_item(), location_palette(), select_item(), and selected_item().