本文整理汇总了C++中ChatPanel::SetChannel方法的典型用法代码示例。如果您正苦于以下问题:C++ ChatPanel::SetChannel方法的具体用法?C++ ChatPanel::SetChannel怎么用?C++ ChatPanel::SetChannel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChatPanel
的用法示例。
在下文中一共展示了ChatPanel::SetChannel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RejoinChannels
void MainChatTab::RejoinChannels()
{
for ( unsigned int i = 0; i < m_chat_tabs->GetPageCount(); i++ )
{
ChatPanel* tmp = ( ChatPanel* )m_chat_tabs->GetPage( i );
if ( tmp->GetPanelType() == CPT_Channel )
{
// TODO: This will not rejoin passworded channels.
wxString name = m_chat_tabs->GetPageText( i );
bool alreadyin = false;
try
{
serverSelector().GetServer().GetChannel( name ).GetMe();
alreadyin = true;
}
catch ( ... ) {}
if ( !alreadyin )
{
serverSelector().GetServer().JoinChannel( name, _T( "" ) );
tmp->SetChannel( &serverSelector().GetServer().GetChannel( name ) );
}
} else if ( tmp->GetPanelType() == CPT_User )
{
wxString name = m_chat_tabs->GetPageText( i );
if ( serverSelector().GetServer().UserExists( name ) ) tmp->SetUser( &serverSelector().GetServer().GetUser( name ) );
}
}
}
示例2: LeaveChannels
void MainChatTab::LeaveChannels()
{
for ( unsigned int i = 0; i < m_chat_tabs->GetPageCount(); i++ ) {
ChatPanel* tmp = ( ChatPanel* )m_chat_tabs->GetPage( i );
if ( tmp->GetPanelType() == CPT_Channel )
{
tmp->StatusMessage( _( "Disconnected from server, chat closed." ) );
tmp->SetChannel( 0 );
} else if ( tmp->GetPanelType() == CPT_User )
{
tmp->StatusMessage( _( "Disconnected from server, chat closed." ) );
tmp->SetUser( 0 );
}
}
}
示例3: AddChatPanel
ChatPanel* MainChatTab::AddChatPanel( Channel& channel, bool doFocus )
{
for ( unsigned int i = 0; i < m_chat_tabs->GetPageCount(); i++ ) {
if ( m_chat_tabs->GetPageText( i ) == channel.GetName() ) {
ChatPanel* tmp = ( ChatPanel* )m_chat_tabs->GetPage( i );
if ( tmp->GetPanelType() == CPT_Channel ) {
if ( doFocus )
m_chat_tabs->SetSelection( i );
tmp->SetChannel( &channel );
return tmp;
}
}
}
ChatPanel* chat = new ChatPanel( m_chat_tabs, channel, m_imagelist );
m_chat_tabs->InsertPage( m_chat_tabs->GetPageCount() - 1, chat, channel.GetName(), doFocus, wxBitmap( channel_xpm ) );
if ( doFocus )
chat->FocusInputBox();
return chat;
}