if (index == m_selected && m_content)
m_selected = m_content->cursorGet();
- moveSelection(justCheck);
+ if (m_content && m_content->cursorGet() >= m_content->size())
+ moveSelection(moveUp);
+ else
+ moveSelection(justCheck);
if ((m_top <= index) && (index < (m_top + m_items_per_page)))
{
int s = size();
if ( m_cursor >= s )
m_listbox->moveSelectionTo(s?s-1:0);
- m_listbox->invalidate();
+ else
+ m_listbox->invalidate();
}
}
else
m_old_clip = m_clip = gRegion::invalidRegion();
}
+
+void eListboxPythonMultiContent::entryRemoved(int idx)
+{
+ if (m_listbox)
+ m_listbox->entryRemoved(idx);
+}
void setItemHeight(int height);
void setSelectionClip(eRect &rect, bool update=false);
void updateClip(gRegion &);
+ void entryRemoved(int idx);
private:
std::map<int, ePtr<gFont> > m_font;
};
def invalidate(self):
self.l.invalidate()
+
+ def entryRemoved(self, idx):
+ self.l.entryRemoved(idx)
+
self.refill()
def refill(self):
+ oldsize = len(self.list)
self.fillTimerList()
- self["timerlist"].invalidate()
+ lst = self["timerlist"]
+ newsize = len(self.list)
+ if oldsize and oldsize != newsize:
+ idx = lst.getCurrentIndex()
+ lst.entryRemoved(idx)
+ else:
+ lst.invalidate()
def addCurrentTimer(self):
event = None