void ListBox::setItemText(int index, const TCHAR *str) { int si = getSelectedIndex(); int top = getTopIndex(); LRESULT lresult = SendMessage(m_hwnd, LB_GETTOPINDEX, NULL, NULL); UINT topIndex = (UINT)lresult; _ASSERT(topIndex == lresult); LPARAM data = getItemData(index); removeString(index); insertString(index, str, data); if (si == index) { setSelectedIndex(si); } setTopIndex(top); }
void ListBox::removeString(int index) { int top = getTopIndex(); SendMessage(m_hwnd, LB_DELETESTRING, index, NULL); setTopIndex(top); }
Item const& getTop() const { return this->itemVector[getTopIndex()]; }
ID getTopID() const { return this->pol.getIDByIndex(getTopIndex()); }
Item& getTop() { return this->itemVector[getTopIndex()]; }