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

#include <scrollarea.hpp>

Inheritance diagram for gui::scrollarea:
Inheritance graph

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)
 
virtual void draw ()
 
- 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 ()
 
virtual bool has_joined ()
 
virtual bool has_joined_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 ()
 
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 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_
 

Detailed Description

Definition at line 23 of file scrollarea.hpp.

Constructor & Destructor Documentation

gui::scrollarea::scrollarea ( CVideo video,
bool  auto_join = true 
)

Create a zone with automatic handling of scrollbar.

Todo:
FIXME: parameterlist ??

Definition at line 25 of file scrollarea.cpp.

References gui::scrollbar::hide(), and scrollbar_.

Member Function Documentation

void gui::scrollarea::adjust_position ( unsigned  pos)
protected
unsigned gui::scrollarea::get_max_position ( ) const
protected
unsigned gui::scrollarea::get_position ( ) const
protected
void gui::scrollarea::handle_event ( const SDL_Event &  event)
protectedvirtual
sdl_handler_vector gui::scrollarea::handler_members ( )
protectedvirtual

Reimplemented from events::sdl_handler.

Definition at line 38 of file scrollarea.cpp.

References h, and scrollbar_.

bool gui::scrollarea::has_scrollbar ( ) const
protected
void gui::scrollarea::hide ( bool  value = true)
virtual

Reimplemented from gui::widget.

Definition at line 76 of file scrollarea.cpp.

References gui::scrollbar::hide(), gui::widget::hide(), scrollbar_, and shown_scrollbar_.

SDL_Rect gui::scrollarea::inner_location ( ) const
protected
void gui::scrollarea::move_position ( int  dep)
protected

Definition at line 103 of file scrollarea.cpp.

References gui::scrollbar::move_position(), and scrollbar_.

void gui::scrollarea::process_event ( )
protectedvirtual

Reimplemented from events::sdl_handler.

Definition at line 127 of file scrollarea.cpp.

References gui::scrollbar::get_position(), old_position_, scroll(), and scrollbar_.

virtual void gui::scrollarea::scroll ( unsigned int  pos)
protectedpure virtual

Implemented in gui::menu, gui::textbox, and help::help_text_area.

Referenced by process_event().

unsigned gui::scrollarea::scrollbar_width ( ) const
protected

Definition at line 144 of file scrollarea.cpp.

References scrollbar_, and gui::widget::width().

Referenced by gui::menu::update_size().

void gui::scrollarea::set_full_size ( unsigned  h)
protected
virtual void gui::scrollarea::set_inner_location ( SDL_Rect const &  rect)
protectedpure virtual

Implemented in gui::menu, gui::textbox, and help::help_text_area.

Referenced by update_location().

void gui::scrollarea::set_position ( unsigned  pos)
protected
void gui::scrollarea::set_scroll_rate ( unsigned  r)
protected
void gui::scrollarea::set_shown_size ( unsigned  h)
protected
void gui::scrollarea::test_scrollbar ( )
private
void gui::scrollarea::update_location ( SDL_Rect const &  rect)
protectedvirtual

Member Data Documentation

unsigned gui::scrollarea::full_size_
private

Definition at line 62 of file scrollarea.hpp.

Referenced by has_scrollbar(), and set_full_size().

int gui::scrollarea::old_position_
private

Definition at line 59 of file scrollarea.hpp.

Referenced by process_event().

bool gui::scrollarea::recursive_
private

Definition at line 60 of file scrollarea.hpp.

Referenced by test_scrollbar().

scrollbar gui::scrollarea::scrollbar_
private
bool gui::scrollarea::shown_scrollbar_
private

Definition at line 60 of file scrollarea.hpp.

Referenced by hide(), inner_location(), test_scrollbar(), and update_location().

unsigned gui::scrollarea::shown_size_
private

Definition at line 61 of file scrollarea.hpp.

Referenced by has_scrollbar(), and set_shown_size().


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