#include <scrollarea.hpp>
Public Member Functions | |
scrollarea (CVideo &video, bool auto_join=true) | |
Create a zone with automatic handling of scrollbar. More... | |
virtual void | hide (bool value=true) |
Public Member Functions inherited from gui::widget | |
SDL_Rect const & | location () const |
virtual void | set_location (SDL_Rect const &rect) |
void | set_location (int x, int y) |
void | set_width (int w) |
void | set_height (int h) |
void | set_measurements (int w, int h) |
int | width () const |
int | height () const |
bool | focus (const SDL_Event *event) |
void | set_focus (bool focus) |
bool | hidden () const |
virtual void | enable (bool new_val=true) |
bool | enabled () const |
void | set_clip_rect (const SDL_Rect &rect) |
void | set_volatile (bool val=true) |
void | set_dirty (bool dirty=true) |
bool | dirty () const |
const std::string & | id () const |
void | set_id (const std::string &id) |
void | set_help_string (const std::string &str) |
void | set_tooltip_string (const std::string &str) |
virtual void | process_help_string (int mousex, int mousey) |
virtual void | process_tooltip_string (int mousex, int mousey) |
Public Member Functions inherited from events::sdl_handler | |
virtual bool | requires_event_focus (const SDL_Event *=nullptr) const |
virtual void | join () |
virtual void | join (context &c) |
virtual void | join_same (sdl_handler *parent) |
virtual void | leave () |
virtual void | join_global () |
virtual void | leave_global () |
Protected Member Functions | |
virtual sdl_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 |
Protected Member Functions inherited from gui::widget | |
widget (widget const &o) | |
widget (CVideo &video, const bool auto_join=true) | |
virtual | ~widget () |
void | bg_register (SDL_Rect const &rect) |
void | bg_restore () const |
void | bg_restore (SDL_Rect const &rect) const |
void | bg_update () |
void | bg_cancel () |
CVideo & | video () const |
virtual void | draw () |
virtual void | draw_contents () |
const SDL_Rect * | clip_rect () const |
virtual sdl_handler_vector | member_handlers () |
virtual void | handle_window_event (SDL_Event const &event) |
bool | mouse_locked () const |
void | aquire_mouse_lock () |
void | free_mouse_lock () |
Protected Member Functions inherited from events::sdl_handler | |
sdl_handler (const bool auto_join=true) | |
virtual | ~sdl_handler () |
Private Member Functions | |
void | test_scrollbar () |
Private Attributes | |
scrollbar | scrollbar_ |
int | old_position_ |
bool | recursive_ |
bool | shown_scrollbar_ |
unsigned | shown_size_ |
unsigned | full_size_ |
Additional Inherited Members | |
Protected Attributes inherited from gui::widget | |
bool | focus_ |
Definition at line 24 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_.
|
protected |
Definition at line 100 of file scrollarea.cpp.
References gui::scrollbar::adjust_position(), and scrollbar_.
Referenced by gui::menu::adjust_viewport_to_selection(), mp::gamebrowser::handle_event(), and mp::gamebrowser::select_game().
|
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().
|
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().
|
protectedvirtual |
Reimplemented from gui::widget.
Reimplemented in gui::menu, mp::gamebrowser, gui::textbox, gui::multimenu, and gui::file_menu.
Definition at line 151 of file scrollarea.cpp.
References gui::widget::handle_event(), gui::widget::hidden(), inner_location(), gui::widget::mouse_locked(), sdl::point_in_rect(), gui::scrollbar::scroll_down(), gui::scrollbar::scroll_up(), and scrollbar_.
Referenced by gui::textbox::handle_event(), and gui::menu::handle_event().
|
protectedvirtual |
Reimplemented from events::sdl_handler.
Reimplemented in gui::dialog_textbox.
Definition at line 40 of file scrollarea.cpp.
References h, and scrollbar_.
Referenced by gui::dialog_textbox::handler_members().
|
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(), and update_location().
|
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::create::hide_children(), mp::configure::hide_children(), mp::options::entry_display::hide_children(), mp::ui::hide_children(), mp::lobby::hide_children(), and mp::create::init_level_changed().
|
protected |
Definition at line 138 of file scrollarea.cpp.
References gui::widget::location(), 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(), help::help_text_area::draw_contents(), mp::gamebrowser::draw_contents(), gui::menu::draw_contents(), gui::menu::draw_row(), mp::gamebrowser::get_item_rect(), gui::menu::get_item_rect_internal(), help::help_text_area::get_max_x(), handle_event(), gui::textbox::handle_event(), mp::gamebrowser::handle_event(), gui::menu::hit(), gui::multimenu::hit_checkbox(), gui::menu::hit_heading(), mp::gamebrowser::scroll(), mp::gamebrowser::set_game_items(), and help::help_text_area::set_items().
Definition at line 105 of file scrollarea.cpp.
References gui::scrollbar::move_position(), and scrollbar_.
|
protectedvirtual |
Reimplemented from events::sdl_handler.
Definition at line 129 of file scrollarea.cpp.
References gui::scrollbar::get_position(), old_position_, scroll(), and scrollbar_.
Implemented in gui::menu, mp::gamebrowser, gui::scrollpane, gui::textbox, and help::help_text_area.
Referenced by process_event().
|
protected |
Definition at line 146 of file scrollarea.cpp.
References scrollbar_, and gui::widget::width().
Referenced by gui::menu::update_size().
|
protected |
Definition at line 117 of file scrollarea.cpp.
References full_size_, h, 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().
|
protectedpure virtual |
Implemented in gui::menu, mp::gamebrowser, gui::scrollpane, gui::textbox, and help::help_text_area.
Referenced by update_location().
|
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(), help::help_text_area::set_items(), and gui::menu::set_items().
|
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().
|
protected |
Definition at line 110 of file scrollarea.cpp.
References h, 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::scrollpane::set_location(), gui::scrollpane::update_content_size(), gui::menu::update_scrollbar_grip_height(), and gui::textbox::update_text_cache().
|
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().
|
protectedvirtual |
Reimplemented from gui::widget.
Reimplemented in gui::textbox.
Definition at line 47 of file scrollarea.cpp.
References has_scrollbar(), gui::widget::hidden(), gui::scrollbar::hide(), scrollbar_, set_inner_location(), gui::widget::set_location(), shown_scrollbar_, and gui::widget::width().
Referenced by test_scrollbar(), and gui::textbox::update_location().
|
private |
Definition at line 63 of file scrollarea.hpp.
Referenced by has_scrollbar(), and set_full_size().
|
private |
Definition at line 60 of file scrollarea.hpp.
Referenced by process_event().
|
private |
Definition at line 61 of file scrollarea.hpp.
Referenced by test_scrollbar().
|
private |
Definition at line 59 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().
|
private |
Definition at line 61 of file scrollarea.hpp.
Referenced by hide(), inner_location(), test_scrollbar(), and update_location().
|
private |
Definition at line 62 of file scrollarea.hpp.
Referenced by has_scrollbar(), and set_shown_size().