15 #define GETTEXT_DOMAIN "wesnoth-editor"
18 #include "widgets/widget.hpp"
27 : gui::widget(gui.video()),
30 mouse_action_(active_mouse_action),
32 unit_palette_(new
unit_palette(gui, cfg, active_mouse_action)),
34 item_palette_(new
item_palette(gui, cfg, active_mouse_action))
110 return (*mouse_action_)->get_palette();
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);
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.
void set_group(size_t index)
boost::scoped_ptr< unit_palette > unit_palette_
std::vector< events::sdl_handler * > sdl_handler_vector
virtual void prev_group()=0
common_palette & active_palette()
virtual bool can_scroll_down()=0
void resrote_palete_bg(bool scroll_top)
Palette where the terrain to be drawn can be selected.
virtual void handle_event(const SDL_Event &event)
virtual void next_group()=0
boost::scoped_ptr< item_palette > item_palette_
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
palette_manager(editor_display &gui, const config &cfg, mouse_action **active_mouse_action)
virtual int num_items()=0
sdl_handler_vector handler_members()
Manage the empty-palette in the editor.
const SDL_Rect & palette_area() const
bool point_in_rect(int x, int y, const SDL_Rect &rect)
Tests whether a point is inside a rectangle.
Encapsulates the map of the game.
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.
virtual bool scroll_down()=0
Scroll the editor-palette down one step if possible.
virtual void set_start_item(size_t index)=0
virtual void set_group(size_t index)=0
boost::scoped_ptr< terrain_palette > terrain_palette_
A mouse action receives events from the controller, and responds to them by creating an appropriate e...
A config object defines a single node in a WML file, with access to child nodes.
virtual size_t start_num()=0