//------------------------------------------------------------------------------ BOOL CNetscapeStatusBar::CreateDefaultPanes() { if( m_bSecurityStatus ) { if( !SetIndicators( pPaneIndicators, sizeof(pPaneIndicators)/sizeof(UINT) ) ) return FALSE; } else { if( !SetIndicators( pPaneIndicators + 1, sizeof(pPaneIndicators)/sizeof(UINT) - 1 ) ) return FALSE; } return TRUE; }
// called to add panes to the status bar BOOL CStatusBarACT::SetPanes(LPSBACTPANEINFO lpsbactpi, UINT nPaneInfoCount) { if (lpsbactpi == NULL || nPaneInfoCount <= 0) { return FALSE; } // first set the standard info (IDs) UINT* anIDs = new UINT[nPaneInfoCount]; UINT n; for (n = 0; n < nPaneInfoCount; n++) { anIDs[n] = lpsbactpi[n].nID; } BOOL bResult = SetIndicators(anIDs, nPaneInfoCount); delete [] anIDs; // now set our info for (n = 0; n < nPaneInfoCount; n++) { if (lpsbactpi[n].dwFlags & SBACTF_RESOURCETIP) { SetPaneTooltip(lpsbactpi[n].nID, (UINT)lpsbactpi[n].lpszTip); } else { SetPaneTooltip(lpsbactpi[n].nID, lpsbactpi[n].lpszTip); } SetPaneFlags(lpsbactpi[n].nID, lpsbactpi[n].dwFlags); SetPaneCursor(lpsbactpi[n].nID, lpsbactpi[n].lpszCursor); } return bResult; }
void CPmwStatusBar::SetEditPanes(void) { SetIndicators(uIndicatorIDs, sizeof(uIndicatorIDs)/sizeof(UINT)); // Set up the panes. UINT uID; UINT uStyle; int nWidth; GetPaneInfo(0, uID, uStyle, nWidth); SetPaneInfo(0, uID, uStyle, 1); #ifdef WIN32 UINT uAddedStyle = SBT_OWNERDRAW; #else UINT uAddedStyle = 0; #endif GetPaneInfo(1, uID, uStyle, nWidth); SetPaneInfo(1, uID, (uStyle|uAddedStyle), nWidth + m_Indicators[0].m_Size.cx + 2); GetPaneInfo(2, uID, uStyle, nWidth); SetPaneInfo(2, uID, (uStyle|uAddedStyle), nWidth + m_Indicators[1].m_Size.cx + 2); GetPaneInfo(3, uID, uStyle, nWidth); SetPaneInfo(3, uID, (uStyle|uAddedStyle), nWidth + m_Indicators[2].m_Size.cx + 2); }
void MPCStatusBar::RemovePane(int nPaneID) { SetRedraw(FALSE); CWnd * pwnd = NULL; int i; for( i = 0; i < m_aPans.GetSize(); i++ ) { if( m_aPans[i]->m_nPaneID == nPaneID ) { if( m_aPans[i]->m_bAutodelete ) pwnd = m_aPans[i]->m_hWnd; delete m_aPans[i]; m_aPans.RemoveAt(i); break; } } if( pwnd ) { pwnd->DestroyWindow(); delete pwnd; } CArray<MPCStatusBarPane,MPCStatusBarPane> arPanes; MPCStatusBarPane statusPane; i = 0; while( GetStatusPane(i,statusPane) ) { if( statusPane.nID != (UINT)nPaneID ) arPanes.Add( statusPane ); i++; } // Now remove the indicator UINT * pIndicators = new UINT[arPanes.GetSize()]; for(i=0;i<arPanes.GetSize();i++) pIndicators[i]=arPanes[i].nID; SetIndicators(pIndicators,arPanes.GetSize()); // Replace infos of indicators .. for(i = 0; i < arPanes.GetSize(); i++ ) { SetPaneInfo(i,arPanes[i].nID,arPanes[i].nStyle,arPanes[i].cxText); SetPaneText(i,arPanes[i].strText); } delete pIndicators; SetRedraw(TRUE); PositionControls(); Invalidate(TRUE); }
void CPmwStatusBar::SetPreviewPanes(void) { SetIndicators(uIndicatorIDs, 1); // Set up the panes. UINT uID; UINT uStyle; int nWidth; GetPaneInfo(0, uID, uStyle, nWidth); SetPaneInfo(0, uID, uStyle, 1); #if 0 SetPaneInfo(1, 0, 0, 0); SetPaneInfo(2, 0, 0, 0); SetPaneInfo(3, 0, 0, 0); #endif }
BOOL MPCStatusBar::AddIndicator( int position, UINT paneID ) { CArray<MPCStatusBarPane,MPCStatusBarPane> arPanes; MPCStatusBarPane statusPane; int i; i = 0; while( GetStatusPane(i,statusPane) ) { arPanes.Add( statusPane ); i++; } if( position < 0 ) position = 0; if( position > arPanes.GetSize() ) position = arPanes.GetSize()-1; for(i = 0; i < arPanes.GetSize(); i ++ ) { if( paneID == arPanes[i].nID ) { TRACE(_T("XFXStatusBar::AddIndicator(): Pane ID already exists \n")); return FALSE; } } MPCStatusBarPane new_statusPane; new_statusPane.nID = paneID; if( arPanes.GetSize() ) arPanes.InsertAt(position,new_statusPane); else arPanes.Add(new_statusPane); UINT * pIndicators = new UINT[arPanes.GetSize()]; for(i=0;i<arPanes.GetSize();i++) pIndicators[i]=arPanes[i].nID; SetRedraw(FALSE); SetIndicators(pIndicators,arPanes.GetSize()); // Replace infos of indicators .. for(i = 0; i < arPanes.GetSize(); i++ ) { if( arPanes[i].nID != paneID ) { SetPaneInfo(i,arPanes[i].nID,arPanes[i].nStyle,arPanes[i].cxText); SetPaneText(i,arPanes[i].strText); } else { SetPaneWidth(i,50); SetPaneText(i,arPanes[i].strText); } } delete pIndicators; SetRedraw(TRUE); PositionControls(); Invalidate(TRUE); return TRUE; }