#include <editor_palettes.hpp>
Public Member Functions | |
brush_bar (display &gui, const size_specs &sizes) | |
unsigned int | selected_brush_size () |
Return the size of currently selected brush. | |
void | select_brush_size (int new_size) |
Select a brush size. | |
void | draw (bool force=false) |
Draw the palette. | |
virtual void | draw () |
virtual void | handle_event (const SDL_Event &event) |
void | adjust_size () |
Update the size of this widget. | |
Private Member Functions | |
void | left_mouse_click (const int mousex, const int mousey) |
To be called when a mouse click occurs. | |
int | selected_index (const int x, const int y) const |
Return the index of the brush that is at coordinates (x, y) in the panel. | |
Private Attributes | |
const size_specs & | size_specs_ |
display & | gui_ |
unsigned int | selected_ |
const int | total_brush_ |
const size_t | size_ |
Definition at line 150 of file editor_palettes.hpp.
map_editor::brush_bar::brush_bar | ( | display & | gui, | |
const size_specs & | sizes | |||
) |
unsigned int map_editor::brush_bar::selected_brush_size | ( | ) |
Return the size of currently selected brush.
Definition at line 499 of file editor_palettes.cpp.
References selected_.
Referenced by draw().
void map_editor::brush_bar::select_brush_size | ( | int | new_size | ) |
Select a brush size.
Definition at line 503 of file editor_palettes.cpp.
References selected_, and total_brush_.
void map_editor::brush_bar::draw | ( | bool | force = false |
) |
Draw the palette.
If force is true, everything will be redrawn, even though it is not dirty.
Definition at line 550 of file editor_palettes.cpp.
References surface::assign(), map_editor::size_specs::brush_padding, map_editor::size_specs::brush_y, gui::widget::dirty(), draw_rectangle(), image::get_image(), CVideo::getSurface(), gui_, loc, gui::widget::location(), scale_surface(), screen, selected_brush_size(), gui::widget::set_dirty(), size_, size_specs_, total_brush_, update_rect(), and display::video().
void map_editor::brush_bar::draw | ( | ) | [virtual] |
void map_editor::brush_bar::handle_event | ( | const SDL_Event & | event | ) | [virtual] |
Reimplemented from gui::widget.
Definition at line 518 of file editor_palettes.cpp.
References gui::widget::focus(), left_mouse_click(), point_in_rect(), and gui::widget::set_focus().
void map_editor::brush_bar::adjust_size | ( | ) |
Update the size of this widget.
Use if the size_specs have changed.
Definition at line 493 of file editor_palettes.cpp.
References map_editor::size_specs::brush_padding, map_editor::size_specs::brush_x, map_editor::size_specs::brush_y, gui::widget::set_dirty(), gui::widget::set_location(), gui::widget::set_measurements(), size_, size_specs_, and total_brush_.
Referenced by brush_bar().
void map_editor::brush_bar::left_mouse_click | ( | const int | mousex, | |
const int | mousey | |||
) | [private] |
To be called when a mouse click occurs.
Check if the coordinates is a terrain that may be chosen, and select the terrain if that is the case.
Definition at line 508 of file editor_palettes.cpp.
References selected_, selected_index(), and gui::widget::set_dirty().
Referenced by handle_event().
int map_editor::brush_bar::selected_index | ( | const int | x, | |
const int | y | |||
) | const [private] |
Return the index of the brush that is at coordinates (x, y) in the panel.
Definition at line 588 of file editor_palettes.cpp.
References map_editor::size_specs::brush_padding, map_editor::size_specs::brush_x, map_editor::size_specs::brush_y, size_, size_specs_, and total_brush_.
Referenced by left_mouse_click().
const size_specs& map_editor::brush_bar::size_specs_ [private] |
Definition at line 179 of file editor_palettes.hpp.
Referenced by adjust_size(), draw(), and selected_index().
display& map_editor::brush_bar::gui_ [private] |
unsigned int map_editor::brush_bar::selected_ [private] |
Definition at line 181 of file editor_palettes.hpp.
Referenced by left_mouse_click(), select_brush_size(), and selected_brush_size().
const int map_editor::brush_bar::total_brush_ [private] |
Definition at line 182 of file editor_palettes.hpp.
Referenced by adjust_size(), draw(), select_brush_size(), and selected_index().
const size_t map_editor::brush_bar::size_ [private] |
Definition at line 183 of file editor_palettes.hpp.
Referenced by adjust_size(), draw(), and selected_index().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |