gui::widget Class Reference

#include <widget.hpp>

Inheritance diagram for gui::widget:

Inheritance graph
[legend]
Collaboration diagram for gui::widget:

Collaboration graph
[legend]

List of all members.

Public Member Functions

SDL_Rect const & location () const
virtual void set_location (SDL_Rect const &rect)
void set_location (int x, int y)
void set_width (unsigned w)
void set_height (unsigned h)
void set_measurements (unsigned w, unsigned h)
unsigned width () const
unsigned height () const
bool focus (const SDL_Event *event)
void set_focus (bool focus)
virtual void hide (bool value=true)
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)
virtual void process_help_string (int mousex, int mousey)

Protected Member Functions

 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 ()
virtual void draw_contents ()
virtual void update_location (SDL_Rect const &rect)
const SDL_Rect * clip_rect () const
virtual handler_vector member_handlers ()
virtual void handle_event (SDL_Event const &)

Protected Attributes

bool focus_

Private Types

enum  { UNINIT, HIDDEN, DIRTY, DRAWN }

Private Member Functions

void volatile_draw ()
void volatile_undraw ()
void hide_override (bool value=true)

Private Attributes

CVideovideo_
std::vector< surface_restorerrestorer_
SDL_Rect rect_
bool needs_restore_
enum gui::widget:: { ... }  state_
bool hidden_override_
bool enabled_
bool clip_
SDL_Rect clip_rect_
bool volatile_
std::string help_text_
int help_string_
std::string id_

Friends

class scrollpane
class dialog


Detailed Description

Definition at line 30 of file widgets/widget.hpp.


Member Enumeration Documentation

anonymous enum [private]

Enumerator:
UNINIT 
HIDDEN 
DIRTY 
DRAWN 

Definition at line 109 of file widgets/widget.hpp.


Constructor & Destructor Documentation

gui::widget::widget ( widget const &  o  )  [protected]

Definition at line 26 of file widgets/widget.cpp.

gui::widget::widget ( CVideo video,
const bool  auto_join = true 
) [protected]

Definition at line 34 of file widgets/widget.cpp.

gui::widget::~widget (  )  [protected, virtual]

Definition at line 41 of file widgets/widget.cpp.

References bg_cancel().


Member Function Documentation

const SDL_Rect & gui::widget::location (  )  const

void gui::widget::set_location ( SDL_Rect const &  rect  )  [virtual]

void gui::widget::set_location ( int  x,
int  y 
)

Reimplemented in gui::scrollpane, gui::slider, and gui::textbox.

Definition at line 83 of file widgets/widget.cpp.

References rect, rect_, and set_location().

void gui::widget::set_width ( unsigned  w  ) 

void gui::widget::set_height ( unsigned  h  ) 

void gui::widget::set_measurements ( unsigned  w,
unsigned  h 
)

unsigned gui::widget::width (  )  const

unsigned gui::widget::height (  )  const

bool gui::widget::focus ( const SDL_Event *  event  ) 

void gui::widget::set_focus ( bool  focus  ) 

void gui::widget::hide ( bool  value = true  )  [virtual]

bool gui::widget::hidden (  )  const

void gui::widget::enable ( bool  new_val = true  )  [virtual]

bool gui::widget::enabled (  )  const

void gui::widget::set_clip_rect ( const SDL_Rect &  rect  ) 

Definition at line 164 of file widgets/widget.cpp.

References clip_, clip_rect_, and set_dirty().

Referenced by gui::scrollpane::add_widget().

void gui::widget::set_volatile ( bool  val = true  ) 

Definition at line 253 of file widgets/widget.cpp.

References DIRTY, DRAWN, state_, and volatile_.

Referenced by about::show_about().

void gui::widget::set_dirty ( bool  dirty = true  ) 

Reimplemented in map_editor::terrain_palette.

Definition at line 190 of file widgets/widget.cpp.

References DIRTY, DRAWN, hidden_override_, needs_restore_, state_, and volatile_.

Referenced by help::help_browser::adjust_layout(), map_editor::brush_bar::adjust_size(), gui::textbox::append_text(), gui::menu::change_item(), gui::textbox::clear(), gui::menu::do_sort(), draw(), mp::gamebrowser::draw(), gui::menu::draw(), map_editor::brush_bar::draw(), draw_tip_of_day(), enable(), gui::menu::erase_item(), gui::textbox::handle_event(), gui::slider::handle_event(), gui::scrollbar::handle_event(), mp::gamebrowser::handle_event(), gui::button::handle_event(), hide(), hide_override(), map_editor::brush_bar::left_mouse_click(), gui::textbox::process(), mp::wait::leader_preview_pane::process_event(), gui::textbox::scroll(), mp::gamebrowser::scroll(), gui::menu::scroll(), help::help_text_area::scroll(), gui::button::set_check(), set_clip_rect(), gui::label::set_colour(), map_editor::terrain_palette::set_dirty(), set_focus(), gui::scrollbar::set_full_size(), mp::gamebrowser::set_game_items(), gui::menu::set_heading(), gui::menu::set_items(), gui::button::set_label(), set_location(), gui::slider::set_max(), gui::slider::set_min(), gui::scrollbar::set_position(), gui::progress_bar::set_progress_percent(), mp::wait::leader_preview_pane::set_selection(), dialogs::campaign_preview_pane::set_selection(), dialogs::unit_preview_pane::set_selection(), gui::scrollbar::set_shown_size(), gui::label::set_size(), gui::textbox::set_text(), gui::progress_bar::set_text(), gui::label::set_text(), gui::slider::set_value(), gui::textbox::set_wrap(), about::show_about(), help::show_help(), help::help_text_area::show_topic(), gui::menu::sort_by(), gui::scrollpane::update_content_size(), gui::scrollpane::update_widget_positions(), and default_map_generator::user_config().

