Skip to content

Commit

Permalink
修复当使用RemoteAt删除子控件时,选中索引没有重新计算的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
smallevilbeast committed Jun 27, 2019
1 parent 5418cab commit fed1569
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tool_kits/duilib/Box/TabBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ bool TabBox::Remove(Control* pControl)
return ret;
}

bool TabBox::RemoveAt(std::size_t iIndex)
{
Control* pControl = GetItemAt(iIndex);
if (pControl == NULL) return false;
return Remove(pControl);
}

void TabBox::RemoveAll()
{
m_iCurSel = -1;
Expand Down
1 change: 1 addition & 0 deletions tool_kits/duilib/Box/TabBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class UILIB_API TabBox : public Box
virtual bool Add(Control* pControl) override;
virtual bool AddAt(Control* pControl, std::size_t iIndex) override;
virtual bool Remove(Control* pControl) override;
virtual bool RemoveAt(std::size_t iIndex) override;
virtual void RemoveAll() override;
virtual void SetAttribute(const std::wstring& strName, const std::wstring& strValue) override;

Expand Down

0 comments on commit fed1569

Please sign in to comment.