31 virtual const char *
popName(
int n) = 0;
50 static const char*
PopName(
void *inst,
int n)
72 virtual size_t count(
void) = 0;
74 virtual const char *
name(
int n) = 0;
77 static size_t countFn (
void *inst);
79 static char*
nameFn (
void *inst,
int n);
92 popupEntry(
const char *_title, C _value) : name(_title), value(_value) {;}
93 const char *getName()
const {
return name;}
94 C getValue()
const {
return value;}
95 bool equals(C _value) {
return value == _value;}
98 std::vector< popupEntry<T> > Entries;
103 return Entries.size();
107 if (n < 0)
return "(none)";
108 else return Entries.at(n).getName();
116 Entries.push_back(popupEntry<T>(entry,
id));
120 return Entries.at(n).getValue();
125 for (
size_t n = 0; n < Entries.size(); ++n)
127 if (Entries.at(n).equals(val))
return n;
140 T *pcc =
static_cast<T *
>(xpf.
getUserData(pan, cid));
141 if (pcc) pcc->popCommand(cid, cmd);
146 template <
typename T>
154 T *puc =
static_cast<T *
>(inst);
155 return puc->popCount();
164 T *puc =
static_cast<T *
>(inst);
165 return puc->popName(n);
171 #endif // LWPP_WRAPPER_H