31 , std::size_t item_size, std::size_t item_width,
editor_toolkit &toolkit)
72 virtual void draw()
override {
110 virtual const std::string&
get_id(
const Item& item) = 0;
127 widget::hide(hidden);
143 virtual void set_group(
const std::string&
id);
std::string selected_fg_item_
std::vector< events::sdl_handler * > sdl_handler_vector
virtual sdl_handler_vector handler_members() override
virtual void select_fg_item(const std::string &item_id) override
Select a foreground item.
virtual void select_bg_item(const std::string &item_id) override
int num_visible_items()
Return the number of items in the palette.
std::size_t active_group_index()
void set_start_item(std::size_t index) override
virtual bool scroll_down() override
Scroll the editor-palette down one step if possible.
void set_group(std::size_t index) override
virtual bool scroll_up() override
Scroll the editor-palette up one step if possible.
virtual bool is_selected_bg_item(const std::string &id)
const std::vector< std::string > & active_group()
const std::vector< std::string > items
virtual bool can_scroll_up() override
void expand_palette_groups_menu(std::vector< config > &items, int i) override
Menu expanding for palette group list.
std::map< std::string, Item > item_map
virtual bool is_selected_fg_item(const std::string &id)
std::size_t start_num(void) override
virtual void setup(const game_config_view &cfg)=0
Setup the internal data structure.
int num_items() override
Return the number of items in the palette.
virtual void draw_item(const Item &item, surface &item_image, std::stringstream &tooltip)=0
std::map< std::string, std::vector< std::string > > group_map_
virtual bool can_scroll_down() override
const std::vector< item_group > & get_groups() const override
Manage the empty-palette in the editor.
editor_toolkit & toolkit_
std::vector< gui::tristate_button > buttons_
const Item & selected_bg_item() const
std::size_t index(const std::string &str, const std::size_t index)
Codepoint index corresponding to the nth character in a UTF-8 string.
void next_group() override
int set_help_string(const std::string &str)
Displays a help string with the given text.
std::set< std::string > non_core_items_
virtual void draw_contents() override
virtual std::string get_help_string()=0
void adjust_size(const SDL_Rect &target) override
Update the size of this widget.
editor_palette(editor_display &gui, const game_config_view &, std::size_t item_size, std::size_t item_width, editor_toolkit &toolkit)
const Item & selected_fg_item() const
Return the currently selected foreground/background item.
virtual const std::string & get_id(const Item &item)=0
CVideo & video()
Gets the underlying screen object.
std::string active_group_
virtual void draw() override
void hide(bool hidden) override
void prev_group() override
std::vector< item_group > groups_
The editor_groups as defined in editor-groups.cfg.
virtual const std::string & active_group_id()
std::string selected_bg_item_
void clear_help_string(int handle)
Removes the help string with the given handle.
std::pair< std::string, unsigned > item