update members of cached dropdown menu, this fixes #13

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1583 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2011-01-06 22:37:00 +00:00
parent f086f21084
commit a1f4cd19ee
+6 -2
View File
@@ -108,7 +108,7 @@ struct DropDownWordListItem {
WordListWordP word;
String name;
int flags;
DropDownListP submenu;
DropDownWordListP submenu;
inline bool active() const { return flags & FLAG_ACTIVE; }
inline void setActive(bool a) { flags = (flags & ~FLAG_ACTIVE) | a * FLAG_ACTIVE; }
@@ -238,7 +238,11 @@ void DropDownWordList::drawIcon(DC& dc, int x, int y, size_t item, bool selected
DropDownList* DropDownWordList::submenu(size_t item) const {
DropDownWordListItem& i = items[item];
if (i.submenu) return i.submenu.get();
if (i.submenu) {
// make sure the members of the submenu are still up to date (in particular the pos, see #13)
i.submenu->pos = pos;
return i.submenu.get();
}
if (i.flags & FLAG_SUBMENU) {
// create submenu?
if (!i.submenu) {