A help browser widget. More...


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 | |
| display & | disp_ |
| help_menu | menu_ |
| help_text_area | text_area_ |
| const section & | toplevel_ |
| 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_ |
A help browser widget.
Definition at line 474 of file help.cpp.
Definition at line 2696 of file help.cpp.
References back_button_, forward_button_, gui::widget::hide(), font::relative_size(), and gui::widget::set_measurements().

| void help::help_browser::adjust_layout | ( | ) |
Definition at line 2718 of file help.cpp.
References back_button_, forward_button_, gui::widget::height(), gui::widget::location(), menu_, font::relative_size(), gui::widget::set_dirty(), gui::widget::set_height(), gui::widget::set_location(), gui::menu::set_max_height(), gui::menu::set_max_width(), gui::widget::set_width(), text_area_, and gui::widget::width().
Referenced by update_location().


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

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


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

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


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

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


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

gui::button help::help_browser::back_button_ [private] |
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().
display& help::help_browser::disp_ [private] |
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().
help_menu help::help_browser::menu_ [private] |
Definition at line 501 of file help.cpp.
Referenced by adjust_layout(), process_event(), and show_topic().
bool help::help_browser::ref_cursor_ [private] |
Definition at line 504 of file help.cpp.
Referenced by update_cursor().
topic const* help::help_browser::shown_topic_ [private] |
Definition at line 507 of file help.cpp.
Referenced by move_in_history(), process_event(), and show_topic().
help_text_area help::help_browser::text_area_ [private] |
Definition at line 502 of file help.cpp.
Referenced by adjust_layout(), handle_event(), show_topic(), and update_cursor().
const section& help::help_browser::toplevel_ [private] |
Definition at line 503 of file help.cpp.
Referenced by handle_event(), and show_topic().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:24:23 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |