当前位置: 首页>>代码示例>>C++>>正文


C++ ChatPanel类代码示例

本文整理汇总了C++中ChatPanel的典型用法代码示例。如果您正苦于以下问题:C++ ChatPanel类的具体用法?C++ ChatPanel怎么用?C++ ChatPanel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ChatPanel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnFrameDestroy

void ChatControlerFrame::OnFrameDestroy(wxCloseEvent &event) {
    //ChatPanel *chat(it->second);
    if (m_controler) {
        wxNotebook *panel = dynamic_cast<wxNotebook *>(*(GetChildren().begin()));
        if (panel)
            for(int i = panel->GetPageCount(); --i >= 0; ) {
                ChatPanel *chat = dynamic_cast<ChatPanel *>(panel->GetPage(i));
                if (chat)
                    m_controler->RemoveReference(chat->GetOtherJid());
            }
        m_controler->NullTabs();
    }
    //ChatPanel *panel = dynamic_cast<ChatPanel *>(*(GetChildren().begin()));
    //if (panel){
    //  PRU_LOG2("OnFrameDestroy", panel->GetOtherJid().Str());
    //  //good
    //  if (m_comtroler)
    //    m_controler->RemoveReference(panel->GetOtherJid());
    //} else{
    //  //bad
    //}
    //PRU_LOG2("OnFrameDestroy", others_jid.Str());
    /*if (m_controler)
      m_controler->RemoveReference(others_jid);*/
    event.Skip();
}
开发者ID:katcipis,项目名称:playground,代码行数:26,代码来源:ChatControler.cpp

示例2: 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 ) );

		}
	}
}
开发者ID:N2maniac,项目名称:springlobby-join-fork,代码行数:32,代码来源:mainchattab.cpp

示例3: ASSERT_LOGIC

//! @brief Open a new chat tab with a private chat
//!
//! @param nick The user to whom the chatwindow should be opened to
void MainWindow::OpenPrivateChat(const User& user, bool doFocus)
{
	ASSERT_LOGIC(m_chat_tab != 0, "m_chat_tab");
	m_func_tabs->SetSelection(PAGE_CHAT);
	ChatPanel* cp = m_chat_tab->AddChatPanel(user);
	if (doFocus)
		cp->FocusInputBox();
}
开发者ID:spike-spb,项目名称:springlobby,代码行数:11,代码来源:mainwindow.cpp

示例4: BroadcastMessage

void MainChatTab::BroadcastMessage( const wxString& message )
{
	// spam the message in all channels
	for ( unsigned int i = 0; i < m_chat_tabs->GetPageCount(); i++ )
	{
		ChatPanel* tmp = ( ChatPanel* )m_chat_tabs->GetPage( i );
		tmp->StatusMessage( message );
	}
}
开发者ID:N2maniac,项目名称:springlobby-join-fork,代码行数:9,代码来源:mainchattab.cpp

示例5: Reset

IServer::~IServer()
{
    if (panel != nullptr) {
        ChatPanel* tmp = panel;
        panel = nullptr;
        tmp->SetServer(NULL);
    }
    Reset();
    delete battles_iter;
}
开发者ID:apoleon,项目名称:springlobby,代码行数:10,代码来源:iserver.cpp

示例6: GetUserChatPanel

ChatPanel* MainChatTab::GetUserChatPanel( const wxString& user )
{
	for ( unsigned int i = 0; i < m_chat_tabs->GetPageCount(); i++ ) {
		ChatPanel* tmp = ( ChatPanel* )m_chat_tabs->GetPage( i );
		if ( tmp->GetPanelType() == CPT_User ) {
			wxString name = m_chat_tabs->GetPageText( i );
			if ( name.Lower() == user.Lower() ) return ( ChatPanel* )m_chat_tabs->GetPage( i );
		}
	}
	return 0;
}
开发者ID:N2maniac,项目名称:springlobby-join-fork,代码行数:11,代码来源:mainchattab.cpp

示例7: bare

ChatPanel *ChatControler::GetChatFor(buzz::Jid jid, bool create) {
    std::string bare(jid.BareJid().Str());
    ChatMap::iterator it = m_chat_map.find(bare);
    bool exists = (it != m_chat_map.end());

    if (exists) {
        //////////////////////////////
        // Tabs
        ChatPanel *chat(it->second);
        for(int i = m_tabs->GetPageCount(); --i >= 0; )
            if (chat == m_tabs->GetPage(i)) {
                // TODO: Set an image showing some kind of highlight
                //m_tabs->SetSelection(i);
                break;
            }
        m_tabs->Refresh();
        return chat;
        // Tabs
        //////////////////////////////
        //return it->second;
    } else if (create) {
        //////////////////////////////
        // Tabs
        if (!m_tabs) {
            //wxFrame *frame = new wxFrame(m_parent, wxID_ANY, StdToWx(bare));
            wxFrame *frame = new ChatControlerFrame(this, m_parent, wxID_ANY, StdToWx(bare));
            m_tabs = new wxNotebook(frame, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxCLIP_CHILDREN);
            m_tabs->PushEventHandler(g_mouse_event_fowarder_delayed);


            frame->SetIcon(wxIcon(wxT("imgs/icon/cim.png"), wxBITMAP_TYPE_PNG));
            frame->Show(true);
        }
        // Tabs
        //////////////////////////////


        ChatPanel *chat = new ChatPanel(m_tabs, jid);
        m_tabs->Connect(chat->GetId(), wxEVT_RIGHT_DOWN, wxMouseEventHandler(ChatControlerFrame::OnRightClick));

        // TODO: Set an image showing some kind of highlight
        m_tabs->AddPage(chat, StdToWx(bare));

        //Connect(chat->GetId(), wxEVT_CLOSE_WINDOW, wxCloseEventHandler(ChatControler::OnFrameDestroy));
        //chat->PushEventHandler(this);

        m_chat_map[bare] = chat;
        m_tabs->Refresh();
        return chat;
    } else {
        return NULL;
    }
}
开发者ID:katcipis,项目名称:playground,代码行数:53,代码来源:ChatControler.cpp

