#include <scrollarea.hpp>
Public Member Functions | |
scrollarea (CVideo &video, bool auto_join=true) | |
Create a zone with automatic handling of scrollbar. | |
virtual void | hide (bool value=true) |
Protected Member Functions | |
virtual handler_vector | handler_members () |
virtual void | update_location (SDL_Rect const &rect) |
virtual void | handle_event (const SDL_Event &event) |
virtual void | process_event () |
virtual void | scroll (unsigned int pos)=0 |
virtual void | set_inner_location (SDL_Rect const &rect)=0 |
SDL_Rect | inner_location () const |
unsigned | scrollbar_width () const |
unsigned | get_position () const |
unsigned | get_max_position () const |
void | set_position (unsigned pos) |
void | adjust_position (unsigned pos) |
void | move_position (int dep) |
void | set_shown_size (unsigned h) |
void | set_full_size (unsigned h) |
void | set_scroll_rate (unsigned r) |
bool | has_scrollbar () const |
Private Member Functions | |
void | test_scrollbar () |
Private Attributes | |
scrollbar | scrollbar_ |
int | old_position_ |
bool | recursive_ |
bool | shown_scrollbar_ |
unsigned | shown_size_ |
unsigned | full_size_ |
Definition at line 28 of file scrollarea.hpp.
gui::scrollarea::scrollarea | ( | CVideo & | video, | |
bool | auto_join = true | |||
) |
Create a zone with automatic handling of scrollbar.
Definition at line 27 of file scrollarea.cpp.
References gui::scrollbar::hide(), and scrollbar_.
void gui::scrollarea::hide | ( | bool | value = true |
) | [virtual] |
Reimplemented from gui::widget.
Reimplemented in gui::scrollpane.
Definition at line 78 of file scrollarea.cpp.
References gui::scrollbar::hide(), gui::widget::hide(), scrollbar_, and shown_scrollbar_.
Referenced by mp::wait::hide_children(), mp::ui::hide_children(), mp::lobby::hide_children(), and mp::create::hide_children().
handler_vector gui::scrollarea::handler_members | ( | ) | [protected, virtual] |
Reimplemented from events::handler.
Reimplemented in gui::dialog_textbox.
Definition at line 40 of file scrollarea.cpp.
References scrollbar_.
Referenced by gui::dialog_textbox::handler_members().
void gui::scrollarea::update_location | ( | SDL_Rect const & | rect | ) | [protected, virtual] |
Reimplemented from gui::widget.
Definition at line 47 of file scrollarea.cpp.
References has_scrollbar(), gui::widget::hidden(), gui::scrollbar::hide(), r, scrollbar_, set_inner_location(), gui::widget::set_location(), shown_scrollbar_, and gui::widget::width().
Referenced by test_scrollbar().
void gui::scrollarea::handle_event | ( | const SDL_Event & | event | ) | [protected, virtual] |
Reimplemented from gui::widget.
Reimplemented in mp::gamebrowser, gui::file_menu, gui::menu, and gui::textbox.
Definition at line 151 of file scrollarea.cpp.
References gui::widget::hidden(), inner_location(), point_in_rect(), gui::scrollbar::scroll_down(), gui::scrollbar::scroll_up(), scrollbar_, SDL_BUTTON_WHEELDOWN, and SDL_BUTTON_WHEELUP.
void gui::scrollarea::process_event | ( | ) | [protected, virtual] |
Reimplemented from events::handler.
Definition at line 129 of file scrollarea.cpp.
References gui::scrollbar::get_position(), old_position_, scroll(), and scrollbar_.
virtual void gui::scrollarea::scroll | ( | unsigned int | pos | ) | [protected, pure virtual] |
Implemented in help::help_text_area, mp::gamebrowser, gui::menu, gui::scrollpane, and gui::textbox.
Referenced by process_event().
virtual void gui::scrollarea::set_inner_location | ( | SDL_Rect const & | rect | ) | [protected, pure virtual] |
Implemented in help::help_text_area, mp::gamebrowser, gui::menu, gui::scrollpane, and gui::textbox.
Referenced by update_location().
SDL_Rect gui::scrollarea::inner_location | ( | ) | const [protected] |
Definition at line 138 of file scrollarea.cpp.
References gui::widget::location(), r, scrollbar_, shown_scrollbar_, and gui::widget::width().
Referenced by help::help_text_area::add_img_item(), gui::textbox::add_text_line(), gui::menu::draw(), gui::textbox::draw_contents(), mp::gamebrowser::draw_contents(), gui::menu::draw_contents(), help::help_text_area::draw_contents(), gui::menu::draw_row(), mp::gamebrowser::get_item_rect(), gui::menu::get_item_rect_internal(), help::help_text_area::get_max_x(), gui::textbox::handle_event(), handle_event(), mp::gamebrowser::handle_event(), gui::menu::hit(), gui::menu::hit_heading(), mp::gamebrowser::scroll(), mp::gamebrowser::set_game_items(), and help::help_text_area::set_items().
unsigned gui::scrollarea::scrollbar_width | ( | ) | const [protected] |
Definition at line 146 of file scrollarea.cpp.
References scrollbar_, and gui::widget::width().
Referenced by gui::menu::update_size(), and gui::menu::wrap_words().
unsigned gui::scrollarea::get_position | ( | ) | const [protected] |
Definition at line 85 of file scrollarea.cpp.
References gui::scrollbar::get_position(), and scrollbar_.
Referenced by gui::textbox::append_text(), help::help_text_area::draw_contents(), gui::menu::get_item_rect_internal(), help::help_text_area::ref_at(), mp::gamebrowser::set_game_items(), mp::gamebrowser::set_inner_location(), gui::menu::set_items(), and gui::menu::update_size().
unsigned gui::scrollarea::get_max_position | ( | ) | const [protected] |
Definition at line 90 of file scrollarea.cpp.
References gui::scrollbar::get_max_position(), and scrollbar_.
Referenced by gui::textbox::append_text(), gui::textbox::scroll_to_bottom(), mp::gamebrowser::set_game_items(), and gui::menu::set_items().
void gui::scrollarea::set_position | ( | unsigned | pos | ) | [protected] |
Definition at line 95 of file scrollarea.cpp.
References scrollbar_, and gui::scrollbar::set_position().
Referenced by gui::textbox::scroll_to_bottom(), mp::gamebrowser::set_game_items(), gui::menu::set_items(), and help::help_text_area::set_items().
void gui::scrollarea::adjust_position | ( | unsigned | pos | ) | [protected] |
Definition at line 100 of file scrollarea.cpp.
References gui::scrollbar::adjust_position(), and scrollbar_.
Referenced by gui::menu::adjust_viewport_to_selection(), and mp::gamebrowser::handle_event().
void gui::scrollarea::move_position | ( | int | dep | ) | [protected] |
Definition at line 105 of file scrollarea.cpp.
References gui::scrollbar::move_position(), and scrollbar_.
void gui::scrollarea::set_shown_size | ( | unsigned | h | ) | [protected] |
Definition at line 110 of file scrollarea.cpp.
References scrollbar_, gui::scrollbar::set_shown_size(), shown_size_, and test_scrollbar().
Referenced by mp::gamebrowser::set_game_items(), mp::gamebrowser::set_inner_location(), help::help_text_area::set_items(), gui::textbox::set_location(), gui::scrollpane::set_location(), gui::scrollpane::update_content_size(), gui::menu::update_scrollbar_grip_height(), and gui::textbox::update_text_cache().
void gui::scrollarea::set_full_size | ( | unsigned | h | ) | [protected] |
Definition at line 117 of file scrollarea.cpp.
References full_size_, scrollbar_, gui::scrollbar::set_full_size(), and test_scrollbar().
Referenced by mp::gamebrowser::set_game_items(), mp::gamebrowser::set_inner_location(), help::help_text_area::set_items(), gui::scrollpane::update_content_size(), gui::menu::update_scrollbar_grip_height(), and gui::textbox::update_text_cache().
void gui::scrollarea::set_scroll_rate | ( | unsigned | r | ) | [protected] |
Definition at line 124 of file scrollarea.cpp.
References scrollbar_, and gui::scrollbar::set_scroll_rate().
Referenced by help::help_text_area::help_text_area(), gui::scrollpane::scrollpane(), and gui::textbox::textbox().
bool gui::scrollarea::has_scrollbar | ( | ) | const [protected] |
Definition at line 35 of file scrollarea.cpp.
References full_size_, gui::scrollbar::is_valid_height(), gui::widget::location(), scrollbar_, and shown_size_.
Referenced by mp::gamebrowser::set_game_items(), gui::menu::set_items(), test_scrollbar(), update_location(), and gui::menu::wrap_words().
void gui::scrollarea::test_scrollbar | ( | ) | [private] |
Definition at line 65 of file scrollarea.cpp.
References gui::widget::bg_cancel(), gui::widget::bg_restore(), has_scrollbar(), gui::widget::location(), recursive_, shown_scrollbar_, and update_location().
Referenced by set_full_size(), and set_shown_size().
scrollbar gui::scrollarea::scrollbar_ [private] |
Definition at line 61 of file scrollarea.hpp.
Referenced by adjust_position(), get_max_position(), get_position(), handle_event(), handler_members(), has_scrollbar(), hide(), inner_location(), move_position(), process_event(), scrollarea(), scrollbar_width(), set_full_size(), set_position(), set_scroll_rate(), set_shown_size(), and update_location().
int gui::scrollarea::old_position_ [private] |
bool gui::scrollarea::recursive_ [private] |
bool gui::scrollarea::shown_scrollbar_ [private] |
Definition at line 63 of file scrollarea.hpp.
Referenced by hide(), inner_location(), test_scrollbar(), and update_location().
unsigned gui::scrollarea::shown_size_ [private] |
unsigned gui::scrollarea::full_size_ [private] |
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |