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


C++ WindowList::addwindow_ind方法代码示例

本文整理汇总了C++中WindowList::addwindow_ind方法的典型用法代码示例。如果您正苦于以下问题:C++ WindowList::addwindow_ind方法的具体用法?C++ WindowList::addwindow_ind怎么用?C++ WindowList::addwindow_ind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WindowList的用法示例。


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

示例1: handleMessage

void Bot::handleMessage( const Message& stanza, MessageSession* session ) 
{
	cout << "Received message (function handleMessage): " << stanza << endl;
	int inMsgType=0;
	string inMsg=stanza.body();
	if ((inMsg.length()>0) && (stanza.subtype()!=2))
	{
		if (inMsg[0]=='C')
		{
			inMsgType=1;
		}
		if (inMsg[0]=='T')
		{
			inMsgType=2;
		}
		if (inMsg[0]=='R')
		{
			inMsgType=3;
		}
	}
	if (inMsgType==1)
	{
		//openedwindows.initialize();
		//MyFunc();
		cout<<"win_num = "<<openedwindows.win_num<<endl;
		for (int i=0;i<openedwindows.win_num;i++)
		{
			Message newmsg(Message::Chat,stanza.from(),'T'+to_string(i)+": "+openedwindows.content[i]);
			cout<<"Message sent: "<<'T'+to_string(i)+": "+openedwindows.content[i]<<endl;
			client->send(newmsg);
		}
		Message msg(Message::Chat,stanza.from(),"R");
		client->send(msg);
	}
	if (inMsgType==2)
	{
		int inNum=inMsg[1]-'0';
		cout<<"Buddy is telling me something with inNum = "<<inNum<<endl;
		int buddyid=mybuddylist.inList(stanza.from().bare());
		cout<<"Which buddy is this? "<<buddyid<<endl;
		buddyswindows.addwindow_ind(inMsg,inNum);
		mybuddylist.addWindow_BuddyID(buddyid,inMsg,inNum);
	}
	if (inMsgType==3)
	{
		string uishow;
		uishow=uishow+"----------\n";
		if (mybuddylist.head!=mybuddylist.rear)
		{
			BuddyNode* p=mybuddylist.head;
			while (1)
			{
				uishow=uishow+(p->buddyJID)+'\n';
				for (int i=0;i<p->onebuddywindowlist.win_num;i++)
				{
					uishow=uishow+(p->onebuddywindowlist.content[i])+'\n';
				}
				if (!p->next)
				{
					break;
				}
				else
				{
					p=p->next;
				}
				uishow=uishow+"----------\n";
			}
		}
		uishow=uishow+"----------\n";
		const char *uishowchar = uishow.c_str();
		displaywidget->text(uishowchar);
	}
}
开发者ID:chuhang,项目名称:someproject,代码行数:73,代码来源:Bot.cpp


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