本文整理汇总了C++中cegui::Window类的典型用法代码示例。如果您正苦于以下问题:C++ Window类的具体用法?C++ Window怎么用?C++ Window使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Window类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnLButtonDblClk
void CUIEditorView::OnLButtonDblClk(UINT nFlags, CPoint point)
{
g_CoreSystem.getCEGUISystem()->injectMouseButtonDown(CEGUI::LeftButton);
//找到鼠标点击的窗口
CEGUI::Window* pWin = CEGUI::System::getSingleton().getWindowContainingMouse();
if(pWin)
{
//检测窗口是否可以显示函数对话框
BOOL bShow = g_DataPool.m_scriptModule.DoFunction("canShowFunctionDlg",pWin->getWidgetType().c_str(),NULL);
//显示对话框
if(bShow)
{
CFunctionDlg dlg;
CString szString,szName;
szName = pWin->getName().c_str();
szString = szName;
szString += "_OnClicked";
dlg.SetLeftFunction(szString);
szString = szName;
szString += "_OnRClicked";
dlg.SetRightFunction(szString);
dlg.SetWindowName(szName);
dlg.DoModal();
}
}
CView::OnLButtonDblClk(nFlags, point);
}
示例2: OnCreateRoleBtn
bool CREvent::OnCreateRoleBtn(const CEGUI::EventArgs &e)
{
if (GetInst(SelectRolePage).GetPlayerCount() >= 1)
{
GetInst(MsgEventManager).PushEvent(Msg_Ok,AppFrame::GetText("Base_34")); //目前不能创建更多的角色了!
return false;
}
CEGUI::Window *pPageWin = GetInst(CreateRolePage).GetPageWindow();
CEGUI::Editbox* pNameEdit = static_cast<CEGUI::Editbox*>(pPageWin->getChild("EditName"));
const char * strName = CEGUIStringToAnsiChar(pNameEdit->getText());
if (strcmp(strName,"") == 0)
{
GetInst(MsgEventManager).PushEvent(Msg_Ok,AppFrame::GetText("Player_72")); //"名字不能为空"
return false;
}
if (!CheckName(strName))
{
GetInst(MsgEventManager).PushEvent(Msg_Ok,AppFrame::GetText("Player_73")); //"名字中不能有空格"
return false;
}
int iSex = random(2);
//RandomChoseDetails();
//RandomChoseCountry();
BYTE lConstellation = random(12) + 1;
//const char *strName,char nOccupation, char nSex, BYTE lHead, BYTE lFace, BYTE lCountry,BYTE lConstellation,BYTE bRandCountry
GetGame()->C2L_AddRole_Send(strName, 0, (char)GetSelectSex(), GetHair(), GetFace(), GetSelectCountry(), lConstellation, 0 );
return true;
}
示例3: onFontChanged
void SettingComboBox::onFontChanged(CEGUI::WindowEventArgs& e)
{
CEGUI::Window* name = getNameW();
CEGUI::Combobox* box = getComboBoxW();
name->setFont(CEGUI::Window::getFont());
box->setFont(CEGUI::Window::getFont());
}
示例4: createFactory
bool DynamicEditor::createFactory(const CEGUI::EventArgs& _args)
{
unsigned int index = typeTab->getSelectedTabIndex();
CEGUI::Window* tab = typeTab->getTabContentsAtIndex(index);
static_cast<EditorFactoryType*>(tab->getUserData())->createButton(_args);
return true;
}
示例5: visible
bool time_panel_impl::visible()
{
CEGUI::GUIContext& context = CEGUI::System::getSingleton().getDefaultGUIContext();
CEGUI::Window* root = context.getRootWindow();
return root->getChild(label_name)->isVisible();
return true;
}
示例6: loadWindow
bool GUIManager::loadWindow(const std::string &windowName)
{
bool flag = false;
// 检测给定layout的文件是否加载,没有加载则加载
if(!getWindowManager()->isWindowPresent(windowName))
{
// 从 .layout脚本文件读取一个UI布局设计,并将其放置到GUI资源组中。
CEGUI::Window *editorGuiSheet = getWindowManager()->loadWindowLayout(windowName + ".layout");
// 接下来我们告诉CEGUI显示哪份UI布局。当然我们可以随时更换显示的UI布局。
CEGUI::System &sys = CEGUI::System::getSingleton();
sys.setGUISheet(editorGuiSheet);
//getSingletonPtr()->getGUISystem()->setGUISheet(editorGuiSheet);
editorGuiSheet->setVisible(true);
editorGuiSheet->setMousePassThroughEnabled(true);
flag = true;
}
else
{
assert(0);
//// 如果已经加载则直接显示
//CEGUI::Window *window = getWindowManager()->getWindow(windowName);
//getSingletonPtr()->getGUISystem()->setGUISheet(window);
//window->show();
}
return flag;
}
示例7: OnPageOpen
void LoginEvent::OnPageOpen(GamePage *pPage)
{
CEGUI::Window *pLoginWindow = pPage->GetPageWindow();
//设置账号编辑框并得到焦点
CEGUI::Editbox *pIDEdit = static_cast<CEGUI::Editbox*>(pLoginWindow->getChild("LoginPage/Account"));
/////////////////////////////////////////////////
// zhaohang 2010/3/29
//
//读cdkey
ifstream stream2;
stream2.open("setup/cdkey.ini");
if (stream2.is_open())
{
bool bRememberCdkey=false;
stream2 >> bRememberCdkey;
if (bRememberCdkey)
{
string str;
stream2 >> str;
pIDEdit->setText(str.c_str());
//m_pRememberCdkey->SetSelected(true);
}
stream2.close();
}
示例8: setupGUI
void
setupGUI(){
CEGUI::WindowFactoryManager::addFactory<CEGUI::TplWindowFactory<AlphaHitWindow> >();
CEGUI::OgreRenderer::bootstrapSystem();
CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
CEGUI::Window* myRoot = wmgr.createWindow( "DefaultWindow", "root" );
myRoot->setProperty("MousePassThroughEnabled", "True");
CEGUI::System::getSingleton().getDefaultGUIContext().setRootWindow( myRoot );
CEGUI::SchemeManager::getSingleton().createFromFile("Thrive.scheme");
CEGUI::System::getSingleton().getDefaultGUIContext().getMouseCursor().setDefaultImage("ThriveGeneric/MouseArrow");
//For demos:
CEGUI::SchemeManager::getSingleton().createFromFile("TaharezLook.scheme");
CEGUI::SchemeManager::getSingleton().createFromFile("SampleBrowser.scheme");
CEGUI::SchemeManager::getSingleton().createFromFile("OgreTray.scheme");
CEGUI::SchemeManager::getSingleton().createFromFile("GameMenu.scheme");
CEGUI::SchemeManager::getSingleton().createFromFile("AlfiskoSkin.scheme");
CEGUI::SchemeManager::getSingleton().createFromFile("WindowsLook.scheme");
CEGUI::SchemeManager::getSingleton().createFromFile("VanillaSkin.scheme");
CEGUI::SchemeManager::getSingleton().createFromFile("Generic.scheme");
CEGUI::SchemeManager::getSingleton().createFromFile("VanillaCommonDialogs.scheme");
CEGUI::ImageManager::getSingleton().loadImageset("DriveIcons.imageset");
CEGUI::ImageManager::getSingleton().loadImageset("GameMenu.imageset");
CEGUI::ImageManager::getSingleton().loadImageset("HUDDemo.imageset");
}
示例9: memBuffer
bool
CFormBackendImp::LoadLayout( GUCEF::CORE::CIOAccess& layoutStorage )
{GUCEF_TRACE;
CEGUI::Window* rootWindow = NULL;
CEGUI::WindowManager* wmgr = CEGUI::WindowManager::getSingletonPtr();
GUCEF_DEBUG_LOG( 0, "Starting layout load for a GUI Form" );
try
{
CORE::CDynamicBuffer memBuffer( layoutStorage );
CEGUI::RawDataContainer container;
container.setData( (CEGUI::uint8*) memBuffer.GetBufferPtr() );
container.setSize( (size_t) memBuffer.GetDataSize() );
rootWindow = wmgr->loadLayoutFromContainer( container );
container.setData( (CEGUI::uint8*) NULL );
container.setSize( (size_t) 0 );
}
catch ( CEGUI::Exception& e )
{
GUCEF_ERROR_LOG( 0, CString( "CEGUI Exception while attempting to load form layout: " ) + e.what() );
return false;
}
// Now that we completed loading lets see what we got from CEGUI
if ( NULL != rootWindow )
{
// Begin by providing a wrapper for the root window
m_rootWindow = CreateAndHookWrapperForWindow( rootWindow );
if ( NULL != m_rootWindow )
{
CString localWidgetName = m_rootWindow->GetName().SubstrToChar( '/', false );
m_widgetMap[ localWidgetName ] = m_rootWindow;
WrapAndHookChildWindows( rootWindow );
// We will directly add the form as a child of the root for now
// Note: This assumes that you have a GUISheet already set, otherwise this will result in a segfault!
CEGUI::Window* globalRootWindow = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow();
if ( NULL != globalRootWindow )
{
globalRootWindow->addChild( rootWindow );
GUCEF_DEBUG_LOG( 0, "Successfully loaded a GUI Form layout" );
return true;
}
else
{
GUCEF_ERROR_LOG( 0, "Failed to add form as a child to the global \"root\" window" );
}
}
rootWindow->hide();
}
GUCEF_DEBUG_LOG( 0, "Failed to load a GUI Form layout" );
return false;
}
示例10: mousePressed
bool CEGUIInputHandler::mousePressed(
const ApplicationMouseCode::MouseButton button) {
//BOOST_LOG_SEV(mBoostLogger, boost::log::trivial::debug)<< "MOUSE BUTTON PRESSED" << button;
CEGUI::GUIContext& context =
CEGUI::System::getSingleton().getDefaultGUIContext();
// Saving a mathgl graph to a file on right click
CEGUI::Window* window = context.getWindowContainingMouse();
if (window != NULL
&& (window->getName() == "MathGLWindow"
|| window->getName() == "MathGLRTTWindow")
&& button == ApplicationMouseCode::RightButton) {
std::vector<MathGLPanel*>::iterator it =
SimulationManager::getSingleton()->getViewController().getGraphWindows().begin();
for (;
it
!= SimulationManager::getSingleton()->getViewController().getGraphWindows().end();
it++) {
if ((*it)->getMathGlWindow() == window
|| (*it)->getMathGlWindow()->getChild("MathGLRTTWindow")
== window) {
(*it)->makePrint();
}
}
}
context.injectMouseButtonDown(InputUtils::convertToCEGUI(button));
return OgreInputHandler::mousePressed(button);
}
示例11:
GUIMessageBox::GUIMessageBox(void)
: d_root(CEGUI::WindowManager::getSingleton().loadLayoutFromFile("MessageBox.layout"))
{
using namespace CEGUI;
CEGUI::Window* parent = NULL;
// we will destroy the console box windows ourselves
d_root->setDestroyedByParent(false);
// Do events wire-up
// d_root->subscribeEvent(PushButton::EventClicked, Event::Subscriber(&GUIMessageBox::handleSubmit, this));
d_root->getChild("Button")->
subscribeEvent(PushButton::EventClicked, Event::Subscriber(&GUIMessageBox::handleSubmit, this));
/*CEGUI::Window* d_fontNameEditbox = static_cast<CEGUI::Editbox*>(d_root->getChild("Login/Name"));
d_fontNameEditbox->subscribeEvent(PushButton::EventClicked, Event::Subscriber(&GUILogin::handleSubmit, this));
d_root->getChild("Login/PassText")->
subscribeEvent(Editbox::EventTextAccepted, Event::Subscriber(&GUILogin::handleSubmit, this));
d_root->getChild("Login/Submit")->subscribeEvent(PushButton::EventClicked, Event::Subscriber(&GUILogin::handleSubmit, this));
*/
// decide where to attach the console main window
parent = parent ? parent : CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow();
// attach this window if parent is valid
if (parent)
parent->addChild(d_root);
}
示例12: OnRButtonDown
void CUIEditorView::OnRButtonDown(UINT nFlags, CPoint point)
{
g_CoreSystem.getCEGUISystem()->injectMousePosition(point.x, point.y);
g_CoreSystem.getCEGUISystem()->injectMouseButtonDown(CEGUI::RightButton);
if( getShowMode() == false ) return;
CMenu menu;
menu.CreatePopupMenu();
CEGUI::Window* mouseWindow = g_CoreSystem.getCEGUISystem()->getWindowContainingMouse();
bool showMenu = false;
INT menuId = ID_RIGHT_WINDOW_SELECT;
for ( ; mouseWindow ; mouseWindow = mouseWindow->getParent(),++menuId )
{
if (mouseWindow != CEGUI::System::getSingleton().getGUISheet() && !mouseWindow->isAutoWindow())
{
menu.AppendMenu(MF_STRING, menuId,mouseWindow->getName().c_str());
showMenu = true;
}
}
if (showMenu)
{
POINT pos;
GetCursorPos(&pos);
menu.TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON,pos.x, pos.y, this);
g_DataPool.OnSelectWindowChanged(NULL, m_pSelectedWindow);
}
CView::OnRButtonDown(nFlags, point);
}
示例13: handleDSActivation
bool GUIManager::handleDSActivation ( CEGUI::EventArgs const & e )
{
CEGUI::Window *tab =
static_cast<CEGUI::WindowEventArgs const &>(e).window->getParent();
CEGUI::Listbox *lb = static_cast<CEGUI::Listbox *>(tab->getChild(0));
ListboxItem *item = static_cast<ListboxItem *>(lb->getFirstSelectedItem());
if (item != NULL) {
DataManager *dm = static_cast<DataManager *>(item->getUserData());
CEGUI::Scrollbar *sb = static_cast<CEGUI::Scrollbar *>(tab->getChild(2));
std::vector<unsigned int> const & dims = dm->getDimensions();
unsigned int dim = dims[int(sb->getScrollPosition()*(dims.size()-1))];
float scrollPos = sb->getScrollPosition();
dm->activate(dim);
// Enable global scrollbar
CEGUI::WindowManager & wm = CEGUI::WindowManager::getSingleton();
sb = static_cast<CEGUI::Scrollbar *>(wm.getWindow("Sheet/DimensionSlider"));
sb->enable();
CEGUI::WindowEventArgs w(sb);
sb->fireEvent(CEGUI::Scrollbar::EventScrollPositionChanged, w);
// Set the global scrollbar to the right position.
sb->setScrollPosition(scrollPos);
CEGUI::Window *desc = wm.getWindow("Sheet/DimensionText");
desc->show();
}
// TODO handle else-error
return true;
}
示例14: TabbableWindow_KeyDown
bool Widget::TabbableWindow_KeyDown(const CEGUI::EventArgs& args)
{
const CEGUI::KeyEventArgs& keyEventArgs = static_cast<const CEGUI::KeyEventArgs&>(args);
if (keyEventArgs.scancode == CEGUI::Key::Tab)
{
//find the window in the list of tabbable windows
CEGUI::Window* activeWindow = mMainWindow->getActiveChild();
if (activeWindow) {
// WindowMap::iterator I = std::find(mTabOrder.begin(), mTabOrder.end(), activeWindow);
WindowMap::iterator I = mTabOrder.find(activeWindow);
if (I != mTabOrder.end()) {
I->second->activate();
//we don't want to process the event any more, in case something else will try to interpret the tab event to also change the focus
Input::getSingleton().suppressFurtherHandlingOfCurrentEvent();
return true;
}
}
} else if (keyEventArgs.scancode == CEGUI::Key::Return)
{
//iterate through all enter buttons, and if anyone is visible, activate it
for (WindowStore::iterator I = mEnterButtons.begin(); I != mEnterButtons.end(); ++I) {
if ((*I)->isVisible()) {
CEGUI::Window* window = *I;
WindowEventArgs args(window);
window->fireEvent(PushButton::EventClicked, args, PushButton::EventNamespace);
break;
}
}
}
return false;
}
示例15: UpdatePetStrenthenWnd
void UpdatePetStrenthenWnd(CEGUI::Window* mainPage, long type)
{
if (!mainPage)
return;
char tempText[256];
CPlayer* player = GetGame()->GetMainPlayer();
map<CGUID, CPet*>* petList = player->GetPetList();
map<CGUID, CPet*>::iterator iterPet = petList->begin();
for (int i=0; iterPet!=petList->end(); ++iterPet,++i)
{
sprintf(tempText, "PetStrengthen/PetSelectWnd/Pet%d/DragContainer", i+1);
CEGUI::Window* dragItem = mainPage->getChildRecursive(tempText);
if (dragItem)
{
CEGUI::GUISheet* childImg = WGUISheet(dragItem->getChildAtIdx(0));
if(!childImg)
return;
SetBackGroundImage(childImg,"PetID","pictures\\Pet\\PetIcon","pet.jpg");
}
if (i>=PET_SELECT_WND_CNT-1)
break;
}
}