本文整理汇总了C++中cegui::MultiColumnList::getFirstSelectedItem方法的典型用法代码示例。如果您正苦于以下问题:C++ MultiColumnList::getFirstSelectedItem方法的具体用法?C++ MultiColumnList::getFirstSelectedItem怎么用?C++ MultiColumnList::getFirstSelectedItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::MultiColumnList
的用法示例。
在下文中一共展示了MultiColumnList::getFirstSelectedItem方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OpenSaleUI
bool OpenSaleUI()
{
CEGUI::WindowManager& wndmgr = GetWndMgr();
//获取出售订单ID
CEGUI::MultiColumnList* mcl = WMCL(wndmgr.getWindow("Auction/Tab/BuySale/BuyMCL"));
if(!mcl)
return false;
CEGUI::ListboxItem* lbi = mcl->getFirstSelectedItem();
if(!lbi)
{
//MessageBox(g_hWnd,AppFrame::GetText("AU_100"),"ERROR",MB_OK);
GetInst(MsgEventManager).PushEvent(Msg_Ok,AppFrame::GetText("AU_100"),NULL,NULL,true);
return false;
}
CEGUI::Window* wnd = wndmgr.getWindow("Auction/SaleWnd");
wnd->setVisible(true);
wnd->setAlwaysOnTop(true);
CEGUI::Editbox* editbox = WEditBox(wnd->getChildRecursive("Auction/SaleWnd/saleNum"));//出售界面编辑框激活
editbox->activate();
AHdata& ah = GetInst(AHdata);
uint ID = lbi->getID();
ah.SetCanSaleID(ID);
return true;
}
示例2: OnCancelAgentOrder
//撤销委托订单事件
bool OnCancelAgentOrder(const CEGUI::EventArgs& e)
{
CEGUI::WindowManager& mgr = GetWndMgr();
CEGUI::MultiColumnList* mcl = WMCL(mgr.getWindow("Auction/Tab/Query/MCL"));
//获得选中Item对应的订单ID
CEGUI::ListboxItem* li = mcl->getFirstSelectedItem();
if(!li)
{
/***********************************************************************/
/* zhaohang fix 2010-9-3
/* 修改消息框形式,采用封装的MsgEventManager,以及新的字符资源加载方式Appframe
/***********************************************************************/
GetInst(MsgEventManager).PushEvent(Msg_Ok,AppFrame::GetText("AU_113"),NULL,NULL,true);
return false;
}
uint orderID = li->getID();
AHdata& ah = GetInst(AHdata);
ah.Send_AH_REMOVE_AGENT(orderID);
return true;
}
示例3: OpenBuyUI
bool OpenBuyUI()
{
CEGUI::WindowManager& wndmgr = GetWndMgr();
CEGUI::MultiColumnList* mcl = WMCL(wndmgr.getWindow("Auction/Tab/BuySale/SaleMCL"));
if(!mcl)
return false;
CEGUI::ListboxItem* lbi = mcl->getFirstSelectedItem();
if(!lbi)
{
GetInst(MsgEventManager).PushEvent(Msg_Ok,AppFrame::GetText("AU_102"),NULL,NULL,true);
return false;
}
CEGUI::Window* wnd = wndmgr.getWindow("Auction/BuyWnd");
wnd->setVisible(true);
wnd->setAlwaysOnTop(true);
CEGUI::Editbox* editbox = WEditBox(wnd->getChildRecursive("Auction/Buy/buyNum"));//购买界面编辑框激活
editbox->activate();
AHdata& ah = GetInst(AHdata);
//界面获取购买订单ID
uint ID = lbi->getID();
ah.SetCanBuyID(ID);//保存要购买的订单ID
return true;
}
示例4: OnConnectButtonClick
bool CServerBrowser::OnConnectButtonClick(const CEGUI::EventArgs &eventArgs)
{
CEGUI::MultiColumnList * pMultiColumnList = (CEGUI::MultiColumnList *)m_GUIElements.pServerMultiColumnList;
CEGUI::ListboxItem * pHostname = pMultiColumnList->getFirstSelectedItem();
CEGUI::ListboxItem * pHost = pMultiColumnList->getNextSelected(pHostname);
CEGUI::ListboxItem * pPlayerCount = pMultiColumnList->getNextSelected(pHost);
CEGUI::ListboxItem * pMaxPlayers = pMultiColumnList->getNextSelected(pPlayerCount);
CEGUI::ListboxItem * pPing = pMultiColumnList->getNextSelected(pMaxPlayers);
CEGUI::ListboxItem * pPassworded = pMultiColumnList->getNextSelected(pPing);
// Get the host and port
String strHost;
unsigned short usPort;
if(!CMainMenu::GetHostAndPort(pHost->getText().c_str(), strHost, usPort))
{
g_pClient->GetGUI()->ShowMessageBox("You must enter a valid host and port!", "Error!");
return false;
}
// Hide the server browser window
SetVisible(false);
// Does this server require a password?
if(pPassworded->getText() == "yes")
{
// TODO: Show password entry window
}
else
{
// Call the connect function
CMainMenu::GetSingleton()->OnConnect(strHost, usPort, "");
}
return true;
}
示例5: OnRowClick
// event rowClick(string guiName)
bool OnRowClick(const CEGUI::EventArgs &eventArgs)
{
CEvents * pEvents = g_pClient->GetEvents();
String eventName ("rowClick");
if(!pEvents->IsEventRegistered(eventName))
return false;
const CEGUI::WindowEventArgs eArgs = static_cast<const CEGUI::WindowEventArgs&>(eventArgs);
CEGUI::Window * pWindow = eArgs.window;
CSquirrel * pScript = g_pClient->GetClientScriptManager()->GetGUIManager()->GetScript(pWindow);
CEGUI::MultiColumnList * pMultiColumnList = static_cast<CEGUI::MultiColumnList*>(eArgs.window);
int iItemID = pMultiColumnList->getItemRowIndex(pMultiColumnList->getFirstSelectedItem());
CSquirrelArguments pArguments;
pArguments.push(eArgs.window->getName().c_str()); // Window Name
pArguments.push(iItemID); // Row
CLogFile::Printf("Value: %i",iItemID);
pEvents->Call(eventName, &pArguments, pScript);
return true;
}