16 #define GETTEXT_DOMAIN "wesnoth-editor"
19 #include "widgets/widget.hpp"
104 upscroll_button->hide(
false);
106 if (downscroll_button)
107 downscroll_button->hide(
false);
108 std::shared_ptr<gui::button> palette_menu_button =
gui_.
find_menu_button(
"menu-editor-terrain");
109 if (palette_menu_button)
110 palette_menu_button->hide(
false);
138 if (event.type == SDL_MOUSEMOTION) {
141 if (!
focus(&event)) {
146 else if (
focus(&event)) {
150 if (!
focus(&event)) {
154 const SDL_MouseButtonEvent &mouse_button_event =
event.button;
157 if (event.type == SDL_MOUSEWHEEL) {
158 if (event.wheel.y > 0) {
160 }
else if (event.wheel.y < 0) {
164 if (event.wheel.x < 0) {
167 }
else if (event.wheel.x > 0) {
173 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.
std::shared_ptr< gui::button > find_menu_button(const std::string &id)
const rect & palette_area() const
virtual void set_start_item(std::size_t index)=0
virtual bool scroll_down()=0
Scroll the editor-palette down one step if possible.
virtual void set_group(std::size_t index)=0
virtual void next_group()=0
virtual bool scroll_up()=0
Scroll the editor-palette up one step if possible.
virtual bool can_scroll_down()=0
virtual bool can_scroll_up()=0
virtual void prev_group()=0
virtual void adjust_size(const SDL_Rect &target)=0
virtual sdl_handler_vector handler_members()
Palette where the terrain to be drawn can be selected.
List of starting locations and location ids.
void scroll_up()
Scroll the editor-palette up one step if possible.
const std::unique_ptr< item_palette > item_palette_
sdl_handler_vector handler_members() override
void scroll_down()
Scroll the editor-palette down one step if possible.
void draw_contents() override
Draw the palette.
void set_group(std::size_t index)
const std::unique_ptr< terrain_palette > terrain_palette_
palette_manager(editor_display &gui, const game_config_view &cfg, editor_toolkit &toolkit)
const std::unique_ptr< unit_palette > unit_palette_
editor_toolkit & toolkit_
virtual void layout() override
Called by draw_manager to validate layout before drawing.
common_palette & active_palette()
virtual void handle_event(const SDL_Event &event) override
Palette where the terrain to be drawn can be selected.
Palette where the terrain to be drawn can be selected.
A class grating read only view to a vector of config objects, viewed as one config with all children ...
std::vector< events::sdl_handler * > sdl_handler_vector
Manage the empty-palette in the editor.
std::size_t index(std::string_view str, const std::size_t index)
Codepoint index corresponding to the nth character in a UTF-8 string.
bool contains(const Container &container, const Value &value)
Returns true iff value is found in container.
An abstract description of a rectangle with integer coordinates.