15 #define GETTEXT_DOMAIN "wesnoth-editor" 18 #include "widgets/widget.hpp" 27 : gui::widget(gui.video()),
117 while (old_start != items_start) {
118 old_start = items_start;
135 upscroll_button->hide(
false);
137 if (downscroll_button)
138 downscroll_button->hide(
false);
139 std::shared_ptr<gui::button> palette_menu_button =
gui_.
find_menu_button(
"menu-editor-terrain");
140 if (palette_menu_button)
141 palette_menu_button->hide(
false);
165 if (event.type == SDL_MOUSEMOTION) {
173 if (!
focus(&event)) {
177 const SDL_MouseButtonEvent &mouse_button_event =
event.button;
180 if (event.type == SDL_MOUSEWHEEL) {
181 if (event.wheel.y > 0) {
183 }
else if (event.wheel.y < 0) {
187 if (event.wheel.x < 0) {
190 }
else if (event.wheel.x > 0) {
196 if (mouse_button_event.type == SDL_MOUSEBUTTONUP) {
std::shared_ptr< gui::button > find_action_button(const std::string &id)
Retrieves a pointer to a theme UI button.
const std::unique_ptr< unit_palette > unit_palette_
std::vector< events::sdl_handler * > sdl_handler_vector
virtual void prev_group()=0
common_palette & active_palette()
void set_group(std::size_t index)
virtual bool can_scroll_down()=0
Palette where the terrain to be drawn can be selected.
virtual void handle_event(const SDL_Event &event)
virtual void next_group()=0
editor_toolkit & toolkit_
void draw_contents()
Draw the palette.
virtual bool scroll_up()=0
Scroll the editor-palette up one step if possible.
virtual bool can_scroll_up()=0
virtual int num_items()=0
virtual void set_group(std::size_t index)=0
const SDL_Rect & palette_area() const
sdl_handler_vector handler_members()
virtual std::size_t start_num()=0
Manage the empty-palette in the editor.
const std::unique_ptr< item_palette > item_palette_
bool point_in_rect(int x, int y, const SDL_Rect &rect)
Tests whether a point is inside a rectangle.
void scroll_down()
Scroll the editor-palette down one step if possible.
virtual sdl_handler_vector handler_members()
virtual void adjust_size(const SDL_Rect &target)=0
void scroll_up()
Scroll the editor-palette up one step if possible.
Palette where the terrain to be drawn can be selected.
Palette where the terrain to be drawn can be selected.
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.
virtual bool scroll_down()=0
Scroll the editor-palette down one step if possible.
const std::unique_ptr< terrain_palette > terrain_palette_
virtual void set_start_item(std::size_t index)=0
void restore_palette_bg(bool scroll_top)
palette_manager(editor_display &gui, const game_config_view &cfg, editor_toolkit &toolkit)
std::shared_ptr< gui::button > find_menu_button(const std::string &id)