mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user