The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
gui::scrollpane Class Reference

Scrollpane. More...

#include <scrollpane.hpp>

Inheritance diagram for gui::scrollpane:
Inheritance graph

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::stringid () 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 ()
 
CVideovideo () 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_
 

Detailed Description

Scrollpane.

Definition at line 30 of file scrollpane.hpp.

Member Typedef Documentation

typedef std::multimap<int, scrollpane_widget> gui::scrollpane::widget_map
private

Definition at line 78 of file scrollpane.hpp.

Constructor & Destructor Documentation

gui::scrollpane::scrollpane ( CVideo video)

Create a scrollpane.

Todo:
FIXME: parameterlist ??

Definition at line 43 of file scrollpane.cpp.

References content_pos_, gui::scrollarea::set_scroll_rate(), and update_content_size().

Member Function Documentation

void gui::scrollpane::add_widget ( widget w,
int  x,
int  y,
int  z_order = 0 
)
void gui::scrollpane::clear ( )

Definition at line 51 of file scrollpane.cpp.

References content_, and update_content_size().

SDL_Rect gui::scrollpane::client_area ( ) const
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().

void gui::scrollpane::draw ( )
protectedvirtual

Reimplemented from gui::widget.

Definition at line 108 of file scrollpane.cpp.

void gui::scrollpane::hide ( bool  value = true)
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().

void gui::scrollpane::position_widget ( scrollpane_widget spw)
private
void gui::scrollpane::remove_widget ( widget w)

Definition at line 91 of file scrollpane.cpp.

References content_, itor, and update_content_size().

void gui::scrollpane::scroll ( unsigned int  pos)
protectedvirtual

Implements gui::scrollarea.

Definition at line 113 of file scrollpane.cpp.

References content_pos_, pos, and update_widget_positions().

void gui::scrollpane::set_inner_location ( SDL_Rect const &  rect)
protectedvirtual

Implements gui::scrollarea.

Definition at line 101 of file scrollpane.cpp.

References client_area(), content_, and itor.

void gui::scrollpane::set_location ( SDL_Rect const &  rect)
virtual
void gui::scrollpane::set_location ( int  x,
int  y 
)
inline

Definition at line 56 of file scrollpane.hpp.

References gui::widget::set_location().

void gui::scrollpane::update_content_size ( )
private
void gui::scrollpane::update_widget_positions ( )
private

Member Data Documentation

int gui::scrollpane::border_
private

Definition at line 77 of file scrollpane.hpp.

Referenced by client_area(), and position_widget().

widget_map gui::scrollpane::content_
private
SDL_Rect gui::scrollpane::content_pos_
private

Definition at line 80 of file scrollpane.hpp.

Referenced by position_widget(), scroll(), scrollpane(), and update_content_size().


The documentation for this class was generated from the following files: