help::help_browser Class Reference

A help browser widget. More...

Inheritance diagram for help::help_browser:

Inheritance graph
[legend]
Collaboration diagram for help::help_browser:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 help_browser (display &disp, const section &toplevel)
void adjust_layout ()
void show_topic (const std::string &topic_id)
 Display the topic with the specified identifier.

Protected Member Functions

virtual void update_location (SDL_Rect const &rect)
virtual void process_event ()
virtual void handle_event (const SDL_Event &event)

Private Member Functions

void update_cursor ()
 Update the current cursor, set it to the reference cursor if mousex, mousey is over a cross-reference, otherwise, set it to the normal cursor.
void show_topic (const topic &t, bool save_in_history=true)
void move_in_history (std::deque< const topic * > &from, std::deque< const topic * > &to)
 Move in the topic history.

Private Attributes

displaydisp_
help_menu menu_
help_text_area text_area_
const sectiontoplevel_
bool ref_cursor_
std::deque< const topic * > back_topics_
std::deque< const topic * > forward_topics_
gui::button back_button_
gui::button forward_button_
topic const * shown_topic_


Detailed Description

A help browser widget.

Definition at line 441 of file help.cpp.


Constructor & Destructor Documentation

help::help_browser::help_browser ( display disp,
const section toplevel 
)


Member Function Documentation

void help::help_browser::adjust_layout (  ) 

void help::help_browser::show_topic ( const std::string &  topic_id  ) 

Display the topic with the specified identifier.

Open the menu on the right location and display the topic in the text area.

Definition at line 2680 of file help.cpp.

References help::find_topic(), hidden_symbol(), and toplevel_.

Referenced by handle_event(), move_in_history(), process_event(), and help::show_help().

void help::help_browser::update_location ( SDL_Rect const &  rect  )  [protected, virtual]

Reimplemented from gui::widget.

Definition at line 2555 of file help.cpp.

References adjust_layout().

void help::help_browser::process_event (  )  [protected, virtual]

Fake focus functionality for the menu, only process it if it has focus.

A new topic has been chosen in the menu, display it.

Reimplemented from events::handler.

Definition at line 2560 of file help.cpp.

References back_button_, back_topics_, help::help_menu::chosen_topic(), forward_button_, forward_topics_, gui::widget::hide(), gui::widget::location(), menu_, move_in_history(), point_in_rect(), gui::button::pressed(), help::help_menu::process(), show_topic(), and shown_topic_.

void help::help_browser::handle_event ( const SDL_Event &  event  )  [protected, virtual]

Reimplemented from gui::widget.

Definition at line 2602 of file help.cpp.

References _, disp_, help::find_topic(), help::help_text_area::ref_at(), show_topic(), text_area_, toplevel_, and update_cursor().

void help::help_browser::update_cursor (  )  [private]

Update the current cursor, set it to the reference cursor if mousex, mousey is over a cross-reference, otherwise, set it to the normal cursor.

Definition at line 2631 of file help.cpp.

References cursor::HYPERLINK, cursor::NORMAL, help::help_text_area::ref_at(), ref_cursor_, cursor::set(), and text_area_.

Referenced by handle_event(), and show_topic().

void help::help_browser::show_topic ( const topic t,
bool  save_in_history = true 
) [private]

void help::help_browser::move_in_history ( std::deque< const topic * > &  from,
std::deque< const topic * > &  to 
) [private]

Move in the topic history.

Pop an element from from and insert it in to. Pop at the fronts if the maximum number of elements is exceeded.

Definition at line 2585 of file help.cpp.

References show_topic(), and shown_topic_.

Referenced by process_event().


Member Data Documentation

Definition at line 467 of file help.cpp.

Referenced by handle_event().

Definition at line 468 of file help.cpp.

Referenced by adjust_layout(), process_event(), and show_topic().

Definition at line 469 of file help.cpp.

Referenced by adjust_layout(), handle_event(), show_topic(), and update_cursor().

Definition at line 470 of file help.cpp.

Referenced by handle_event(), and show_topic().

Definition at line 471 of file help.cpp.

Referenced by update_cursor().

std::deque<const topic *> help::help_browser::back_topics_ [private]

Definition at line 472 of file help.cpp.

Referenced by process_event(), and show_topic().

std::deque<const topic *> help::help_browser::forward_topics_ [private]

Definition at line 472 of file help.cpp.

Referenced by process_event(), and show_topic().

Definition at line 473 of file help.cpp.

Referenced by adjust_layout(), help_browser(), and process_event().

Definition at line 473 of file help.cpp.

Referenced by adjust_layout(), help_browser(), and process_event().

Definition at line 474 of file help.cpp.

Referenced by move_in_history(), process_event(), and show_topic().


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

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