示例8: OnTabClose

void MainChatTab::OnTabClose( wxAuiNotebookEvent& event )
{
	int selection = event.GetSelection();
	ChatPanel* panel = ( ChatPanel* )m_chat_tabs->GetPage( selection );
	if ( panel )
	{
		panel->Part();
		if( panel->IsServerPanel() )
            m_server_chat = 0;
	}

}
开发者ID:N2maniac,项目名称:springlobby-join-fork,代码行数:12,代码来源:mainchattab.cpp

示例9: UpdateNicklistHighlights

void MainChatTab::UpdateNicklistHighlights()
{
	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->UpdateNicklistHighlights();
		}
	}
	if ( m_server_chat != 0 )
	{
		m_server_chat->UpdateNicklistHighlights();
	}
}
开发者ID:N2maniac,项目名称:springlobby-join-fork,代码行数:13,代码来源:mainchattab.cpp

示例10: ChatPanel

void GUI::Chat::OnChansClick(wxCommandEvent &e)
{
	GUI::ChatChannelsDialog *channels = new GUI::ChatChannelsDialog(this);
	
	if (channels->ShowModal() && !channels->channel.IsEmpty())
	{
		ChatPanel *p = new ChatPanel(this->tabs, -1, channels->channel);
		this->tabs->AddPage(p, wxT(channels->channel), true);
		p->DoJoin(this->info);

	}

	channels->Destroy();
}
开发者ID:ctz,项目名称:rain,代码行数:14,代码来源:GUI-Chat.cpp

示例11: ui

void MainWindow::OnTabsChanged(wxAuiNotebookEvent& event)
{
	int newsel = event.GetSelection();

	if (newsel == 0 || newsel == 1) {
		if (!ui().IsConnected() && ui().IsMainWindowCreated())
			ui().Connect();
	}

	ChatPanel* panel = ui().GetActiveChatPanel(); //set input focus to edit field on tab change
	if (panel != NULL) {
		panel->SetFocus();
	}
}
开发者ID:spike-spb,项目名称:springlobby,代码行数:14,代码来源:mainwindow.cpp

示例12: OnRightClick

void ChatControlerFrame::OnRightClick(wxMouseEvent& event) {
    if (m_controler) {
        wxNotebook *tabs = m_controler->GetTabs();
        if (tabs) {
            int tab = tabs->HitTest(event.GetPosition());
            if (tab != wxNOT_FOUND) {
                ChatPanel *chat = dynamic_cast<ChatPanel *>(tabs->GetPage(tab));
                if (chat) {
                    m_controler->RemoveReference(chat->GetOtherJid());
                    tabs->DeletePage(tab);
                }
            }
        }
    }
}
开发者ID:katcipis,项目名称:playground,代码行数:15,代码来源:ChatControler.cpp

示例13: ChatPanel

ChatPanel* MainChatTab::AddChatPanel( const User& user )
{
	for ( unsigned int i = 0; i < m_chat_tabs->GetPageCount(); i++ ) {
		if ( m_chat_tabs->GetPageText( i ) == user.GetNick() ) {
			ChatPanel* tmp = ( ChatPanel* )m_chat_tabs->GetPage( i );
			if ( tmp->GetPanelType() == CPT_User ) {
				m_chat_tabs->SetSelection( i );
				tmp->SetUser( &user );
				return tmp;
			}
		}
	}
	int selection = m_chat_tabs->GetSelection();
	ChatPanel* chat = new ChatPanel( m_chat_tabs, user, m_imagelist );
	m_chat_tabs->InsertPage( m_chat_tabs->GetPageCount() - 1, chat, user.GetNick(), true, wxBitmap( userchat_xpm ) );
	if ( selection > 0 ) m_chat_tabs->SetSelection( selection );
	return chat;
}
开发者ID:N2maniac,项目名称:springlobby-join-fork,代码行数:18,代码来源:mainchattab.cpp

示例14: switch

void MainWindow::ShowTab(const unsigned int idx)
{
	if (idx < m_tab_names.GetCount()) {
		m_func_tabs->SetSelection(idx);
		switch (idx) {
			case PAGE_JOIN: {
				GetJoinTab().SetFocus();
				ChatPanel* p = GetJoinTab().GetActiveChatPanel();
				if (p != NULL) {
					p->FocusInputBox();
				}
				return;
			}
			default:
				break;
		};
	} else
		wxLogError(_T("tab selection oob: %d"), idx);
}
开发者ID:spike-spb,项目名称:springlobby,代码行数:19,代码来源:mainwindow.cpp

示例15: 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 );
		}
	}
}
开发者ID:N2maniac,项目名称:springlobby-join-fork,代码行数:15,代码来源:mainchattab.cpp


注:本文中的ChatPanel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。