mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
card viewers/editors inherit from wxPanel;
GallertList doesn't call select() from onSize git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1139 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -72,8 +72,17 @@ void GalleryList::select(size_t item, size_t subcolumn, bool event) {
|
||||
}
|
||||
|
||||
void GalleryList::update() {
|
||||
select(subcolumns[active_subcolumn].selection);
|
||||
updateScrollbar();
|
||||
// ensure selection is visible
|
||||
SubColumn col = subcolumns[active_subcolumn];
|
||||
if (col.selection != NO_SELECTION) {
|
||||
if (itemStart(col.selection) < visible_start) {
|
||||
scrollTo(itemStart(col.selection), false);
|
||||
updateScrollbar();
|
||||
} else if (itemEnd(col.selection) > visibleEnd()) {
|
||||
scrollTo(itemEnd(col.selection) + visible_start - visibleEnd(), false);
|
||||
updateScrollbar();
|
||||
}
|
||||
}
|
||||
Refresh(false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user