本文整理汇总了C++中CCoolBarItem::SetText方法的典型用法代码示例。如果您正苦于以下问题:C++ CCoolBarItem::SetText方法的具体用法?C++ CCoolBarItem::SetText怎么用?C++ CCoolBarItem::SetText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCoolBarItem
的用法示例。
在下文中一共展示了CCoolBarItem::SetText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetMenu
void CCoolMenuBarCtrl::SetMenu(HMENU hMenu)
{
m_hMenu = hMenu;
Clear();
if ( ! m_hMenu ) return;
CMenu pMenu;
pMenu.Attach( m_hMenu );
for ( UINT nItem = 0 ; nItem < pMenu.GetMenuItemCount() ; nItem++ )
{
CString strMenu;
pMenu.GetMenuString( nItem, strMenu, MF_BYPOSITION );
int nAmp = strMenu.Find( '&' );
if ( nAmp >= 0 ) strMenu = strMenu.Left( nAmp ) + strMenu.Mid( nAmp + 1 );
CCoolBarItem* pItem = new CCoolBarItem( this, nItem + 1 );
pItem->SetText( _T(" ") + strMenu + _T(" ") );
m_pItems.AddTail( pItem );
}
pMenu.Detach();
}
示例2: OnUpdateMediaRecord
void CMonitorWnd::OnUpdateMediaRecord(CCmdUI* pCmdUI)
{
pCmdUI->Enable( m_wndChild.m_pSelected != 0 );
HINSTANCE hPrevInst = AfxGetResourceHandle();
AfxSetResourceHandle( m_hInstance );
CCoolBarItem* pItem = m_wndBottom.GetID( ID_MEDIA_RECORD );
UINT nTextID = 0;
UINT nTipID = 0;
CNetworkThumb* pWindow = m_wndChild.m_pSelected;
if ( pWindow && pWindow->IsRecording() )
{
if ( pItem ) pItem->SetTextColour( RGB( 255, 0, 0 ) );
nTextID = IDS_MEDIA_RECORDING;
nTipID = ID_MEDIA_REC_STOP;
}
else if ( pItem )
{
if ( pItem->m_bEnabled )
pItem->SetTextColour( CoolInterface.m_crCmdText );
else
pItem->SetTextColour( CoolInterface.m_crDisabled );
nTextID = IDS_MEDIA_RECORD;
nTipID = ID_MEDIA_RECORD;
}
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 );
}
示例3: Add
CCoolBarItem* CCoolBarCtrl::Add(UINT nID, LPCTSTR pszText, int nPosition)
{
CCoolBarItem* pItem = new CCoolBarItem( this, nID );
if ( nPosition == -1 )
{
m_pItems.AddTail( pItem );
}
else
{
POSITION pos = m_pItems.FindIndex( nPosition );
if ( pos ) m_pItems.InsertBefore( pos, pItem ); else m_pItems.AddTail( pItem );
}
pItem->m_nImage = CoolInterface.ImageForID( nID );
if ( pszText ) pItem->SetText( pszText );
return pItem;
}
示例4: OnUpdateNetworkConnect
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 );
}