Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

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 474 of file help.cpp.


Constructor & Destructor Documentation

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

Definition at line 2696 of file help.cpp.

References back_button_, forward_button_, gui::widget::hide(), font::relative_size(), and gui::widget::set_measurements().

Here is the call graph for this function:


Member Function Documentation

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

Reimplemented from gui::widget.

Definition at line 2801 of file help.cpp.

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

Here is the call graph for this function:

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 2784 of file help.cpp.

References show_topic(), and shown_topic_.

Referenced by process_event().

Here is the call graph for this function:

Here is the caller graph for this function:

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 2759 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_.

Here is the call graph for this function:

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 2879 of file help.cpp.

References help::find_topic(), and toplevel_.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 2893 of file help.cpp.

References back_topics_, forward_topics_, log_scope, menu_, help::help_menu::select_topic(), help::help_text_area::show_topic(), shown_topic_, text_area_, and update_cursor().

Here is the call graph for this function:

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 2830 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().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from gui::widget.

Definition at line 2754 of file help.cpp.

References adjust_layout().

Here is the call graph for this function:


Member Data Documentation

Definition at line 506 of file help.cpp.

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

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

Definition at line 505 of file help.cpp.

Referenced by process_event(), and show_topic().

Definition at line 500 of file help.cpp.

Referenced by handle_event().

Definition at line 506 of file help.cpp.

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

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

Definition at line 505 of file help.cpp.

Referenced by process_event(), and show_topic().

Definition at line 501 of file help.cpp.

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

Definition at line 504 of file help.cpp.

Referenced by update_cursor().

Definition at line 507 of file help.cpp.

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

Definition at line 502 of file help.cpp.

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

Definition at line 503 of file help.cpp.

Referenced by handle_event(), and show_topic().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:24:23 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs