#include <wmi_pager.hpp>
Public Member Functions | |
wmi_pager () | |
void | update_ref (game_events::wmi_container *ptr) |
Updates the internal wmi_container pointer. More... | |
void | get_items (const map_location &hex, game_data &gamedata, filter_context &fc, unit_map &units, std::vector< boost::shared_ptr< const game_events::wml_menu_item > > &items, std::vector< std::string > &descriptions) |
Adds the currently paged range of menu items to the given lists. More... | |
bool | capture (const game_events::wml_menu_item &item) |
Captures a page up / page down event in the case that it is fired. More... | |
Private Attributes | |
int | page_num_ |
Current page number. More... | |
const game_events::wmi_container * | wmi_container_ |
Internal pointer to the collection of wml menu items. More... | |
Definition at line 39 of file wmi_pager.hpp.
|
inline |
Definition at line 45 of file wmi_pager.hpp.
bool wmi_pager::capture | ( | const game_events::wml_menu_item & | item | ) |
Captures a page up / page down event in the case that it is fired.
Definition at line 58 of file wmi_pager.cpp.
References game_events::wml_menu_item::id(), next_id, page_num_, and prev_id.
void wmi_pager::get_items | ( | const map_location & | hex, |
game_data & | gamedata, | ||
filter_context & | fc, | ||
unit_map & | units, | ||
std::vector< boost::shared_ptr< const game_events::wml_menu_item > > & | items, | ||
std::vector< std::string > & | descriptions | ||
) |
Adds the currently paged range of menu items to the given lists.
List of menu item descriptions
hex | Game hex related to this context menu |
units | Data needed to create scoped objects when evaluating wml filters |
items | List of accumulated menu items so far. |
Definition at line 84 of file wmi_pager.cpp.
References add_next_page_item(), add_prev_page_item(), game_events::wmi_container::get_items(), preferences::max_wml_menu_items(), page_num_, select_first(), select_second(), and wmi_container_.
|
inline |
Updates the internal wmi_container pointer.
Definition at line 47 of file wmi_pager.hpp.
|
private |
Current page number.
Definition at line 41 of file wmi_pager.hpp.
Referenced by capture(), and get_items().
|
private |
Internal pointer to the collection of wml menu items.
Definition at line 42 of file wmi_pager.hpp.
Referenced by get_items().