Menu Class Reference

#include <menu.h>

Inheritance diagram for Menu:

Inheritance graph
[legend]
Collaboration diagram for Menu:

Collaboration graph
[legend]

List of all members.

Public Types

enum  cycle { CYCLE_NONE, CYCLE_TOGGLE, CYCLE_CYCLE }
enum  action { ACT_EXECUTE, ACT_EXAMINE, ACT_MISC, ACT_NUM }
typedef std::string(* selitem_tfn )(const std::vector< MenuEntry * > *sel)
typedef void(* drawitem_tfn )(int index, const MenuEntry *me)
typedef int(* keyfilter_tfn )(int keyin)

Public Member Functions

 Menu (int flags=MF_MULTISELECT, const std::string &tagname="", bool text_only=true)
 Menu (const formatted_string &fs)
virtual ~Menu ()
void clear ()
void set_flags (int new_flags, bool use_options=true)
int get_flags () const
virtual bool is_set (int flag) const
void set_tag (const std::string &t)
bool draw_title_suffix (const std::string &s, bool titlefirst=true)
bool draw_title_suffix (const formatted_string &fs, bool titlefirst=true)
void update_title ()
void set_more (const formatted_string &more)
const formatted_stringget_more () const
void set_highlighter (MenuHighlighter *h)
void set_title (MenuEntry *e, bool first=true)
void add_entry (MenuEntry *entry)
void get_selected (std::vector< MenuEntry * > *sel) const
virtual int get_cursor () const
void set_maxpagesize (int max)
int maxpagesize () const
void set_select_filter (std::vector< text_pattern > filter)
unsigned char getkey () const
void reset ()
std::vector< MenuEntry * > show (bool reuse_selections=false)
std::vector< MenuEntry * > selected_entries () const
size_t item_count () const
int get_entry_index (const MenuEntry *e) const
virtual int item_colour (int index, const MenuEntry *me) const
int get_y_offset () const
int get_pagesize () const

Public Attributes

selitem_tfn f_selitem
drawitem_tfn f_drawitem
keyfilter_tfn f_keyfilter
enum Menu::cycle action_cycle
enum Menu::action menu_action

Protected Member Functions

void check_add_formatted_line (int firstcol, int nextcol, std::string &line, bool check_eol)
void do_menu ()
virtual void draw_select_count (int count, bool force=false)
virtual void draw_item (int index) const
virtual void draw_index_item (int index, const MenuEntry *me) const
virtual void draw_stock_item (int index, const MenuEntry *me) const
virtual void draw_title ()
virtual void write_title ()
virtual void draw_menu ()
virtual bool page_down ()
virtual bool line_down ()
virtual bool page_up ()
virtual bool line_up ()
virtual int pre_process (int key)
virtual int post_process (int key)
bool in_page (int index) const
void deselect_all (bool update_view=true)
virtual void select_items (int key, int qty=-1)
void select_item_index (int idx, int qty, bool draw_cursor=true)
void select_index (int index, int qty=-1)
bool is_hotkey (int index, int key)
virtual bool is_selectable (int index) const
virtual bool process_key (int keyin)

Protected Attributes

MenuEntrytitle
MenuEntrytitle2
int flags
std::string tag
int first_entry
int y_offset
int pagesize
int max_pagesize
formatted_string more
std::vector< MenuEntry * > items
std::vector< MenuEntry * > sel
std::vector< text_patternselect_filter
MenuHighlighterhighlighter
int num
unsigned char lastch
bool alive
int last_selected
MenuDisplaymdisplay


Member Typedef Documentation

typedef std::string(* Menu::selitem_tfn)(const std::vector< MenuEntry * > *sel)

typedef void(* Menu::drawitem_tfn)(int index, const MenuEntry *me)

typedef int(* Menu::keyfilter_tfn)(int keyin)


Member Enumeration Documentation

Enumerator:
CYCLE_NONE 
CYCLE_TOGGLE 
CYCLE_CYCLE 

Enumerator:
ACT_EXECUTE 
ACT_EXAMINE 
ACT_MISC 
ACT_NUM 


Constructor & Destructor Documentation

Menu::Menu ( int  flags = MF_MULTISELECT,
const std::string tagname = "",
bool  text_only = true 
)

Here is the call graph for this function:

Menu::Menu ( const formatted_string fs  ) 

Here is the call graph for this function:

Menu::~Menu (  )  [virtual]


Member Function Documentation

void Menu::clear (  ) 

void Menu::set_flags ( int  new_flags,
bool  use_options = true 
)

int Menu::get_flags (  )  const [inline]

bool Menu::is_set ( int  flag  )  const [virtual]

void Menu::set_tag ( const std::string t  )  [inline]

bool Menu::draw_title_suffix ( const std::string s,
bool  titlefirst = true 
)

Here is the call graph for this function:

bool Menu::draw_title_suffix ( const formatted_string fs,
bool  titlefirst = true 
)

