本文整理汇总了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);
}
}