本文整理汇总了C++中cegui::MultiColumnList类的典型用法代码示例。如果您正苦于以下问题:C++ MultiColumnList类的具体用法?C++ MultiColumnList怎么用?C++ MultiColumnList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MultiColumnList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetWindow
void
CFileSystemDialogImp::OnPostLayoutLoad( void )
{GUCE_TRACE;
GUCEF::GUI::CFileSystemDialog::OnPostLayoutLoad();
// Try and link the icon imageset
CEGUI::ImagesetManager* imgSetManager = CEGUI::ImagesetManager::getSingletonPtr();
if ( imgSetManager->isImagesetPresent( "Icons" ) )
{
m_iconsImageSet = imgSetManager->getImageset( "Icons" );
}
// Hook up the event handlers
CEGUI::FrameWindow* window = static_cast< CEGUI::FrameWindow* >( GetWindow()->GetImplementationPtr() );
window->subscribeEvent( CEGUI::FrameWindow::EventCloseClicked ,
CEGUI::Event::Subscriber( &CFileSystemDialogImp::OnCancelButtonClick ,
this ) );
CEGUI::MultiColumnList* fsViewWidget = static_cast< CEGUI::MultiColumnList* >( GetFileSystemGridView()->GetImplementationPtr() );
fsViewWidget->subscribeEvent( CEGUI::MultiColumnList::EventSelectionChanged ,
CEGUI::Event::Subscriber( &CFileSystemDialogImp::OnItemSelected ,
this ) );
fsViewWidget->subscribeEvent( CEGUI::MultiColumnList::EventMouseDoubleClick ,
CEGUI::Event::Subscriber( &CFileSystemDialogImp::OnItemDblClicked ,
this ) );
CEGUI::PushButton* okButton = static_cast< CEGUI::PushButton* >( GetOkButton()->GetImplementationPtr() );
okButton->subscribeEvent( CEGUI::PushButton::EventClicked ,
CEGUI::Event::Subscriber( &CFileSystemDialogImp::OnOkButtonClick ,
this ) );
CEGUI::PushButton* cancelButton = static_cast< CEGUI::PushButton* >( GetCancelButton()->GetImplementationPtr() );
cancelButton->subscribeEvent( CEGUI::PushButton::EventClicked ,
CEGUI::Event::Subscriber( &CFileSystemDialogImp::OnCancelButtonClick ,
this ) );
}
开发者ID:LiberatorUSA,项目名称:GUCE,代码行数:35,代码来源:guceCEGUIOgre_CFileSystemDialogImp.cpp
示例2: MultiColumnListItem
_MEMBER_FUNCTION_IMPL(GUIMultiColumnList, setItem)
{
CEGUI::MultiColumnList * pWindow = sq_getinstance<CEGUI::MultiColumnList *>(pVM);
if(!pWindow)
{
sq_pushbool(pVM, false);
return 1;
}
SQInteger sqiRow;
SQInteger sqiColumn;
const char * value;
//CEGUI::colour color(0xFFFFFFFF); // TODO: color from hex param
// FIXME: order of params -> invert
sq_getstring(pVM, 2, &value);
sq_getinteger(pVM, 3, &sqiColumn);
sq_getinteger(pVM, 4, &sqiRow);
try
{
MultiColumnListItem* pItem = new MultiColumnListItem(value);
//pItem->setTextColours(color);
pWindow->setItem(pItem, sqiColumn, sqiRow);
sq_pushbool(pVM, true);
}
catch(...)
{
sq_pushbool(pVM, false);
}
return 1;
}
开发者ID:guilhermelhr,项目名称:ivmultiplayer,代码行数:33,代码来源:GUINatives.cpp
示例3: GetItemText
const char* CGUIGridList_Impl::GetItemText ( int iRow, int hColumn )
{
try
{
CEGUI::MultiColumnList* pMultiColumnList = reinterpret_cast < CEGUI::MultiColumnList* > ( m_pWindow );
if ( (uint)iRow >= pMultiColumnList->getRowCount() || (uint)GetColumnIndex( hColumn ) >= pMultiColumnList->getColumnCount() )
return "";
// Grab the item at the chosen row / column
CEGUI::ListboxItem* pItem = reinterpret_cast < CEGUI::MultiColumnList* > ( m_pWindow ) -> getItemAtGridReference ( CEGUI::MCLGridRef ( iRow, GetColumnIndex ( hColumn ) ) );
if ( pItem )
{
const char *szRet = pItem->getText().c_str ();
if ( !m_bIgnoreTextSpacer )
{
unsigned char ucSpacerSize = (unsigned char)(strlen ( CGUIGRIDLIST_SPACER ));
if ( GetColumnIndex ( hColumn ) == 0 ) {
// Make sure there is a spacer to skip
if ( strncmp ( szRet, CGUIGRIDLIST_SPACER, strlen ( CGUIGRIDLIST_SPACER ) ) == 0 )
szRet += ucSpacerSize;
}
}
return szRet;
}
}
catch ( CEGUI::Exception )
{
return "";
}
return "";
}
开发者ID:Jusonex,项目名称:mtasa-awesomium,代码行数:35,代码来源:CGUIGridList_Impl.cpp
示例4: 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;
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:26,代码来源:Auction.cpp
示例5: grid_ref
_MEMBER_FUNCTION_IMPL(GUIMultiColumnList, getItem)
{
CEGUI::MultiColumnList * pWindow = sq_getinstance<CEGUI::MultiColumnList *>(pVM);
if(!pWindow)
{
sq_pushbool(pVM, false);
return 1;
}
SQInteger sqiRow;
SQInteger sqiColumn;
sq_getinteger(pVM, -2, &sqiRow);
sq_getinteger(pVM, -1, &sqiColumn);
try
{
CEGUI::MCLGridRef grid_ref(sqiRow, sqiColumn);
CEGUI::ListboxItem* pItem = pWindow->getItemAtGridReference(grid_ref);
sq_pushstring(pVM, pItem->getText().c_str(), -1);
}
catch(...)
{
sq_pushbool(pVM, false);
}
return 1;
}
开发者ID:guilhermelhr,项目名称:ivmultiplayer,代码行数:27,代码来源:GUINatives.cpp
示例6: itemName
bool
CFileSystemDialogImp::OnItemDblClicked( const CEGUI::EventArgs& e )
{GUCE_TRACE;
// Test if this was a left mouse click
const CEGUI::MouseEventArgs& eData = static_cast< const CEGUI::MouseEventArgs& >( e );
if ( eData.button == CEGUI::LeftButton )
{
// Get some easy access to data
CGridViewImp* fsView = static_cast< CGridViewImp* >( GetFileSystemGridView() );
CEGUI::MultiColumnList* fsViewWidget = fsView->GetImplementationWidget();
UInt32 columnIndex = 0;
UInt32 rowIndex = 0;
if ( fsView->TestForItemHit( eData.position.d_x ,
eData.position.d_y ,
columnIndex ,
rowIndex ) )
{
CEGUI::ListboxItem* listItem = fsViewWidget->getItemAtGridReference( CEGUI::MCLGridRef( rowIndex, columnIndex ) );
if ( NULL != listItem )
{
if ( listItem->getText() == ".." )
{
// ".." means go up one dir
m_currentPath = GUCEF::CORE::StripLastSubDir( m_currentPath );
RefreshView();
}
else
if ( IsItemADirectory( listItem->getText().c_str() ) )
{
GUCEF::CORE::AppendToPath( m_currentPath, listItem->getText().c_str() );
RefreshView();
}
else
if ( IsItemAnArchive( listItem->getText().c_str() ) )
{
CString itemName( listItem->getText().c_str() );
CString realName = itemName.CutChars( 3, true );
GUCEF::CORE::AppendToPath( m_currentPath, realName );
RefreshView();
}
}
}
}
return true;
}
开发者ID:LiberatorUSA,项目名称:GUCE,代码行数:48,代码来源:guceCEGUIOgre_CFileSystemDialogImp.cpp
示例7:
_MEMBER_FUNCTION_IMPL(GUIMultiColumnList, removeRow)
{
CEGUI::MultiColumnList * pWindow = sq_getinstance<CEGUI::MultiColumnList *>(pVM);
if(!pWindow)
{
sq_pushbool(pVM, false);
return 1;
}
SQInteger sqiRow;
sq_getinteger(pVM, -1, &sqiRow);
pWindow->removeRow(sqiRow);
sq_pushbool(pVM, true);
return 1;
}
开发者ID:guilhermelhr,项目名称:ivmultiplayer,代码行数:16,代码来源:GUINatives.cpp
示例8: OnMasterListQuery
void CServerBrowser::OnMasterListQuery(int iType)
{
// Reset the server browser list
CEGUI::MultiColumnList * pMultiColumnList = (CEGUI::MultiColumnList *)m_GUIElements.pServerMultiColumnList;
pMultiColumnList->resetList();
// Reset the server and master list queries
m_pMasterListQuery->Reset();
m_pServerQuery->Reset();
// Query the master list
if(!m_pMasterListQuery->Query(iType))
{
String strError("Failed to contact the master list (%s).\nPlease check your internet connection.", m_pMasterListQuery->GetHttpClient()->GetLastErrorString().Get());
g_pClient->GetGUI()->ShowMessageBox(strError.Get(), "Error");
}
}
开发者ID:JamesConway69,项目名称:ivmultiplayer,代码行数:17,代码来源:CServerBrowser.cpp
示例9: 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;
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:21,代码来源:Auction.cpp
示例10: UpdateCanSaleMCLDate
bool UpdateCanSaleMCLDate(const CEGUI::EventArgs& e)
{
AHdata& ah = GetInst(AHdata);
AHdata::vecOrderRaw listOR = ah.m_CanSaleOrder;//可出售列表
CEGUI::MultiColumnList* mcl = WMCL(WEArgs(e).window);
if(!mcl)
return false;
mcl->resetList();
AHdata::vecOrderRaw::iterator it = listOR.begin();
for (uint i = 0 ; i < listOR.size() ; ++i,++it)
{
mcl->addRow();
CEGUI::ListboxTextItem* lti = new CEGUI::ListboxTextItem(ToCEGUIString(AppFrame::GetText("AU_104")),it->id);//第二个参数与订单ID关联
lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
mcl->setItem(lti,0,i);
lti = new CEGUI::ListboxTextItem(CEGUI::PropertyHelper::intToString(it->price));
lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
mcl->setItem(lti,1,i);
lti = new CEGUI::ListboxTextItem(CEGUI::PropertyHelper::intToString(it->cnt));
lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
mcl->setItem(lti,2,i);
}
return true;
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:26,代码来源:Auction.cpp
示例11: GetItem
CGUIListItem* CGUIGridList_Impl::GetItem ( int iRow, int hColumn )
{
try
{
CEGUI::MultiColumnList* pMultiColumnList = reinterpret_cast < CEGUI::MultiColumnList* > ( m_pWindow );
if ( (uint)iRow >= pMultiColumnList->getRowCount() || (uint)GetColumnIndex( hColumn ) >= pMultiColumnList->getColumnCount() )
return NULL;
// Grab the item at the chosen row / column
CEGUI::ListboxItem* pItem = reinterpret_cast < CEGUI::MultiColumnList* > ( m_pWindow ) -> getItemAtGridReference ( CEGUI::MCLGridRef ( iRow, GetColumnIndex ( hColumn ) ) );
// If it exists, get the CGUIListItem by using the pool
if ( pItem )
{
return GetListItem ( pItem );
}
}
catch ( CEGUI::Exception )
{}
return NULL;
}
开发者ID:Jusonex,项目名称:mtasa-awesomium,代码行数:22,代码来源:CGUIGridList_Impl.cpp
示例12: 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;
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:23,代码来源:Auction.cpp
示例13: 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;
}
开发者ID:guilhermelhr,项目名称:ivmultiplayer,代码行数:25,代码来源:GUINatives.cpp
示例14: UpdatePerMCLDate
bool UpdatePerMCLDate(const CEGUI::EventArgs& e)
{
AHdata& ah = GetInst(AHdata);
//AHdata::listSubOrderRaw listSubOR = ah.m_AgentOrder;
AHdata::MapSubOrderRaw mapSubOR = ah.m_AgentOrder;
CEGUI::MultiColumnList* mcl = WMCL(WEArgs(e).window);
if(!mcl)
return false;
mcl->resetList();
AHdata::MapSubOrderRaw::iterator it = mapSubOR.begin();
for (int i = 0 ; it != mapSubOR.end(); ++it,++i)
{
mcl->addRow();
CEGUI::ListboxTextItem* lti = NULL;
lti = new CEGUI::ListboxTextItem(CEGUI::PropertyHelper::intToString(it->first),it->first);//控件ID与订单ID关联
lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
mcl->setItem(lti,0,i);
AH::SubOrderRaw& mapOr = it->second;
if(mapOr.type == AH::OT_BUY)
lti = new CEGUI::ListboxTextItem(ToCEGUIString(AppFrame::GetText("AU_104")));
else if(mapOr.type == AH::OT_SELL)
lti = new CEGUI::ListboxTextItem(ToCEGUIString(AppFrame::GetText("AU_105")));
lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
mcl->setItem(lti,1,i);
lti = new CEGUI::ListboxTextItem(CEGUI::PropertyHelper::intToString(mapOr.cnt));
lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
mcl->setItem(lti,2,i);
lti = new CEGUI::ListboxTextItem(CEGUI::PropertyHelper::intToString(mapOr.price));
lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
mcl->setItem(lti,3,i);
/////////////////////////////////////////////////
// zhaohang 2010/5/12
// 时间UI未处理
/////////////////////////////////////////////////
uint subtime = mapOr.gentime / 60 / 60;
lti = new CEGUI::ListboxTextItem(CEGUI::PropertyHelper::intToString(subtime));
lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME);
mcl->setItem(lti,4,i);
}
return false;
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:46,代码来源:Auction.cpp
示例15: 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;
}
开发者ID:JamesConway69,项目名称:ivmultiplayer,代码行数:37,代码来源:CServerBrowser.cpp
示例16: initServer
void t_chessGui::initServer()
{
CEGUI::FrameWindow *server = static_cast<CEGUI::FrameWindow *>(wmgr->loadWindowLayout("server.layout"));
myRoot->addChildWindow(server);
server->subscribeEvent(CEGUI::FrameWindow::EventCloseClicked,CEGUI::Event::Subscriber(boost::bind(closeServer,server,_1)));
CEGUI::MenuItem *serverItem = static_cast<CEGUI::MenuItem *>(wmgr->getWindow("Root/FrameWindow/Menubar/File/New"));
serverItem->subscribeEvent(CEGUI::MenuItem::EventClicked,CEGUI::Event::Subscriber(boost::bind(openServer,server,_1)));
CEGUI::MultiColumnList *testing = static_cast<CEGUI::MultiColumnList *>(wmgr->getWindow("Lols3"));
testing->addColumn("Names",0,CEGUI::UDim(.25,0));
testing->addColumn("Action",1,CEGUI::UDim(.25,0));
testing->addColumn("Wins",2,CEGUI::UDim(.25,0));
testing->addColumn("Losses",3,CEGUI::UDim(.25,0));
testing->addRow();
testing->addRow();
testing->setItem(new CEGUI::ListboxTextItem("What, wow,"),0u,0u);
server->hide();
}
开发者ID:Lalaland,项目名称:ChessV3,代码行数:24,代码来源:chessServer.cpp
示例17: SetItemText
int CGUIGridList_Impl::SetItemText ( int iRow, int hColumn, const char* szText, bool bNumber, bool bSection, bool bFast )
{
try
{
CEGUI::MultiColumnList* win = reinterpret_cast < CEGUI::MultiColumnList* > ( m_pWindow );
// Get the current item at that offset and set the text
CGUIListItem_Impl* pItem = reinterpret_cast < CGUIListItem_Impl* > ( GetItem ( iRow, hColumn ) );
if ( pItem )
{
if ( bSection )
{
// Set section properties
pItem->SetFont ( "default-bold-small" );
pItem->SetDisabled ( true );
pItem->SetText ( szText );
}
else
{
pItem->SetFont ( "default-normal" );
pItem->SetDisabled ( false );
if ( hColumn == 1 )
{
// Enable some spacing on regular items, if this is the first item
char szBuf[CGUIGRIDLIST_MAX_TEXT_LENGTH];
if ( m_bIgnoreTextSpacer )
{
_snprintf ( szBuf, CGUIGRIDLIST_MAX_TEXT_LENGTH - 1, "%s", szText );
}
else
{
_snprintf ( szBuf, CGUIGRIDLIST_MAX_TEXT_LENGTH - 1, "%s%s", CGUIGRIDLIST_SPACER, szText );
}
szBuf[CGUIGRIDLIST_MAX_TEXT_LENGTH-1] = NULL;
pItem->SetText ( szBuf );
}
else
{
pItem->SetText ( szText );
}
}
}
else
{
// If it doesn't, create it and set it in the gridlist
pItem = new CGUIListItem_Impl ( szText, bNumber );
CEGUI::ListboxItem* pListboxItem = pItem->GetListItem ();
win->setItem ( pListboxItem, hColumn, iRow, bFast );
// Put our new item into the map
m_Items [ pItem->GetListItem () ] = pItem;
if ( bSection )
{
// Set section properties
pItem->SetFont ( "default-bold-small" );
pItem->SetDisabled ( true );
}
else if ( hColumn == 1 )
{
// Enable some spacing on regular items, if this is the first item
char szBuf[CGUIGRIDLIST_MAX_TEXT_LENGTH];
if ( m_bIgnoreTextSpacer )
{
_snprintf ( szBuf, CGUIGRIDLIST_MAX_TEXT_LENGTH-1, "%s", szText );
}
else
{
_snprintf ( szBuf, CGUIGRIDLIST_MAX_TEXT_LENGTH-1, "%s%s", CGUIGRIDLIST_SPACER, szText );
}
szBuf[CGUIGRIDLIST_MAX_TEXT_LENGTH-1] = NULL;
pItem->SetText ( szBuf );
}
}
// If the list is sorted and we just changed an item in the sorting column,
// re-sort the list.
if ( win->getSortDirection () != CEGUI::ListHeaderSegment::SortDirection::None &&
win->getSortColumn () == GetColumnIndex ( hColumn ) )
{
win->setSortColumn ( win->getSortColumn () );
return GetItemRowIndex ( pItem );
}
else
{
return iRow;
}
}
catch ( CEGUI::Exception ) {}
return 0;
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:
示例18: ServerQueryHandler
void CServerBrowser::ServerQueryHandler(String strHost, unsigned short usPort, String strQuery, CBitStream * pReply)
{
// Read the query type
char cQueryType;
if(!pReply->Read(cQueryType))
return;
// Get the server host and port
String strHostAndPort("%s:%d", strHost.Get(), usPort);
if(cQueryType == 'p') // Ping
{
// Get the start time from the ping map
unsigned long ulStartTime = serverPingStartMap[strHostAndPort];
// Do we have a valid start time?
if(ulStartTime > 0)
{
// Calculate the round trip time
unsigned long ulPing = (SharedUtility::GetTime() - ulStartTime);
// Set the server ping in the multi column list
CEGUI::MultiColumnList * pMultiColumnList = (CEGUI::MultiColumnList *)CServerBrowser::GetSingleton()->m_GUIElements.pServerMultiColumnList;
for(unsigned int i = 0; i < pMultiColumnList->getRowCount(); i++)
{
CEGUI::ListboxItem * pHost = pMultiColumnList->getItemAtGridReference(CEGUI::MCLGridRef(i, 1));
if(!strHostAndPort.Compare(pHost->getText().c_str()))
{
CEGUI::ListboxItem * pPing = pMultiColumnList->getItemAtGridReference(CEGUI::MCLGridRef(i, 3));
if(pPing)
{
char szTempBuf[64];
pPing->setText(itoa(ulPing, szTempBuf, 10));
pMultiColumnList->invalidate();
break;
}
}
}
}
}
else
{
// Check if we have a valid stream
if(!pReply || cQueryType != 'i')
return;
// Read the host name
String strHostName;
int iPlayerCount;
int iMaxPlayers;
bool bPassworded;
pReply->Read(strHostName);
pReply->Read(iPlayerCount);
pReply->Read(iMaxPlayers);
pReply->Read(bPassworded);
// Add the server to the multi column list
CEGUI::MultiColumnList * pMultiColumnList = (CEGUI::MultiColumnList *)CServerBrowser::GetSingleton()->m_GUIElements.pServerMultiColumnList;
unsigned int iRowIndex = pMultiColumnList->addRow();
pMultiColumnList->setItem(new ServerBrowserListItem(strHostName.Get()), 0, iRowIndex);
pMultiColumnList->setItem(new ServerBrowserListItem(strHostAndPort.Get()), 1, iRowIndex);
char szPlayerCount[9];
sprintf(szPlayerCount, "%s/%s", iPlayerCount, iMaxPlayers);
pMultiColumnList->setItem(new ServerBrowserListItem(szPlayerCount), 2, iRowIndex);
pMultiColumnList->setItem(new ServerBrowserListItem("9999"), 3, iRowIndex);
pMultiColumnList->setItem(new ServerBrowserListItem(bPassworded ? "Yes" : "No"), 4, iRowIndex);
pMultiColumnList->invalidate();
// Save the current time to the ping map
serverPingStartMap[strHostAndPort] = SharedUtility::GetTime();
// Send a ping query to the server
CServerBrowser::GetSingleton()->m_pServerQuery->Query(strHost, usPort, "p");
}
}
开发者ID:JamesConway69,项目名称:ivmultiplayer,代码行数:80,代码来源:CServerBrowser.cpp
示例19: OnRowClick
bool CServerBrowser::OnRowClick(const CEGUI::EventArgs &eventArgs)
{
CEGUI::MultiColumnList * pMultiColumnList = (CEGUI::MultiColumnList *)m_GUIElements.pServerMultiColumnList;
m_GUIElements.pConnectButton->setEnabled((pMultiColumnList->getSelectedCount() > 0) ? true : false);
return true;
}
开发者ID:JamesConway69,项目名称:ivmultiplayer,代码行数:6,代码来源:CServerBrowser.cpp
示例20: ListboxTextItem
void
sge::cegui::toolbox::append_row(
CEGUI::MultiColumnList &_list,
sge::cegui::toolbox::row const &_mapper
)
{
FCPPT_ASSERT_PRE(
static_cast<
sge::cegui::toolbox::row::size_type
>(
_list.getColumnCount()
)
==
_mapper.size()
);
FCPPT_ASSERT_PRE(
!_mapper.empty()
);
CEGUI::uint const index(
_list.addRow(
new CEGUI::ListboxTextItem(
_mapper[
0
],
0,
nullptr
),
0
)
);
for(
sge::cegui::toolbox::row::size_type const cur
:
fcppt::make_int_range(
fcppt::literal<
sge::cegui::toolbox::row::size_type
>(
1u
),
_mapper.size()
)
)
_list.setItem(
new CEGUI::ListboxTextItem(
_mapper[
cur
],
0,
nullptr
),
static_cast<
CEGUI::uint
>(
cur
),
index
);
}
开发者ID:freundlich,项目名称:spacegameengine,代码行数:61,代码来源:append_row.cpp
注:本文中的cegui::MultiColumnList类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论