Mass++ Common Libraries v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations Macros
Selector.h
Go to the documentation of this file.
1 
12 #ifndef __KOME_CORE_SELECTOR_H__
13 #define __KOME_CORE_SELECTOR_H__
14 
15 
16 #include <string>
17 #include <vector>
18 #include <utility>
19 
20 
21 namespace kome {
22  namespace core {
23 
28  class CORE_TOOLKITS_CLASS Selector {
29  public:
34  Selector();
35 
40  virtual ~Selector();
41 
42  protected:
44  std::vector< std::pair< std::string, std::string > > m_items;
45 
47  std::vector< bool > m_selected;
48 
50  int m_sel;
51 
52  public:
57  void clearItems();
58 
64  void addItem( const char* name );
65 
72  void addItem( const char* name, const char* value );
73 
79  unsigned int getNumberOfItems();
80 
87  const char* getItemName( const unsigned int index );
88 
95  const char* getItemValue( const unsigned int index );
96 
103  bool isSelected( const unsigned int index );
104 
110  int getSelection();
111 
117  bool select();
118 
119  protected:
134  virtual bool onSelect(
135  const unsigned int num,
136  const char** items,
137  const char** values,
138  bool* selected
139  ) = 0;
140  };
141  }
142 }
143 
144 
145 #endif // __KOME_CORE_SELECTOR_H__
std::vector< bool > m_selected
Definition: Selector.h:47
std::vector< std::pair< std::string, std::string > > m_items
Definition: Selector.h:44
selector class
Definition: Selector.h:28