bool gui::widget::dirty (  )  const

const std::string & gui::widget::id (  )  const

Definition at line 205 of file widgets/widget.cpp.

References id_.

void gui::widget::set_id ( const std::string &  id  ) 

Definition at line 210 of file widgets/widget.cpp.

References id_.

void gui::widget::set_help_string ( const std::string &  str  ) 

Definition at line 293 of file widgets/widget.cpp.

References help_text_.

Referenced by mp::create::create(), mp::lobby::lobby(), and gui::show_title().

void gui::widget::process_help_string ( int  mousex,
int  mousey 
) [virtual]

void gui::widget::bg_register ( SDL_Rect const &  rect  )  [protected]

void gui::widget::bg_restore (  )  const [protected]

void gui::widget::bg_restore ( SDL_Rect const &  rect  )  const [protected]

void gui::widget::bg_update (  )  [protected]

Definition at line 217 of file widgets/widget.cpp.

References restorer_.

Referenced by hide(), hide_override(), and volatile_draw().

void gui::widget::bg_cancel (  )  [protected]

Definition at line 46 of file widgets/widget.cpp.

References restorer_.

Referenced by set_location(), gui::scrollarea::test_scrollbar(), and ~widget().

CVideo& gui::widget::video (  )  const [inline, protected]

void gui::widget::draw (  )  [protected, virtual]

virtual void gui::widget::draw_contents (  )  [inline, protected, virtual]

void gui::widget::update_location ( SDL_Rect const &  rect  )  [protected, virtual]

Reimplemented in help::help_browser, gui::scrollarea, and gui::scrollbar.

Definition at line 68 of file widgets/widget.cpp.

References bg_register().

Referenced by set_location(), and gui::scrollbar::update_location().

const SDL_Rect * gui::widget::clip_rect (  )  const [protected]

Definition at line 73 of file widgets/widget.cpp.

References clip_, and clip_rect_.

Referenced by mp::gamebrowser::draw(), and gui::menu::draw().

virtual handler_vector gui::widget::member_handlers (  )  [inline, protected, virtual]

Definition at line 93 of file widgets/widget.hpp.

virtual void gui::widget::handle_event ( SDL_Event const &   )  [inline, protected, virtual]

void gui::widget::volatile_draw (  )  [private, virtual]

Reimplemented from events::handler.

Definition at line 277 of file widgets/widget.cpp.

References bg_update(), DIRTY, draw(), DRAWN, hidden_override_, state_, and volatile_.

void gui::widget::volatile_undraw (  )  [private, virtual]

Reimplemented from events::handler.

Definition at line 286 of file widgets/widget.cpp.

References bg_restore(), and volatile_.

void gui::widget::hide_override ( bool  value = true  )  [private]

Definition at line 150 of file widgets/widget.cpp.

References bg_restore(), bg_update(), DIRTY, DRAWN, hidden_override_, set_dirty(), and state_.


Friends And Related Function Documentation

friend class scrollpane [friend]

Definition at line 121 of file widgets/widget.hpp.

friend class dialog [friend]

Definition at line 122 of file widgets/widget.hpp.


Member Data Documentation

bool gui::widget::focus_ [protected]

Definition at line 104 of file widgets/widget.hpp.

Referenced by video().

std::vector< surface_restorer > gui::widget::restorer_ [private]

Reimplemented in help::help_menu.

Definition at line 105 of file widgets/widget.hpp.

Referenced by bg_cancel(), bg_register(), bg_restore(), and bg_update().

SDL_Rect gui::widget::rect_ [private]

bool gui::widget::needs_restore_ [mutable, private]

Definition at line 107 of file widgets/widget.hpp.

Referenced by bg_restore(), and set_dirty().

enum { ... } gui::widget::state_ [private]

Definition at line 110 of file widgets/widget.hpp.

Referenced by hidden(), hide(), hide_override(), set_dirty(), and volatile_draw().

bool gui::widget::enabled_ [private]

Definition at line 111 of file widgets/widget.hpp.

Referenced by enable(), and enabled().

bool gui::widget::clip_ [private]

Definition at line 112 of file widgets/widget.hpp.

Referenced by bg_restore(), clip_rect(), draw(), hidden(), and set_clip_rect().

SDL_Rect gui::widget::clip_rect_ [private]

Definition at line 113 of file widgets/widget.hpp.

Referenced by bg_restore(), clip_rect(), draw(), hidden(), and set_clip_rect().

bool gui::widget::volatile_ [private]

Definition at line 115 of file widgets/widget.hpp.

Referenced by set_dirty(), set_volatile(), volatile_draw(), and volatile_undraw().

std::string gui::widget::help_text_ [private]

Definition at line 117 of file widgets/widget.hpp.

Referenced by process_help_string(), and set_help_string().

Reimplemented in gui::menu.

Definition at line 118 of file widgets/widget.hpp.

Referenced by process_help_string().

std::string gui::widget::id_ [private]

Definition at line 119 of file widgets/widget.hpp.

Referenced by id(), help::has_id::operator()(), and set_id().


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

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs