fixed notebook tabs refresh when changing them under wxGTK
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12707 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -212,15 +212,21 @@ int wxNotebook::SetSelection(int nPage)
|
|||||||
return m_sel;
|
return m_sel;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_sel != INVALID_PAGE )
|
// we need to change m_sel first, before calling RefreshTab() below as
|
||||||
{
|
// otherwise the previously selected tab wouldn't be redrawn properly under
|
||||||
RefreshTab(m_sel);
|
// wxGTK which calls Refresh() immediately and not during the next event
|
||||||
|
// loop iteration as wxMSW does and as it should
|
||||||
m_pages[m_sel]->Hide();
|
size_t selOld = m_sel;
|
||||||
}
|
|
||||||
|
|
||||||
m_sel = nPage;
|
m_sel = nPage;
|
||||||
|
|
||||||
|
if ( selOld != INVALID_PAGE )
|
||||||
|
{
|
||||||
|
RefreshTab(selOld, TRUE /* this tab was selected */);
|
||||||
|
|
||||||
|
m_pages[selOld]->Hide();
|
||||||
|
}
|
||||||
|
|
||||||
if ( m_sel != INVALID_PAGE ) // this is impossible - but test nevertheless
|
if ( m_sel != INVALID_PAGE ) // this is impossible - but test nevertheless
|
||||||
{
|
{
|
||||||
if ( HasSpinBtn() )
|
if ( HasSpinBtn() )
|
||||||
@@ -421,12 +427,12 @@ void wxNotebook::RefreshCurrent()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxNotebook::RefreshTab(int page)
|
void wxNotebook::RefreshTab(int page, bool forceSelected)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( IS_VALID_PAGE(page), _T("invalid notebook page") );
|
wxCHECK_RET( IS_VALID_PAGE(page), _T("invalid notebook page") );
|
||||||
|
|
||||||
wxRect rect = GetTabRect(page);
|
wxRect rect = GetTabRect(page);
|
||||||
if ( (size_t)page == m_sel )
|
if ( forceSelected || ((size_t)page == m_sel) )
|
||||||
{
|
{
|
||||||
const wxSize indent = GetRenderer()->GetTabIndent();
|
const wxSize indent = GetRenderer()->GetTabIndent();
|
||||||
rect.Inflate(indent.x, indent.y);
|
rect.Inflate(indent.x, indent.y);
|
||||||
|
Reference in New Issue
Block a user