The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
wmi_pager Class Reference

#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_containerwmi_container_
 Internal pointer to the collection of wml menu items. More...
 

Detailed Description

Definition at line 39 of file wmi_pager.hpp.

Constructor & Destructor Documentation

wmi_pager::wmi_pager ( )
inline

Definition at line 45 of file wmi_pager.hpp.

Member Function Documentation

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

Parameters
hexGame hex related to this context menu
unitsData needed to create scoped objects when evaluating wml filters
itemsList 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_.

void wmi_pager::update_ref ( game_events::wmi_container ptr)
inline

Updates the internal wmi_container pointer.

Definition at line 47 of file wmi_pager.hpp.

Member Data Documentation

int wmi_pager::page_num_
private

Current page number.

Definition at line 41 of file wmi_pager.hpp.

Referenced by capture(), and get_items().

const game_events::wmi_container* wmi_pager::wmi_container_
private

Internal pointer to the collection of wml menu items.

Definition at line 42 of file wmi_pager.hpp.

Referenced by get_items().


The documentation for this class was generated from the following files: