16 #define GETTEXT_DOMAIN "wesnoth-editor" 19 #include "widgets/widget.hpp" 101 while (old_start != items_start) {
102 old_start = items_start;
115 upscroll_button->hide(
false);
117 if (downscroll_button)
118 downscroll_button->hide(
false);
119 std::shared_ptr<gui::button> palette_menu_button =
gui_.
find_menu_button(
"menu-editor-terrain");
120 if (palette_menu_button)
121 palette_menu_button->hide(
false);
149 if (event.type == SDL_MOUSEMOTION) {
152 if (!
focus(&event)) {
157 else if (
focus(&event)) {
161 if (!
focus(&event)) {
165 const SDL_MouseButtonEvent &mouse_button_event =
event.button;
168 if (event.type == SDL_MOUSEWHEEL) {
169 if (event.wheel.y > 0) {
171 }
else if (event.wheel.y < 0) {
175 if (event.wheel.x < 0) {
178 }
else if (event.wheel.x > 0) {
184 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
virtual std::size_t num_items()=0
Palette where the terrain to be drawn can be selected.
virtual void next_group()=0
List of starting locations and location ids.
bool contains(const Container &container, const Value &value)
Returns true iff value is found in container.
editor_toolkit & toolkit_
virtual bool scroll_up()=0
Scroll the editor-palette up one step if possible.
virtual bool can_scroll_up()=0
virtual void set_group(std::size_t index)=0
virtual std::size_t start_num()=0
Manage the empty-palette in the editor.
const std::unique_ptr< item_palette > item_palette_
void scroll_down()
Scroll the editor-palette down one step if possible.
virtual sdl_handler_vector handler_members()
virtual void handle_event(const SDL_Event &event) override
virtual void adjust_size(const SDL_Rect &target)=0
virtual void layout() override
Called by draw_manager to validate layout before drawing.
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.
An abstract description of a rectangle with integer coordinates.
const rect & palette_area() 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.
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
palette_manager(editor_display &gui, const game_config_view &cfg, editor_toolkit &toolkit)
void draw_contents() override
Draw the palette.
std::shared_ptr< gui::button > find_menu_button(const std::string &id)
sdl_handler_vector handler_members() override