Scrollpane. More...
#include <scrollpane.hpp>
Classes | |
struct | scrollpane_widget |
Public Member Functions | |
scrollpane (CVideo &video) | |
Create a scrollpane. More... | |
virtual void | set_location (SDL_Rect const &rect) |
void | set_location (int x, int y) |
virtual void | hide (bool value=true) |
void | add_widget (widget *w, int x, int y, int z_order=0) |
void | remove_widget (widget *w) |
void | clear () |
Public Member Functions inherited from gui::scrollarea | |
scrollarea (CVideo &video, bool auto_join=true) | |
Create a zone with automatic handling of scrollbar. More... | |
Public Member Functions inherited from gui::widget | |
SDL_Rect const & | location () const |
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 void | draw () |
virtual void | set_inner_location (SDL_Rect const &rect) |
virtual void | scroll (unsigned int pos) |
Protected Member Functions inherited from gui::scrollarea | |
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 () |
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_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 Types | |
typedef std::multimap< int, scrollpane_widget > | widget_map |
Private Member Functions | |
void | update_widget_positions () |
void | position_widget (scrollpane_widget &spw) |
SDL_Rect | client_area () const |
void | update_content_size () |
Private Attributes | |
int | border_ |
widget_map | content_ |
SDL_Rect | content_pos_ |
Additional Inherited Members | |
Protected Attributes inherited from gui::widget | |
bool | focus_ |
Scrollpane.
Definition at line 30 of file scrollpane.hpp.
|
private |
Definition at line 78 of file scrollpane.hpp.
gui::scrollpane::scrollpane | ( | CVideo & | video | ) |
Create a scrollpane.
Definition at line 43 of file scrollpane.cpp.
References content_pos_, gui::scrollarea::set_scroll_rate(), and update_content_size().
Definition at line 71 of file scrollpane.cpp.
References client_area(), content_, itor, position_widget(), gui::widget::set_clip_rect(), and update_content_size().
Referenced by mp::connect::side::add_widgets_to_scrollpane(), mp::options::entry_display::layout(), mp::options::slider_display::layout(), mp::options::checkbox_display::layout(), mp::options::combo_display::layout(), mp::options::title_display::layout(), mp::options::reset_display::layout(), and mp::configure::layout_children().
void gui::scrollpane::clear | ( | ) |
Definition at line 51 of file scrollpane.cpp.
References content_, and update_content_size().
|
private |
Definition at line 151 of file scrollpane.cpp.
References border_, and gui::widget::location().
Referenced by add_widget(), set_inner_location(), set_location(), and update_content_size().
|
protectedvirtual |
Reimplemented from gui::widget.
Definition at line 108 of file scrollpane.cpp.
|
virtual |
Reimplemented from gui::scrollarea.
Definition at line 64 of file scrollpane.cpp.
References content_, and itor.
Referenced by mp::configure::hide_children(), and mp::connect::hide_children().
|
private |
Definition at line 145 of file scrollpane.cpp.
References border_, content_pos_, gui::widget::set_location(), gui::scrollpane::scrollpane_widget::w, gui::scrollpane::scrollpane_widget::x, and gui::scrollpane::scrollpane_widget::y.
Referenced by add_widget(), and update_widget_positions().
Definition at line 91 of file scrollpane.cpp.
References content_, itor, and update_content_size().
Implements gui::scrollarea.
Definition at line 113 of file scrollpane.cpp.
References content_pos_, pos, and update_widget_positions().
|
protectedvirtual |
Implements gui::scrollarea.
Definition at line 101 of file scrollpane.cpp.
References client_area(), content_, and itor.
|
virtual |
Reimplemented from gui::widget.
Definition at line 57 of file scrollpane.cpp.
References client_area(), gui::widget::set_location(), gui::scrollarea::set_shown_size(), and update_widget_positions().
Referenced by mp::configure::layout_children(), and mp::connect::layout_children().
Definition at line 56 of file scrollpane.hpp.
References gui::widget::set_location().
|
private |
Definition at line 163 of file scrollpane.cpp.
References client_area(), content_, content_pos_, itor, gui::widget::set_dirty(), gui::scrollarea::set_full_size(), and gui::scrollarea::set_shown_size().
Referenced by add_widget(), clear(), remove_widget(), and scrollpane().
|
private |
Definition at line 122 of file scrollpane.cpp.
References content_, gui::widget::hidden(), gui::widget::HIDDEN, i, itor, position_widget(), and gui::widget::set_dirty().
Referenced by scroll(), and set_location().
|
private |
Definition at line 77 of file scrollpane.hpp.
Referenced by client_area(), and position_widget().
|
private |
Definition at line 79 of file scrollpane.hpp.
Referenced by add_widget(), clear(), hide(), remove_widget(), set_inner_location(), update_content_size(), and update_widget_positions().
|
private |
Definition at line 80 of file scrollpane.hpp.
Referenced by position_widget(), scroll(), scrollpane(), and update_content_size().