void wxPageContainer::OnMouseLeave(wxMouseEvent& event) { m_nLeftButtonStatus = wxFNB_BTN_NONE; m_nXButtonStatus = wxFNB_BTN_NONE; m_nRightButtonStatus = wxFNB_BTN_NONE; m_nTabXButtonStatus = wxFNB_BTN_NONE; m_nArrowDownButtonStatus = wxFNB_BTN_NONE; /// Patch (m_nTabStatus) ---- Ti-R ---- Refresh on leave to do not keep the preview if(m_nTabStatus == wxFNB_BTN_HOVER) { m_nTabPreviewId=-1; Refresh(); } m_nTabStatus = wxFNB_BTN_NONE; long style = GetParent()->GetWindowStyleFlag(); wxFNBRendererPtr render = wxFNBRendererMgrST::Get()->GetRenderer(style); wxClientDC dc(this); render->DrawX(this, dc); render->DrawLeftArrow(this, dc); render->DrawRightArrow(this, dc); if(GetSelection() != -1 && IsTabVisible((size_t)GetSelection())) { render->DrawTabX(this, dc, m_pagesInfoVec[GetSelection()].GetXRect(), GetSelection(), m_nTabXButtonStatus); } event.Skip(); }
void wxPageContainer::DoSetSelection(size_t page) { // Make sure that the selection is visible if(page < m_pagesInfoVec.GetCount()) { //! fix for tabfocus wxWindow* da_page = ((wxFlatNotebook *)m_pParent)->GetPage(page); if ( da_page!=NULL ) da_page->SetFocus(); } if( !IsTabVisible(page) ) { // Try to remove one tab from start and try again if( !CanFitToScreen(page) ) { if( m_nFrom > (int)page ) m_nFrom = (int)page; else { while( m_nFrom < (int)page ) { m_nFrom++; if( CanFitToScreen(page) ) break; } } } } else { } PushPageHistory((int)page); Refresh(); }
void wxPageContainer::OnMouseLeave(wxMouseEvent& event) { m_nLeftButtonStatus = wxFNB_BTN_NONE; m_nXButtonStatus = wxFNB_BTN_NONE; m_nRightButtonStatus = wxFNB_BTN_NONE; m_nTabXButtonStatus = wxFNB_BTN_NONE; m_nArrowDownButtonStatus = wxFNB_BTN_NONE; long style = GetParent()->GetWindowStyleFlag(); wxFNBRendererPtr render = wxFNBRendererMgrST::Get()->GetRenderer(style); wxClientDC dc(this); render->DrawX(this, dc); render->DrawLeftArrow(this, dc); render->DrawRightArrow(this, dc); if(GetSelection() != -1 && IsTabVisible((size_t)GetSelection())) { render->DrawTabX(this, dc, m_pagesInfoVec[GetSelection()].GetXRect(), GetSelection(), m_nTabXButtonStatus); } event.Skip(); }
void wxPageContainer::DoSetSelection(size_t page) { // Make sure that the selection is visible if(page < m_pagesInfoVec.GetCount()) { //! fix for tabfocus wxWindow* da_page = ((wxFlatNotebook *)m_pParent)->GetPage(page); if ( da_page!=NULL ) da_page->SetFocus(); } if( !IsTabVisible(page) ) { FNB_LOG_MSG( wxT("Tab ") << (int)page << wxT(" is not visible")); FNB_LOG_MSG( wxT("m_nFrom=") << m_nFrom << wxT(", Selection=") << (int)page ); // Try to remove one tab from start and try again if( !CanFitToScreen(page) ) { if( m_nFrom > (int)page ) m_nFrom = (int)page; else { while( m_nFrom < (int)page ) { m_nFrom++; if( CanFitToScreen(page) ) break; } } FNB_LOG_MSG( wxT("Adjusting m_nFrom to=") << m_nFrom); } } else { FNB_LOG_MSG( wxT("Tab ") << (int)page << wxT(" is visible")); } Refresh(); }
void HeaderCtrl::Serialize(Stream& s) { int version = 0x04; s / version; if(version >= 0x04) { int n = col.GetCount(); s / n; Array<Column> col2 = clone(col); if(s.IsLoading()) col2.InsertN(0, n); for(int i = 0; i < n; i++) { int ndx = col2[i].index; s % ndx; if(s.IsLoading()) for(int j = n; j < col2.GetCount(); j++) if(col2[j].index == ndx) { col2.Swap(i, j); break; } col2[i].index = ndx; s % col2[i].ratio; s % col2[i].visible; } if(s.IsLoading() && n == col.GetCount()) { col2.Trim(n); col = pick(col2); } } else if(version < 0x01) { int n = col.GetCount(); s / n; for(int i = 0; i < n; i++) if(i < col.GetCount()) { int n = 1; s / n; col[i].ratio = n; } else { int dummy = 0; s / dummy; } } else { int n = col.GetCount(); s / n; if(version < 0x02) for(int i = 0; i < n; i++) if(i < col.GetCount()) s % col[i].ratio; else { int dummy = 0; s % dummy; } else { int t = 0; for(int i = 0; i < n; i++) { if(n == col.GetCount()) { int ndx = col[i].index; double r = col[i].ratio; s % ndx; s % r; int q = FindIndex(ndx); if(q >= 0) { col[q].ratio = r; col.Swap(t++, q); } if(version >= 0x03) { bool visible = IsTabVisible(i); s % visible; if(i < GetCount()) ShowTab(i, visible); } } else { int dummy = 0; double dummy2 = 1.0; bool dummy3 = false; s % dummy; s % dummy2; if(version >= 0x03) s % dummy3; } } } } if(s.IsLoading()) { ReCompute(); Refresh(); WhenLayout(); } }