Example #1
0
void CSearchWnd::OnUpdateSearchPanel(CCmdUI* /*pCmdUI*/)
{
    CCoolBarItem* pItem = m_wndToolBar.GetID( ID_SEARCH_PANEL );
    CString strText;
    LoadString( strText, m_bPanel ? IDS_SEARCH_PANEL_HIDE : IDS_SEARCH_PANEL_SHOW );
    pItem->SetTip( strText );
    pItem->SetCheck( m_bPanel );
}
Example #2
0
void CPlayerWnd::OnUpdateNetworkConnect(CCmdUI* pCmdUI) 
{
	HINSTANCE hPrevInst = AfxGetResourceHandle();
	AfxSetResourceHandle( m_hInstance );

	CCoolBarItem* pItem = m_wndHeaderBar.GetID( ID_NETWORK_CONNECT );
	
	UINT nTextID = 0;
	UINT nTipID = 0;
	
	if ( FALSE )
	{
		if ( pItem ) pItem->SetCheck( TRUE );
		if ( pItem ) pItem->SetTextColour( CoolInterface.m_crCmdText == 0 ? RGB( 255, 0, 0 ) : CoolInterface.m_crCmdText );
		nTextID	= IDS_NETWORK_DISCONNECT;
		nTipID	= ID_NETWORK_DISCONNECT;
	}
	else
	{
		if ( pItem ) pItem->SetCheck( FALSE );
		if ( pItem ) pItem->SetTextColour( CoolInterface.m_crCmdText == 0 ? RGB( 0, 127, 0 ) : CoolInterface.m_crCmdText );
		nTextID	= IDS_NETWORK_CONNECT;
		nTipID	= ID_NETWORK_CONNECT;
	}

	CString strText;
	
	LoadString( strText, nTextID );
	if ( pItem ) pItem->SetText( strText );
	
	LoadString( strText, nTipID );
	if ( pItem ) pItem->SetTip( strText );
	
	if ( pItem ) pItem->SetImage( nTipID );
	
	AfxSetResourceHandle( hPrevInst );
}