The menu to the left in the help browser, where topics can be navigated through and chosen. More...


Classes | |
| struct | visible_item |
| Information about an item that is visible in the menu. More... | |
Public Member Functions | |
| help_menu (CVideo &video, const section &toplevel, int max_height=-1) | |
| int | process () |
| void | select_topic (const topic &t) |
| Make the topic the currently selected one, and expand all sections that need to be expanded to show it. | |
| const topic * | chosen_topic () |
| If a topic has been chosen, return that topic, otherwise NULL. | |
Private Member Functions | |
| void | update_visible_items (const section &top_level, unsigned starting_level=0) |
| Regenerate what items are visible by checking what sections are expanded. | |
| bool | expanded (const section &sec) |
| Return true if the section is expanded. | |
| void | expand (const section &sec) |
| Mark a section as expanded. | |
| void | contract (const section &sec) |
| Contract (close) a section. | |
| std::string | indented_icon (const std::string &icon, const unsigned level) |
| Return the string to use as the prefix for the icon part of the menu-string at the specified level. | |
| std::string | get_string_to_show (const section &sec, const unsigned level) |
| Return the string to use as the menu-string for sections at the specified level. | |
| std::string | get_string_to_show (const topic &topic, const unsigned level) |
| Return the string to use as the menu-string for topics at the specified level. | |
| void | display_visible_items () |
| Draw the currently visible items. | |
| bool | select_topic_internal (const topic &t, const section &sec) |
| Internal recursive thingie. | |
Private Attributes | |
| std::vector< visible_item > | visible_items_ |
| const section & | toplevel_ |
| std::set< const section * > | expanded_ |
| surface_restorer | restorer_ |
| SDL_Rect | rect_ |
| topic const * | chosen_topic_ |
| visible_item | selected_item_ |
The menu to the left in the help browser, where topics can be navigated through and chosen.
Definition at line 261 of file help.cpp.
Definition at line 1950 of file help.cpp.
References display_visible_items(), selected_item_, gui::menu::silent_, toplevel_, update_visible_items(), and visible_items_.

| const topic * help::help_menu::chosen_topic | ( | ) |
If a topic has been chosen, return that topic, otherwise NULL.
If one topic is returned, it will not be returned again, if it is not re-chosen.
Definition at line 2116 of file help.cpp.
References chosen_topic_.
Referenced by help::help_browser::process_event().

| void help::help_menu::contract | ( | const section & | sec | ) | [private] |
Contract (close) a section.
That is, mark it as not expanded, visible items are not updated.
Definition at line 1979 of file help.cpp.
References expanded_, game_config::sounds::menu_contract, and sound::play_UI_sound().
Referenced by process().


| void help::help_menu::display_visible_items | ( | ) | [private] |
Draw the currently visible items.
Definition at line 2123 of file help.cpp.
References selected_item_, gui::menu::set_items(), and visible_items_.
Referenced by help_menu(), process(), and select_topic().


| void help::help_menu::expand | ( | const section & | sec | ) | [private] |
Mark a section as expanded.
Do not update the visible items or anything.
Definition at line 1972 of file help.cpp.
References expanded_, help::section::id, game_config::sounds::menu_expand, and sound::play_UI_sound().
Referenced by process(), and select_topic_internal().


| bool help::help_menu::expanded | ( | const section & | sec | ) | [private] |
Return true if the section is expanded.
Definition at line 1967 of file help.cpp.
References expanded_.
Referenced by get_string_to_show(), process(), and update_visible_items().

| std::string help::help_menu::get_string_to_show | ( | const section & | sec, | |
| const unsigned | level | |||
| ) | [private] |
Return the string to use as the menu-string for sections at the specified level.
Definition at line 2021 of file help.cpp.
References expanded(), IMG_TEXT_SEPARATOR, indented_icon(), and help::section::title.
Referenced by update_visible_items().


| std::string help::help_menu::get_string_to_show | ( | const topic & | topic, | |
| const unsigned | level | |||
| ) | [private] |
Return the string to use as the menu-string for topics at the specified level.
Definition at line 2029 of file help.cpp.
References IMG_TEXT_SEPARATOR, indented_icon(), and help::topic::title.

| std::string help::help_menu::indented_icon | ( | const std::string & | icon, | |
| const unsigned | level | |||
| ) | [private] |
Return the string to use as the prefix for the icon part of the menu-string at the specified level.
Definition at line 2011 of file help.cpp.
References IMAGE_PREFIX, and IMG_TEXT_SEPARATOR.
Referenced by get_string_to_show(), and process().

| int help::help_menu::process | ( | ) |
Choose a topic if it is clicked.
Reimplemented from gui::menu.
Definition at line 2077 of file help.cpp.
References chosen_topic_, contract(), display_visible_items(), expand(), expanded(), help::find_topic(), gui::menu::style::get_thickness(), help::section::id, indented_icon(), gui::menu::style::item_size(), help::section::level, gui::widget::location(), help::help_menu::visible_item::sec, selected_item_, gui::menu::style_, help::help_menu::visible_item::t, toplevel_, update_visible_items(), and visible_items_.
Referenced by help::help_browser::process_event().


| void help::help_menu::select_topic | ( | const topic & | t | ) |
Make the topic the currently selected one, and expand all sections that need to be expanded to show it.
Definition at line 2058 of file help.cpp.
References display_visible_items(), select_topic_internal(), selected_item_, toplevel_, update_visible_items(), and visible_items_.
Referenced by help::help_browser::show_topic().


Internal recursive thingie.
did_expand will be true if any section was expanded, otherwise untouched.
Definition at line 2037 of file help.cpp.
References expand(), gui2::event::find(), help::topic::id, help::section::sections, and help::section::topics.
Referenced by select_topic().


| void help::help_menu::update_visible_items | ( | const section & | top_level, | |
| unsigned | starting_level = 0 | |||
| ) | [private] |
Regenerate what items are visible by checking what sections are expanded.
Definition at line 1986 of file help.cpp.
References expanded(), get_string_to_show(), help::section::sections, help::section::topics, and visible_items_.
Referenced by help_menu(), process(), and select_topic().


topic const* help::help_menu::chosen_topic_ [private] |
Definition at line 328 of file help.cpp.
Referenced by chosen_topic(), and process().
std::set<const section*> help::help_menu::expanded_ [private] |
Definition at line 325 of file help.cpp.
Referenced by contract(), expand(), and expanded().
SDL_Rect help::help_menu::rect_ [private] |
Reimplemented from gui::widget.
surface_restorer help::help_menu::restorer_ [private] |
Reimplemented from gui::widget.
visible_item help::help_menu::selected_item_ [private] |
Definition at line 329 of file help.cpp.
Referenced by display_visible_items(), help_menu(), process(), and select_topic().
const section& help::help_menu::toplevel_ [private] |
Definition at line 324 of file help.cpp.
Referenced by help_menu(), process(), and select_topic().
std::vector<visible_item> help::help_menu::visible_items_ [private] |
Definition at line 323 of file help.cpp.
Referenced by display_visible_items(), help_menu(), process(), select_topic(), and update_visible_items().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:24:20 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |