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_ |
Classes | |
struct | visible_item |
Information about an item that is visible in the menu. More... |
Definition at line 228 of file help.cpp.
Definition at line 1759 of file help.cpp.
References display_visible_items(), selected_item_, gui::menu::silent_, toplevel_, update_visible_items(), and visible_items_.
int help::help_menu::process | ( | ) |
Choose a topic if it is clicked.
Reimplemented from gui::menu.
Definition at line 1880 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, tooltips::process(), help::help_menu::visible_item::sec, selected_item_, gui::menu::style_, help::help_menu::visible_item::t, toplevel_, update_visible_items(), visible_items_, and gamemap::location::x.
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 1861 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().
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 1919 of file help.cpp.
References chosen_topic_.
Referenced by help::help_browser::process_event().
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 1789 of file help.cpp.
References expanded(), get_string_to_show(), is_visible_id(), help::section::sections, help::section::topics, and visible_items_.
Referenced by help_menu(), process(), and select_topic().
bool help::help_menu::expanded | ( | const section & | sec | ) | [private] |
Return true if the section is expanded.
Definition at line 1770 of file help.cpp.
References expanded_.
Referenced by get_string_to_show(), process(), and update_visible_items().
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 1775 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().
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 1782 of file help.cpp.
References expanded_, game_config::sounds::menu_contract, and sound::play_UI_sound().
Referenced by process().
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 1814 of file help.cpp.
References IMAGE_PREFIX, and IMG_TEXT_SEPARATOR.
Referenced by get_string_to_show(), and process().
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 1824 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 1832 of file help.cpp.
References IMG_TEXT_SEPARATOR, indented_icon(), and help::topic::title.
void help::help_menu::display_visible_items | ( | ) | [private] |
Draw the currently visible items.
Definition at line 1926 of file help.cpp.
References boost::foreach_detail_::end(), selected_item_, gui::menu::set_items(), and visible_items_.
Referenced by help_menu(), process(), and select_topic().
Internal recursive thingie.
did_expand will be true if any section was expanded, otherwise untouched.
Definition at line 1840 of file help.cpp.
References expand(), help::topic::id, help::section::sections, and help::section::topics.
Referenced by select_topic().
std::vector<visible_item> help::help_menu::visible_items_ [private] |
Definition at line 290 of file help.cpp.
Referenced by display_visible_items(), help_menu(), process(), select_topic(), and update_visible_items().
const section& help::help_menu::toplevel_ [private] |
std::set<const section*> help::help_menu::expanded_ [private] |
surface_restorer help::help_menu::restorer_ [private] |
SDL_Rect help::help_menu::rect_ [private] |
topic const* help::help_menu::chosen_topic_ [private] |
visible_item help::help_menu::selected_item_ [private] |
Definition at line 296 of file help.cpp.
Referenced by display_visible_items(), help_menu(), process(), and select_topic().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |