本文整理汇总了C++中cegui::WindowManager类的典型用法代码示例。如果您正苦于以下问题:C++ WindowManager类的具体用法?C++ WindowManager怎么用?C++ WindowManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WindowManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: SelectCharacter
bool SelectorHelper::SelectCharacter( const CEGUI::EventArgs& e ) {
CEGUI::Window* window = static_cast<const CEGUI::MouseEventArgs*>(&e)->window;
CEGUI::WindowManager *wmgr = CEGUI::WindowManager::getSingletonPtr();
CEGUI::Window* penguinButton = wmgr->getWindow("Menu/Penguin");
CEGUI::Window* ogreButton = wmgr->getWindow("Menu/Ogre");
CEGUI::Window* ninjaButton = wmgr->getWindow("Menu/Ninja");
if (window == penguinButton) player_flag = CHARACTER_PENGUIN;
else if (window == ogreButton) player_flag = CHARACTER_OGRE;
else if (window == ninjaButton) player_flag = CHARACTER_NINJA;
if (type_flag == TYPE_SINGLE_PLAYER) {
MenuActivity *activity = (MenuActivity*) OgreBallApplication::getSingleton()->activity;
activity->SinglePlayerLevelSelectWrapper(e);
} else if (type_flag == TYPE_MULTI_HOST) {
HostPlayerActivity *activity = (HostPlayerActivity*) OgreBallApplication::getSingleton()->activity;
activity->handlePlayerSelected(player_flag);
} else if (type_flag == TYPE_MULTI_CLIENT) {
ClientPlayerActivity *activity = (ClientPlayerActivity*) OgreBallApplication::getSingleton()->activity;
activity->handlePlayerSelected(player_flag);
}
}
开发者ID:kyeah,项目名称:Game-Technology,代码行数:25,代码来源:SelectorHelper.cpp
示例2: setupCEGUI
void Application::setupCEGUI()
{
// CEGUI setup
m_renderer = new CEGUI::OgreCEGUIRenderer(m_window, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, m_sceneManager);
m_system = new CEGUI::System(m_renderer);
CEGUI::SchemeManager::getSingleton().loadScheme((CEGUI::utf8*)"TaharezLookSkin.scheme");
m_system->setDefaultMouseCursor((CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseArrow");
m_system->setDefaultFont((CEGUI::utf8*)"BlueHighway-12");
CEGUI::WindowManager *win = CEGUI::WindowManager::getSingletonPtr();
CEGUI::Window *sheet = win->createWindow("DefaultGUISheet", "Sheet");
float distanceBorder = 0.01;
float sizeX = 0.2;
float sizeY = 0.05;
float posX = distanceBorder;
float posY = distanceBorder;
debugWindow = win->createWindow("TaharezLook/StaticText", "Widget1");
debugWindow->setPosition(CEGUI::UVector2(CEGUI::UDim(posX, 0), CEGUI::UDim(posY, 0)));
debugWindow->setSize(CEGUI::UVector2(CEGUI::UDim(sizeX, 0), CEGUI::UDim(sizeY, 0)));
debugWindow->setText("Debug Info!");
sheet->addChildWindow(debugWindow);
m_system->setGUISheet(sheet);
}
开发者ID:juanjmostazo,项目名称:ouan-tests,代码行数:28,代码来源:Application.cpp
示例3: 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;
}
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:60,代码来源:guidriverCEGUI_CFormBackendImp.cpp
示例4: t
//-------------------------------------------------------------------------------------
bool
NetworkManager::connect(const CEGUI::EventArgs&)
{
CEGUI::WindowManager *winMgr = CEGUI::WindowManager::getSingletonPtr();
CEGUI::String Iptmp;
CEGUI::String PortTmp;
unsigned int i = 1;
if (winMgr->isWindowPresent("Connect/ContainerGrp/Ip"))
{
Iptmp = winMgr->getWindow("Connect/ContainerGrp/Ip")->getText();
PortTmp = winMgr->getWindow("Connect/ContainerGrp/Port")->getText();
this->ip_ = std::string(Iptmp.c_str());
this->port_ = StringToNumber<const char *, int>(PortTmp.c_str());
zappy::Convert *c = new zappy::Convert();
zappy::Network::initInstance(this->ip_ , this->port_, *c);
zappy::Network &p = zappy::Network::getInstance();
p.setParameters(this->port_, this->ip_);
p.connect_();
if (p.isConnected())
{
Thread<zappy::Network> t(p);
t.start();
while (p.gettingMap() && i < 5000)
usleep(++i);
this->GfxMgr_->hide("Connect");
this->GfxMgr_->createRealScene();
}
}
return true;
}
开发者ID:jorge-d,项目名称:zappy,代码行数:31,代码来源:NetworkManager.cpp
示例5: catch
bool
CFormBackendImp::LoadLayout( GUCEF::CORE::CIOAccess& layoutStorage )
{GUCE_TRACE;
CEGUI::Window* rootWindow = NULL;
CEGUI::WindowManager* wmgr = CEGUI::WindowManager::getSingletonPtr();
GUCEF_DEBUG_LOG( 0, "Starting layout load for a GUI Form" );
try
{
// provide hacky access to the given data
m_dummyArchive->AddResource( layoutStorage, "currentFile" );
// Now we can load the window layout from the given storage
// Note that if CEGUI ever provides an interface to do this directly
// clean up this mess !!!
rootWindow = wmgr->loadWindowLayout( "currentFile" ,
m_widgetNamePrefix.C_String() ,
m_resourceGroupName.C_String() );
m_dummyArchive->ClearResourceList();
}
catch ( Ogre::Exception& e )
{
GUCEF_ERROR_LOG( 0, CString( "Ogre Exception while attempting to load form layout: " ) + e.getFullDescription().c_str() );
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
CEGUI::Window* globalRootWindow = wmgr->getWindow( "root" );
if ( NULL != globalRootWindow )
{
globalRootWindow->addChildWindow( 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 loaded a GUI Form layout" );
return false;
}
开发者ID:LiberatorUSA,项目名称:GUCE,代码行数:59,代码来源:guceCEGUIOgre_CFormBackendImp.cpp
示例6: createGUIWindow
/**
* Create all widgets and their initial contents.
*
* CEGUI is based on tree structure of Windows. On top of that
* tree is a GUISheet, named "root". Each child has a position and
* a size - both given as values relative to the parent elements area.
* Position is given as the top left corner of a child within the parent area.
* Size is given as the relative portions of the parent area.
*/
void createGUIWindow()
{
CEGUI::System *ceguiSystem= CEGUI::System::getSingletonPtr();
assert(ceguiSystem);
CEGUI::WindowManager *winMgr = CEGUI::WindowManager::getSingletonPtr();
assert(winMgr);
CEGUI::Window *ceguiRoot = winMgr->createWindow("DefaultGUISheet","root");
assert(ceguiRoot);
ceguiSystem->setGUISheet(ceguiRoot); // Top element, fills the display area
CEGUI::UVector2 buttonSize = CEGUI::UVector2(CEGUI::UDim(0.6, 0), CEGUI::UDim(0.1, 0));
setupCEGUIResources();
// Create a button of type "TaharezLook/Button" and name "root/Button"
mButton = winMgr->createWindow(
reinterpret_cast<const CEGUI::utf8*>("TaharezLook/Button"),
reinterpret_cast<const CEGUI::utf8*>("root/Button"));
mButton->setAlpha(0.5f);
mButton->setText("Hello World!");
mButton->setSize(buttonSize);
mButton->setPosition(CEGUI::UVector2(CEGUI::UDim(0.2, 0), CEGUI::UDim(0.6, 0)));
mEditBox = winMgr->createWindow(
reinterpret_cast<const CEGUI::utf8*>("TaharezLook/Editbox"),
reinterpret_cast<const CEGUI::utf8*>("root/EditBox"));
mEditBox->setAlpha(0.5f);
mEditBox->setSize(CEGUI::UVector2(CEGUI::UDim(0.6, 0), CEGUI::UDim(0.1, 0)));
mEditBox->setPosition(CEGUI::UVector2(CEGUI::UDim(0.2, 0), CEGUI::UDim(0.3, 0)));
// Add both created elements to the GUI sheet.
ceguiRoot->addChildWindow(mEditBox);
ceguiRoot->addChildWindow(mButton);
/* Add event subscribers to both elements.
* CEGUI input handling is based on function pointers being subscribed
* to certain events - events of each window type are defined in the
* CEGUI API docs. When the event occurs, all subscriber functions
* are called (in some order?)
*/
// EventTextAccepted occurs when input box has focus, and user presses
// Enter, Return or Tab, and so accepts the input.
mEditBox->subscribeEvent(CEGUI::Editbox::EventTextAccepted,
CEGUI::Event::Subscriber(&inputEntered));
// EventClicked occurs when button is clicked.
mButton->subscribeEvent(CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber(&inputEntered));
}
开发者ID:jdahlbom,项目名称:ApMech,代码行数:59,代码来源:main.cpp
示例7:
LoginScreenInterface::LoginScreenInterface(){
#ifdef WITH_CEGUI_SUPPORT
CEGUI::WindowManager *wmanager = CEGUI::WindowManager::getSingletonPtr();
m_LoginScreenWindow = wmanager->loadWindowLayout(
"loginscreen.layout",
""
);
if (m_LoginScreenWindow)
{
CEGUI::System::getSingleton().getGUISheet()->addChildWindow(m_LoginScreenWindow);
}
#endif
}
开发者ID:alexandre-janniaux,项目名称:World-of-One-Piece,代码行数:15,代码来源:LoginScreenInterface.cpp
示例8: update
void MyGUI::update(float timeSinceLastFrame)
{
//在這裡更新衛星的狀態
CEGUI::WindowManager* winMgr = CEGUI::WindowManager::getSingletonPtr();
//衛星的狀態
CEGUI::String str_status;
if(SatelliteStatus::current_status == SatelliteStatus::UNLAUNCHED){
str_status = GetUTF(L"未发射");
}
else if(SatelliteStatus::current_status == SatelliteStatus::RISING){
str_status = GetUTF(L"上升中");
}
else if(SatelliteStatus::current_status == SatelliteStatus::NEAR_TRACK){
str_status = GetUTF(L"近地轨道");
}
else if(SatelliteStatus::current_status == SatelliteStatus::ECLLIPSE){
str_status = GetUTF(L"椭圆轨道");
}
else if(SatelliteStatus::current_status == SatelliteStatus::FAR_TRACK){
str_status = GetUTF(L"远地轨道");
}
else if(SatelliteStatus::current_status == SatelliteStatus::OUT_CONTROL){
str_status = GetUTF(L"失控");
}
winMgr->getWindow("text_status")->setText(str_status);
//卫星的坐标
char buffer0[1024];
char buffer1[1024];
char buffer2[1024];
sprintf(buffer0,"%f",SatelliteStatus::satellite_x);
sprintf(buffer1,"%f",SatelliteStatus::satellite_y);
sprintf(buffer2,"%f",SatelliteStatus::satellite_z);
CEGUI::String strx(buffer0);
CEGUI::String stry(buffer1);
CEGUI::String strz(buffer2);
winMgr->getWindow("text_x")->setText(strx);
winMgr->getWindow("text_y")->setText(stry);
winMgr->getWindow("text_z")->setText(strz);
//卫星自转角
sprintf(buffer0,"%f",SatelliteStatus::satellite_angle);
CEGUI::String str_rotate(buffer0);
winMgr->getWindow("text_axisaxis")->setText(strx);
//线速度
sprintf(buffer0,"%f km/h",SatelliteStatus::satellite_lv);
CEGUI::String str_lv(buffer0);
winMgr->getWindow("text_lvlv")->setText(str_lv);
//角速度
sprintf(buffer0,"%f /h",SatelliteStatus::satellite_wv);
CEGUI::String str_wv(buffer0);
winMgr->getWindow("text_wvwv")->setText(str_wv);
//线加速度
sprintf(buffer0,"%f /h^2",SatelliteStatus::satellite_a);
CEGUI::String str_a(buffer0);
winMgr->getWindow("text_aa")->setText(str_a);
MyGUISystem::getSingletonPtr()->update(timeSinceLastFrame);
}
开发者ID:whztt07,项目名称:Satellite-Launching-animation-system,代码行数:58,代码来源:MyGUI.cpp
示例9:
//-------------------------------------------------------------------------------------
bool
NetworkManager::updateTime(const CEGUI::EventArgs&)
{
CEGUI::WindowManager *winMgr = CEGUI::WindowManager::getSingletonPtr();
std::string time;
std::string s;
if (winMgr->isWindowPresent("Time/Container/Time"))
{
zappy::Network &net = zappy::Network::getInstance();
time = winMgr->getWindow("Time/Container/Time")->getText().c_str();
s = "sst " + time + "\n";
net.setToSend(s);
}
return true;
}
开发者ID:jorge-d,项目名称:zappy,代码行数:18,代码来源:NetworkManager.cpp
示例10: SwitchToPlayerSelectMenu
void SelectorHelper::SwitchToPlayerSelectMenu(void) {
CEGUI::WindowManager *wmgr = CEGUI::WindowManager::getSingletonPtr();
CEGUI::System::getSingleton().setGUISheet(wmgr->getWindow("Menu/PlayerSelect"));
CEGUI::Window* penguinButton = wmgr->getWindow("Menu/Penguin");
CEGUI::Window* ogreButton = wmgr->getWindow("Menu/Ogre");
CEGUI::Window* ninjaButton = wmgr->getWindow("Menu/Ninja");
penguinButton->subscribeEvent(CEGUI::PushButton::EventClicked,
&SelectorHelper::SelectCharacter);
ogreButton->subscribeEvent(CEGUI::PushButton::EventClicked,
&SelectorHelper::SelectCharacter);
ninjaButton->subscribeEvent(CEGUI::PushButton::EventClicked,
&SelectorHelper::SelectCharacter);
}
开发者ID:kyeah,项目名称:Game-Technology,代码行数:17,代码来源:SelectorHelper.cpp
示例11: CreateCEGUIWindow
void GameConsoleWindow::CreateCEGUIWindow()
{
// Get a local pointer to the CEGUI Window Manager, Purely for convenience to reduce typing
CEGUI::WindowManager *pWindowManager = CEGUI::WindowManager::getSingletonPtr();
// Now before we load anything, lets increase our instance number to ensure no conflicts.
// I like the format #_ConsoleRoot so thats how i'm gonna make the prefix. This simply
// Increments the iInstanceNumber then puts it + a _ into the sNamePrefix string.
sNamePrefix = ++iInstanceNumber + "_";
// Now that we can ensure that we have a safe prefix, and won't have any naming conflicts lets create the window
// and assign it to our member window pointer m_ConsoleWindow
// inLayoutName is the name of your layout file (for example "console.layout"), don't forget to rename inLayoutName by our layout file
CasaEngine::IFile* pFile = CasaEngine::MediaManager::Instance().FindMedia("GameConsole.layout", CasaEngine::FileMode::READ);
if (pFile != nullptr)
{
CEGUI::String xmlStr(pFile->GetBuffer());
m_ConsoleWindow = pWindowManager->loadLayoutFromString(xmlStr);
DELETE_AO pFile;
pFile = nullptr;
}
else
{
throw CasaEngine::CLoadingFailed("GameConsole.layout", "");
}
// Being a good programmer, its a good idea to ensure that we got a valid window back.
if (m_ConsoleWindow)
{
CEGUI::System::getSingleton().getDefaultGUIContext().setRootWindow(m_ConsoleWindow);
// Lets add our new window to the Root GUI Window
//CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->addChildWindow(m_ConsoleWindow);
//CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->addChild(m_ConsoleWindow);
// Now register the handlers for the events (Clicking, typing, etc)
(this)->RegisterHandlers();
}
else
{
// Something bad happened and we didn't successfully create the window lets output the information
CEGUI::Logger::getSingleton().logEvent("Error: Unable to load the ConsoleWindow from .layout");
}
}
开发者ID:xcasadio,项目名称:casaengine,代码行数:43,代码来源:GameConsoleWindow.cpp
示例12: createMenu
void InGameMenuWindow::createMenu(MenuBase* menu)
{
CEGUI::WindowManager* windowMan = CEGUI::WindowManager::getSingletonPtr();
const ActionVector actions = ActionManager::getSingleton().getInGameGlobalActions();
map<CeGuiString, PopupMenu*> menuGroups;
for (ActionVector::const_iterator actIter = actions.begin(); actIter != actions.end(); actIter++)
{
Action* action = *actIter;
ActionGroup* group = action->getGroup();
if (group != NULL)
{
PopupMenu* menuGrp;
map<CeGuiString, PopupMenu*>::iterator grpIter = menuGroups.find(group->getName());
if (grpIter != menuGroups.end())
{
menuGrp = (*grpIter).second;
}
else
{
MenuItem* grpItem = static_cast<MenuItem*>(windowMan->createWindow("RastullahLook/MenuItem",
getNamePrefix()+"IngameMenu/"+group->getName()));
grpItem->setText(group->getName());
menu->addChildWindow(grpItem);
menuGrp = static_cast<PopupMenu*>(windowMan->createWindow("RastullahLook/PopupMenu",
getNamePrefix()+"IngameMenu/Menu"+group->getName()));
grpItem->addChildWindow(menuGrp);
menuGroups[group->getName()] = menuGrp;
}
MenuItem* item = static_cast<MenuItem*>(windowMan->createWindow("RastullahLook/MenuItem",
getNamePrefix()+"IngameMenu/"+group->getName()+"/"+action->getName()));
item->setText(action->getDescription());
menuGrp->addChildWindow(item);
setAction(item, action);
}
}
}
开发者ID:BackupTheBerlios,项目名称:dsa-hl-svn,代码行数:42,代码来源:InGameMenuWindow.cpp
示例13: EventSpeedUp
//近地点加速
bool EventSpeedUp(const CEGUI::EventArgs& e)
{
/*if(SatelliteStatus::current_status != SatelliteStatus::NEAR_TRACK){
//TODO: Anouce BUG
return true;
}
SatelliteStatus::current_status = SatelliteStatus::ECLLIPSE;*/
if(SatelliteStatus::current_status != SatelliteStatus::UNLAUNCHED){
return false;
}
//Read the Data and set it
double near_ = 468.55;
double far_ = 800.00;
CEGUI::WindowManager* winMgr = CEGUI::WindowManager::getSingletonPtr();
CEGUI::String& strnear = const_cast<CEGUI::String&>(winMgr->getWindow("edit_near")->getText() );
CEGUI::String& strfar = const_cast<CEGUI::String&>(winMgr->getWindow("edit_far")->getText() );
near_ = atof(strnear.c_str() );
far_ = atof(strfar.c_str() );
SetParameter(near_,far_);
return true;
}
开发者ID:whztt07,项目名称:Satellite-Launching-animation-system,代码行数:22,代码来源:MyGUI.cpp
示例14: CreateText
CEGUI::Window* TestAARHUD::CreateText(const std::string& name, CEGUI::Window* parent, const std::string& text,
float x, float y, float width, float height)
{
CEGUI::WindowManager* wm = CEGUI::WindowManager::getSingletonPtr();
// create base window and set our default attribs
CEGUI::Window* result = wm->createWindow("WindowsLook/StaticText", name);
parent->addChildWindow(result);
result->setText(text);
result->setPosition(CEGUI::UVector2(cegui_absdim(x), cegui_absdim(y)));
result->setSize(CEGUI::UVector2(cegui_absdim(width), cegui_absdim(height)));
result->setProperty("FrameEnabled", "false");
result->setProperty("BackgroundEnabled", "false");
result->setHorizontalAlignment(CEGUI::HA_LEFT);
result->setVerticalAlignment(CEGUI::VA_TOP);
// set default color to white
result->setProperty("TextColours",
CEGUI::PropertyHelper::colourToString(CEGUI::colour(1.0f, 1.0f, 1.0f)));
result->show();
return result;
}
开发者ID:VRAC-WATCH,项目名称:deltajug,代码行数:22,代码来源:testaarhud.cpp
示例15: createGUI
void BasicWindow::createGUI(void) {
mRenderer = &CEGUI::OgreRenderer::bootstrapSystem();
CEGUI::Imageset::setDefaultResourceGroup("Imagesets");
CEGUI::Font::setDefaultResourceGroup("Fonts");
CEGUI::Scheme::setDefaultResourceGroup("Schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("LookNFeel");
CEGUI::WindowManager::setDefaultResourceGroup("Layouts");
CEGUI::SchemeManager::getSingleton().create("TaharezLook.scheme");
CEGUI::System::getSingleton().setDefaultMouseCursor("TaharezLook", "MouseArrow");
CEGUI::WindowManager* winMgr = CEGUI::WindowManager::getSingletonPtr();
CEGUI::System* guiSystem = CEGUI::System::getSingletonPtr();
CEGUI::Window* rootWindow = winMgr->createWindow("DefaultWindow", "root");
guiSystem->setGUISheet(rootWindow);
/* not using the gui quite yet:
try {
rootWindow->addChildWindow(CEGUI::WindowManager::getSingleton().loadWindowLayout("Console.layout"));
rootWindow->addChildWindow(CEGUI::WindowManager::getSingleton().loadWindowLayout("RightPanel.layout"));
} catch (CEGUI::Exception& e) {
OGRE_EXCEPT(Ogre::Exception::ERR_INTERNAL_ERROR, std::string(e.getMessage().c_str()), "Error parsing gui layout");
}
*/
/*
// "Quit" button:
CEGUI::WindowManager& winMgr = CEGUI::WindowManager::getSingleton();
CEGUI::Window* sheet = winMgr.createWindow("DefaultWindow", "CEGUIDemo/Sheet");
CEGUI::Window* quit = winMgr.createWindow("TaharezLook/Button", "CEGUIDemo/QuitButton");
quit->setText("Quit");
quit->setSize(CEGUI::UVector2(CEGUI::UDim(0.15f, 0), CEGUI::UDim(0.05f, 0)));
quit->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&BasicWindow::quit, this));
sheet->addChildWindow(quit);
CEGUI::System::getSingleton().setGUISheet(sheet);
*/
}
开发者ID:donglefritz,项目名称:DarkMatters,代码行数:38,代码来源:BasicWindow.cpp
示例16: SetupGUI
void TestAARHUD::SetupGUI(dtCore::DeltaWin& win,
dtCore::Keyboard& keyboard,
dtCore::Mouse& mouse)
{
char clin[HUDCONTROLMAXTEXTSIZE]; // general buffer to print
float curYPos;
float helpTextWidth = 400;
float taskTextWidth = 300;
try
{
// Initialize CEGUI
mGUI = new dtGUI::CEUIDrawable(&win, &keyboard, &mouse);
std::string scheme = "gui/schemes/WindowsLook.scheme";
std::string path = dtCore::FindFileInPathList(scheme);
if (path.empty())
{
throw dtUtil::Exception(ARRHUDException::INIT_ERROR,
"Failed to find the scheme file.", __FILE__, __LINE__);
}
std::string dir = path.substr(0, path.length() - (scheme.length() - 3));
dtUtil::FileUtils::GetInstance().PushDirectory(dir);
CEGUI::SchemeManager::getSingleton().loadScheme(path);
dtUtil::FileUtils::GetInstance().PopDirectory();
CEGUI::WindowManager* wm = CEGUI::WindowManager::getSingletonPtr();
CEGUI::System::getSingleton().setDefaultFont("DejaVuSans-10");
CEGUI::System::getSingleton().getDefaultFont()->setProperty("PointSize", "14");
mMainWindow = wm->createWindow("DefaultGUISheet", "root");
CEGUI::System::getSingleton().setGUISheet(mMainWindow);
// MEDIUM FIELDS - on in Medium or max
mHUDOverlay = wm->createWindow("WindowsLook/StaticImage", "medium_overlay");
mMainWindow->addChildWindow(mHUDOverlay);
mHUDOverlay->setPosition(CEGUI::UVector2(cegui_reldim(0.0f),cegui_reldim(0.0f)));
mHUDOverlay->setSize(CEGUI::UVector2(cegui_reldim(1.0f), cegui_reldim(1.0f)));
mHUDOverlay->setProperty("FrameEnabled", "false");
mHUDOverlay->setProperty("BackgroundEnabled", "false");
// Main State - idle/playback/record
mStateText = CreateText("State Text", mHUDOverlay, "", 10.0f, 20.0f, 120.0f, mTextHeight + 5);
mStateText->setProperty("TextColours", "tl:FFFF1919 tr:FFFF1919 bl:FFFF1919 br:FFFF1919");
//mStateText->setFont("DejaVuSans-10");
// Core sim info
mSimTimeText = CreateText("Sim Time", mHUDOverlay, "Sim Time",
0.0f, 0.0f, mRightTextXOffset - 2, mTextHeight);
mSpeedFactorText = CreateText("Speed Factor", mHUDOverlay, "Speed",
0.0f, 0.0f, mRightTextXOffset - 2, mTextHeight);
// Detailed record/playback info
mRecordDurationText = CreateText(std::string("Duration"), mHUDOverlay, std::string("Duration"),
0, 0, mRightTextXOffset - 2, mTextHeight);
mNumMessagesText = CreateText(std::string("Num Msgs"), mHUDOverlay, std::string("Num Msgs"),
0, 0, mRightTextXOffset - 2, mTextHeight);
mNumTagsText = CreateText(std::string("Num Tags"), mHUDOverlay, std::string("Num Tags"),
0, 0, mRightTextXOffset - 2, mTextHeight);
mLastTagText = CreateText(std::string("Last Tag"), mHUDOverlay, std::string("LastTag:"),
0, 0, mRightTextXOffset - 2, mTextHeight);
mNumFramesText = CreateText(std::string("Num Frames"), mHUDOverlay, std::string("Num Frames"),
0, 0, mRightTextXOffset - 2, mTextHeight);
mLastFrameText = CreateText(std::string("Last Frame"), mHUDOverlay, std::string("Last Frame"),
0, 0, mRightTextXOffset - 2, mTextHeight);
mCurLogText = CreateText(std::string("Cur Log"), mHUDOverlay, std::string("Cur Log"),
0, 0, mRightTextXOffset - 2, mTextHeight);
mCurMapText = CreateText(std::string("Cur Map"), mHUDOverlay, std::string("Cur Map"),
0, 0, mRightTextXOffset - 2, mTextHeight);
// Core Tips at top of screen (HUD Toggle and Help)
mFirstTipText = CreateText(std::string("First Tip"), mHUDOverlay, std::string("(F2 for MED HUD)"),
0, mTextYTopOffset, 160, mTextHeight + 2);
mFirstTipText->setHorizontalAlignment(CEGUI::HA_CENTRE);
mSecondTipText = CreateText(std::string("Second Tip"), mHUDOverlay, std::string(" (F1 for Help)"),
0, mTextYTopOffset + mTextHeight + 3, 160, mTextHeight + 2);
mSecondTipText->setHorizontalAlignment(CEGUI::HA_CENTRE);
// TASK FIELDS
// task header
curYPos = 70;
mTasksHeaderText = CreateText(std::string("Task Header"), mHUDOverlay, std::string("Tasks:"),
4, curYPos, taskTextWidth - 2, mTextHeight + 2);
//mTasksHeaderText->setFont("DejaVuSans-10");
curYPos += 2;
// 11 placeholders for tasks
for (int i = 0; i < 11; i++)
{
snprintf(clin, HUDCONTROLMAXTEXTSIZE, "Task %i", i);
curYPos += mTextHeight + 2;
mTaskTextList.push_back(CreateText(std::string(clin), mHUDOverlay, std::string(clin),
12, curYPos, taskTextWidth - 2, mTextHeight + 2));
}
// HELP FIELDS
//.........这里部分代码省略.........
开发者ID:VRAC-WATCH,项目名称:deltajug,代码行数:101,代码来源:testaarhud.cpp
示例17: setupCEGUI
void OgreWiiApp::setupCEGUI()
{
//mWindow = mRoot->getAutoCreatedWindow();
mRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneMgr);
mSystem = new CEGUI::System(mRenderer);
CEGUI::SchemeManager::getSingleton().loadScheme((CEGUI::utf8*)"TaharezLookSkin.scheme");
mSystem->setDefaultMouseCursor((CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseArrow");
mSystem->setDefaultFont((CEGUI::utf8*)"BlueHighway-12");
CEGUI::WindowManager *winMgr = CEGUI::WindowManager::getSingletonPtr();
CEGUI::Window *sheet = winMgr->createWindow("DefaultGUISheet", "Vp/Sheet");
CEGUI::UVector2 buttonSize(CEGUI::UDim(0.15, 0), CEGUI::UDim(0.05, 0));
CEGUI::UVector2 checkboxSize(CEGUI::UDim(0.15, 0), CEGUI::UDim(0.05, 0));
CEGUI::UVector2 comboboxSize(CEGUI::UDim(0.15, 0), CEGUI::UDim(0.15, 0));
CEGUI::UVector2 infoboxSize(CEGUI::UDim(0.5, 0.0), CEGUI::UDim(0.1, 0.0));
CEGUI::UVector2 controlboxSize(CEGUI::UDim(0.5, 0.0), CEGUI::UDim(0.5, 0.0));
CEGUI::UVector2 scrollSize(CEGUI::UDim(0.15, 0), CEGUI::UDim(0.025, 0));
float dy = 0.06f;
float y = 0.01f;
CEGUI::Window *win = winMgr->createWindow("TaharezLook/Editbox", "Vp/OscAddress");
win->setText(mAddress);
win->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.01f, 0 ), CEGUI::UDim( y, 0 ) ) );
win->setSize(buttonSize);
sheet->addChildWindow(win);
y+=dy;
win = winMgr->createWindow("TaharezLook/Editbox", "Vp/OscPort");
win->setText(StringConverter::toString(mPort));
win->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.01f, 0 ), CEGUI::UDim( y, 0 ) ) );
win->setSize(buttonSize);
sheet->addChildWindow(win);
y+=dy;
win = winMgr->createWindow("TaharezLook/Button", "Vp/Reconnect");
win->setText("Reconnect");
win->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.01f, 0 ), CEGUI::UDim( y, 0 ) ) );
win->setSize(buttonSize);
sheet->addChildWindow(win);
y+=dy;
win = winMgr->createWindow("TaharezLook/Checkbox", "Vp/FirstPersonView");
win->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.01f, 0 ), CEGUI::UDim( y, 0 ) ) );
win->setText("First Person View");
win->setSize(checkboxSize);
sheet->addChildWindow(win);
y+=dy;
win = winMgr->createWindow("TaharezLook/HorizontalScrollbar", "Vp/Scrollbar1");
win->setText("Scrollbar1");
win->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.01f, 0 ), CEGUI::UDim( y, 0 ) ) );
win->setSize(scrollSize);
sheet->addChildWindow(win);
y+=dy;
win = winMgr->createWindow("TaharezLook/HorizontalScrollbar", "Vp/Scrollbar2");
win->setText("Scrollbar1");
win->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.01f, 0 ), CEGUI::UDim( y, 0 ) ) );
win->setSize(scrollSize);
sheet->addChildWindow(win);
y+=dy;
win = winMgr->createWindow("TaharezLook/HorizontalScrollbar", "Vp/Scrollbar3");
win->setText("Scrollbar1");
win->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.01f, 0 ), CEGUI::UDim( y, 0 ) ) );
win->setSize(scrollSize);
sheet->addChildWindow(win);
// Snapshot button
y+=dy;
win = winMgr->createWindow("TaharezLook/Button", "Vp/SnapButton");
win->setText("Shapshot");
win->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.01f, 0 ), CEGUI::UDim( y, 0 ) ) );
win->setSize(buttonSize);
sheet->addChildWindow(win);
// Quit button
y+=dy;
win = winMgr->createWindow("TaharezLook/Button", "Vp/QuitButton");
win->setText("Quit");
win->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.01f, 0 ), CEGUI::UDim( y, 0 ) ) );
win->setSize(buttonSize);
sheet->addChildWindow(win);
// Info txt box
win = winMgr->createWindow("TaharezLook/StaticText", "Vp/TextBoxInfo");
win->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.01f, 0 ), CEGUI::UDim( 0.85f, 0 ) ) );
win->setSize(infoboxSize);
sheet->addChildWindow(win);
// Info txt box
win = winMgr->createWindow("TaharezLook/StaticText", "Vp/TextBoxAR");
win->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.6f, 0 ), CEGUI::UDim( 0.85f, 0 ) ) );
win->setSize(infoboxSize);
win->setVisible(true);
sheet->addChildWindow(win);
// Controls txt box
//.........这里部分代码省略.........
开发者ID:mcleanjusten,项目名称:wiimpp,代码行数:101,代码来源:OgreWiiApp.cpp
示例18: init
void CMainMenuWindowHandler::init()
{
CEGUI::WindowManager *windowMngr = CEGUI::WindowManager::getSingletonPtr();
m_OnLineCommunityButton = static_cast<CEGUI::PushButton*>(windowMngr->getWindow((CEGUI::utf8*)"MainMenu/OnLineCommunityButton"));
m_virtualChampionshipButton = static_cast<CEGUI::PushButton*>(windowMngr->getWindow((CEGUI::utf8*)"MainMenu/VirtualChampionshipButton"));
m_newManagerGameButton = static_cast<CEGUI::PushButton*>(windowMngr->getWindow((CEGUI::utf8*)"MainMenu/NewManagerGameButton"));
m_ProfessionalCareerButton = static_cast<CEGUI::PushButton*>(windowMngr->getWindow((CEGUI::utf8*)"MainMenu/ProfessionalCareerButton"));
m_EditorButton = static_cast<CEGUI::PushButton*>(windowMngr->getWindow((CEGUI::utf8*)"MainMenu/EditorButton"));
m_FootLibraryButton = static_cast<CEGUI::PushButton*>(windowMngr->getWindow((CEGUI::utf8*)"MainMenu/FootLibraryButton"));
m_configButton = static_cast<CEGUI::PushButton*>(windowMngr->getWindow((CEGUI::utf8*)"MainMenu/ConfigButton"));
m_creditsButton = static_cast<CEGUI::PushButton*>(windowMngr->getWindow((CEGUI::utf8*)"MainMenu/CreditsButton"));
m_quickLoadButton = static_cast<CEGUI::PushButton*>(windowMngr->getWindow((CEGUI::utf8*)"MainMenu/QuickLoadButton"));
m_loadGameButton = static_cast<CEGUI::PushButton*>(windowMngr->getWindow((CEGUI::utf8*)"MainMenu/LoadGameButton"));
m_quitButton = static_cast<CEGUI::PushButton*>(windowMngr->getWindow((CEGUI::utf8*)"MainMenu/QuitButton"));
m_currentDate = static_cast<CEGUI::Window*>(windowMngr->getWindow((CEGUI::utf8*)"MainMenu/CurrentDate"));
m_versionDate = static_cast<CEGUI::Window*>(windowMngr->getWindow((CEGUI::utf8*)"MainMenu/VersionDate"));
m_version = static_cast<CEGUI::Window*>(windowMngr->getWindow((CEGUI::utf8*)"MainMenu/Version"));
// Event handle
registerEventConnection(m_virtualChampionshipButton->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&CMainMenuWindowHandler::virtualChampionshipButtonClicked, this)));
registerEventConnection(m_EditorButton ->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&CMainMenuWindowHandler::editorButtonClicked, this)));
registerEventConnection(m_newManagerGameButton ->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&CMainMenuWindowHandler::newManagerGameButtonClicked, this)));
registerEventConnection(m_configButton ->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&CMainMenuWindowHandler::configButtonClicked, this)));
registerEventConnection(m_creditsButton ->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&CMainMenuWindowHandler::creditsButtonClicked, this)));
registerEventConnection(m_loadGameButton ->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&CMainMenuWindowHandler::loadGameButtonClicked, this)));
registerEventConnection(m_quickLoadButton ->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&CMainMenuWindowHandler::quickLoadButtonClicked, this)));
registerEventConnection(m_quitButton ->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&CMainMenuWindowHandler::quitButtonClicked, this)));
// i18n support
m_OnLineCommunityButton ->setText((CEGUI::utf8*)gettext("On-line Community"));
m_virtualChampionshipButton->setText((CEGUI::utf8*)gettext("Virtual Championship"));
m_newManagerGameButton ->setText((CEGUI::utf8*)gettext("Manager League"));
m_ProfessionalCareerButton ->setText((CEGUI::utf8*)gettext("Professional Career"));
m_EditorButton ->setText((CEGUI::utf8*)gettext("Editor"));
m_FootLibraryButton ->setText((CEGUI::utf8*)gettext("Football Library"));
m_configButton ->setText((CEGUI::utf8*)gettext("Configuration"));
m_creditsButton ->setText((CEGUI::utf8*)gettext("Credits"));
m_quickLoadButton ->setTooltipText((CEGUI::utf8*)gettext("Quick Load"));
m_loadGameButton ->setTooltipText((CEGUI::utf8*)gettext("Load"));
m_quitButton ->setTooltipText((CEGUI::utf8*)gettext("Quit"));
windowMngr->getWindow((CEGUI::utf8*)"MainMenu/CurrentDateLabel")->setText((CEGUI::utf8*)gettext("Today is:"));
windowMngr->getWindow((CEGUI::utf8*)"MainMenu/VersionDateLabel")->setText((CEGUI::utf8*)gettext("Last update:"));
}
开发者ID:dividio,项目名称:projectfootball,代码行数:44,代码来源:CMainMenuWindowHandler.cpp
示例19: init
bool MyGUI::init()
{
bool ret_value = MyGUISystem::getSingletonPtr()->init();
//加载窗
|
请发表评论