本文整理汇总了C++中cegui::MultiColumnList类的典型用法代码示例。如果您正苦于以下问题:C++ MultiColumnList类的具体用法?C++ MultiColumnList怎么用?C++ MultiColumnList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MultiColumnList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 ) );
}
示例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;
}
示例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 "";
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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");
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}