Here is the call graph for this function:

void Menu::update_title (  ) 

Here is the call graph for this function:

void Menu::set_more ( const formatted_string more  ) 

const formatted_string& Menu::get_more (  )  const [inline]

void Menu::set_highlighter ( MenuHighlighter h  ) 

void Menu::set_title ( MenuEntry e,
bool  first = true 
)

Reimplemented in InvMenu.

void Menu::add_entry ( MenuEntry entry  ) 

void Menu::get_selected ( std::vector< MenuEntry * > *  sel  )  const

int Menu::get_cursor (  )  const [virtual]

Here is the call graph for this function:

void Menu::set_maxpagesize ( int  max  ) 

int Menu::maxpagesize (  )  const [inline]

void Menu::set_select_filter ( std::vector< text_pattern filter  )  [inline]

unsigned char Menu::getkey (  )  const [inline]

Reimplemented in InvMenu, and StashMenu.

void Menu::reset (  ) 

std::vector< MenuEntry * > Menu::show ( bool  reuse_selections = false  ) 

Here is the call graph for this function:

std::vector< MenuEntry * > Menu::selected_entries (  )  const

Here is the call graph for this function:

size_t Menu::item_count (  )  const [inline]

int Menu::get_entry_index ( const MenuEntry e  )  const

int Menu::item_colour ( int  index,
const MenuEntry me 
) const [virtual]

Here is the call graph for this function:

int Menu::get_y_offset (  )  const [inline]

int Menu::get_pagesize (  )  const [inline]

void Menu::check_add_formatted_line ( int  firstcol,
int  nextcol,
std::string line,
bool  check_eol 
) [protected]

Here is the call graph for this function:

void Menu::do_menu (  )  [protected]

Here is the call graph for this function:

void Menu::draw_select_count ( int  count,
bool  force = false 
) [protected, virtual]

Here is the call graph for this function:

void Menu::draw_item ( int  index  )  const [protected, virtual]

Here is the call graph for this function:

void Menu::draw_index_item ( int  index,
const MenuEntry me 
) const [protected, virtual]

Reimplemented in formatted_scroller.

Here is the call graph for this function:

void Menu::draw_stock_item ( int  index,
const MenuEntry me 
) const [protected, virtual]

Here is the call graph for this function:

void Menu::draw_title (  )  [protected, virtual]

Reimplemented in ShoppingListMenu, StashMenu, and StashSearchMenu.

Here is the call graph for this function:

void Menu::write_title (  )  [protected, virtual]

Here is the call graph for this function:

void Menu::draw_menu (  )  [protected, virtual]

Here is the call graph for this function:

bool Menu::page_down (  )  [protected, virtual]

Reimplemented in formatted_scroller.

bool Menu::line_down (  )  [protected, virtual]

Reimplemented in formatted_scroller.

bool Menu::page_up (  )  [protected, virtual]

Reimplemented in formatted_scroller.

bool Menu::line_up (  )  [protected, virtual]

Reimplemented in formatted_scroller.

int Menu::pre_process ( int  key  )  [protected, virtual]

Reimplemented in ToggleableMenu.

int Menu::post_process ( int  key  )  [protected, virtual]

bool Menu::in_page ( int  index  )  const [protected]

void Menu::deselect_all ( bool  update_view = true  )  [protected]

Here is the call graph for this function:

void Menu::select_items ( int  key,
int  qty = -1 
) [protected, virtual]

Here is the call graph for this function:

void Menu::select_item_index ( int  idx,
int  qty,
bool  draw_cursor = true 
) [protected]

Here is the call graph for this function:

void Menu::select_index ( int  index,
int  qty = -1 
) [protected]

Here is the call graph for this function:

bool Menu::is_hotkey ( int  index,
int  key 
) [protected]

Here is the call graph for this function:

bool Menu::is_selectable ( int  index  )  const [protected, virtual]

Reimplemented in InvMenu.

bool Menu::process_key ( int  keyin  )  [protected, virtual]

Reimplemented in InvMenu, formatted_scroller, StashMenu, and StashSearchMenu.

Here is the call graph for this function:


Member Data Documentation

MenuEntry* Menu::title [protected]

MenuEntry* Menu::title2 [protected]

int Menu::flags [protected]

std::string Menu::tag [protected]

int Menu::first_entry [protected]

int Menu::y_offset [protected]

int Menu::pagesize [protected]

int Menu::max_pagesize [protected]

std::vector<MenuEntry*> Menu::items [protected]

std::vector<MenuEntry*> Menu::sel [protected]

std::vector<text_pattern> Menu::select_filter [protected]

int Menu::num [protected]

unsigned char Menu::lastch [protected]

bool Menu::alive [protected]

int Menu::last_selected [protected]


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

Generated on Thu Jan 13 13:36:54 2011 by  doxygen 1.5.6