本文整理汇总了C++中cegui::FrameWindow::setWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameWindow::setWidth方法的具体用法?C++ FrameWindow::setWidth怎么用?C++ FrameWindow::setWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::FrameWindow
的用法示例。
在下文中一共展示了FrameWindow::setWidth方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RestoreGUISizes
/***********************************************************
restore the correct size of the windows
***********************************************************/
void JournalBox::RestoreGUISizes()
{
CEGUI::FrameWindow * frw = static_cast<CEGUI::FrameWindow *> (
CEGUI::WindowManager::getSingleton().getWindow("JournalFrame"));
frw->setPosition(CEGUI::UVector2(CEGUI::UDim(_savedPosX, 0), CEGUI::UDim(_savedPosY, 0)));
frw->setWidth(CEGUI::UDim(_savedSizeX, 0));
frw->setHeight(CEGUI::UDim(_savedSizeY, 0));
}
示例2: Initialize
/***********************************************************
initalize the box
***********************************************************/
void TeleportBox::Initialize(CEGUI::Window* Root)
{
try
{
_myBox = CEGUI::WindowManager::getSingleton().loadWindowLayout( "TeleportBox.layout" );
Root->addChildWindow(_myBox);
static_cast<CEGUI::PushButton *> (
CEGUI::WindowManager::getSingleton().getWindow("TeleportCancelButton"))->subscribeEvent (
CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber (&TeleportBox::HandleClose, this));
static_cast<CEGUI::PushButton *> (
CEGUI::WindowManager::getSingleton().getWindow("TeleporGoButton"))->subscribeEvent (
CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber (&TeleportBox::HandleGoButton, this));
CEGUI::FrameWindow * frw = static_cast<CEGUI::FrameWindow *> (
CEGUI::WindowManager::getSingleton().getWindow("TeleportFrame"));
frw->subscribeEvent (
CEGUI::FrameWindow::EventCloseClicked,
CEGUI::Event::Subscriber (&TeleportBox::HandleClose, this));
float PosX, PosY, SizeX, SizeY, OPosX, OPosY, OSizeX, OSizeY;
bool Visible;
ConfigurationManager::GetInstance()->GetFloat("Gui.Teleportbox.PosX", PosX);
ConfigurationManager::GetInstance()->GetFloat("Gui.Teleportbox.PosY", PosY);
ConfigurationManager::GetInstance()->GetFloat("Gui.Teleportbox.SizeX", SizeX);
ConfigurationManager::GetInstance()->GetFloat("Gui.Teleportbox.SizeY", SizeY);
ConfigurationManager::GetInstance()->GetFloat("Gui.Teleportbox.OffsetPosX", OPosX);
ConfigurationManager::GetInstance()->GetFloat("Gui.Teleportbox.OffsetPosY", OPosY);
ConfigurationManager::GetInstance()->GetFloat("Gui.Teleportbox.OffsetSizeX", OSizeX);
ConfigurationManager::GetInstance()->GetFloat("Gui.Teleportbox.OffsetSizeY", OSizeY);
ConfigurationManager::GetInstance()->GetBool("Gui.Teleportbox.Visible", Visible);
frw->setPosition(CEGUI::UVector2(CEGUI::UDim(PosX, OPosX), CEGUI::UDim(PosY, OPosY)));
frw->setWidth(CEGUI::UDim(SizeX, OSizeX));
frw->setHeight(CEGUI::UDim(SizeY, OSizeY));
if(Visible)
frw->show();
else
frw->hide();
}
catch(CEGUI::Exception &ex)
{
LogHandler::getInstance()->LogToFile(std::string("Exception init teleport box: ") + ex.getMessage().c_str());
}
}
示例3: Initialize
/***********************************************************
initalize the box
***********************************************************/
void LetterViewerBox::Initialize(CEGUI::Window* Root)
{
try
{
_myBox = CEGUI::WindowManager::getSingleton().loadWindowLayout( "letterviewer.layout" );
Root->addChildWindow(_myBox);
static_cast<CEGUI::PushButton *> (
CEGUI::WindowManager::getSingleton().getWindow("LetterViewerGoB"))->subscribeEvent (
CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber (&LetterViewerBox::HandleOK, this));
static_cast<CEGUI::PushButton *> (
CEGUI::WindowManager::getSingleton().getWindow("LetterViewerDestroyB"))->subscribeEvent (
CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber (&LetterViewerBox::HandleCancel, this));
CEGUI::FrameWindow * frw = static_cast<CEGUI::FrameWindow *> (
CEGUI::WindowManager::getSingleton().getWindow("LetterViewerWIndowFrame"));
frw->subscribeEvent (
CEGUI::FrameWindow::EventCloseClicked,
CEGUI::Event::Subscriber (&LetterViewerBox::HandleOK, this));
_myBox->hide();
InventoryHandler::getInstance()->SetLetterViewer(this);
float PosX, PosY, SizeX, SizeY, OPosX, OPosY, OSizeX, OSizeY;
ConfigurationManager::GetInstance()->GetFloat("Gui.LetterViewerFrame.PosX", PosX);
ConfigurationManager::GetInstance()->GetFloat("Gui.LetterViewerFrame.PosY", PosY);
ConfigurationManager::GetInstance()->GetFloat("Gui.LetterViewerFrame.SizeX", SizeX);
ConfigurationManager::GetInstance()->GetFloat("Gui.LetterViewerFrame.SizeY", SizeY);
ConfigurationManager::GetInstance()->GetFloat("Gui.LetterViewerFrame.OffsetPosX", OPosX);
ConfigurationManager::GetInstance()->GetFloat("Gui.LetterViewerFrame.OffsetPosY", OPosY);
ConfigurationManager::GetInstance()->GetFloat("Gui.LetterViewerFrame.OffsetSizeX", OSizeX);
ConfigurationManager::GetInstance()->GetFloat("Gui.LetterViewerFrame.OffsetSizeY", OSizeY);
frw->setPosition(CEGUI::UVector2(CEGUI::UDim(PosX, OPosX), CEGUI::UDim(PosY, OPosY)));
frw->setWidth(CEGUI::UDim(SizeX, OSizeX));
frw->setHeight(CEGUI::UDim(SizeY, OSizeY));
}
catch(CEGUI::Exception &ex)
{
LogHandler::getInstance()->LogToFile(std::string("Exception init LetterEditorBox: ") + ex.getMessage().c_str());
}
}
示例4: Initialize
/***********************************************************
initalize the box
***********************************************************/
void CommunityBox::Initialize(CEGUI::Window* Root)
{
try
{
_myBox = CEGUI::WindowManager::getSingleton().loadWindowLayout( "community.layout" );
Root->addChildWindow(_myBox);
CEGUI::FrameWindow * frw = static_cast<CEGUI::FrameWindow *> (
CEGUI::WindowManager::getSingleton().getWindow("CommunityFrame"));
frw->subscribeEvent (
CEGUI::FrameWindow::EventCloseClicked,
CEGUI::Event::Subscriber (&CommunityBox::HandleClose, this));
float PosX, PosY, SizeX, SizeY, OPosX, OPosY, OSizeX, OSizeY;
bool Visible;
ConfigurationManager::GetInstance()->GetFloat("Gui.Communitybox.PosX", PosX);
ConfigurationManager::GetInstance()->GetFloat("Gui.Communitybox.PosY", PosY);
ConfigurationManager::GetInstance()->GetFloat("Gui.Communitybox.SizeX", SizeX);
ConfigurationManager::GetInstance()->GetFloat("Gui.Communitybox.SizeY", SizeY);
ConfigurationManager::GetInstance()->GetFloat("Gui.Communitybox.OffsetPosX", OPosX);
ConfigurationManager::GetInstance()->GetFloat("Gui.Communitybox.OffsetPosY", OPosY);
ConfigurationManager::GetInstance()->GetFloat("Gui.Communitybox.OffsetSizeX", OSizeX);
ConfigurationManager::GetInstance()->GetFloat("Gui.Communitybox.OffsetSizeY", OSizeY);
ConfigurationManager::GetInstance()->GetBool("Gui.Communitybox.Visible", Visible);
frw->setPosition(CEGUI::UVector2(CEGUI::UDim(PosX, OPosX), CEGUI::UDim(PosY, OPosY)));
frw->setWidth(CEGUI::UDim(SizeX, OSizeX));
frw->setHeight(CEGUI::UDim(SizeY, OSizeY));
static_cast<CEGUI::PushButton *> (
CEGUI::WindowManager::getSingleton().getWindow("CommunityFrame/friendAdd"))->subscribeEvent (
CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber (&CommunityBox::HandleAddFriend, this));
static_cast<CEGUI::PushButton *> (
CEGUI::WindowManager::getSingleton().getWindow("CommunityFrame/friendRemove"))->subscribeEvent (
CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber (&CommunityBox::HandleRemoveFriend, this));
static_cast<CEGUI::PushButton *> (
CEGUI::WindowManager::getSingleton().getWindow("CommunityFrame/friendRefresh"))->subscribeEvent (
CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber (&CommunityBox::HandleRefreshFriend, this));
_myChooseName = CEGUI::WindowManager::getSingleton().loadWindowLayout( "AddFriendName.layout" );
_myChooseName->setProperty("AlwaysOnTop", "True");
Root->addChildWindow(_myChooseName);
_myChooseName->hide();
{
CEGUI::FrameWindow * fw = static_cast<CEGUI::FrameWindow *>(_myChooseName);
fw->subscribeEvent ( CEGUI::FrameWindow::EventCloseClicked,
CEGUI::Event::Subscriber (&CommunityBox::HandleCPCancel, this) );
static_cast<CEGUI::PushButton *> (
CEGUI::WindowManager::getSingleton().getWindow("Chat/AddFriendName/bOk"))->subscribeEvent (
CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber (&CommunityBox::HandleCPOk, this));
static_cast<CEGUI::PushButton *> (
CEGUI::WindowManager::getSingleton().getWindow("Chat/AddFriendName/bCancel"))->subscribeEvent (
CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber (&CommunityBox::HandleCPCancel, this));
}
static_cast<CEGUI::Listbox *> (
CEGUI::WindowManager::getSingleton().getWindow("Community/friendlist"))->subscribeEvent (
CEGUI::Listbox::EventMouseDoubleClick,
CEGUI::Event::Subscriber (&CommunityBox::HandleListdblClick, this));
static_cast<CEGUI::Listbox *> (
CEGUI::WindowManager::getSingleton().getWindow("Community/onlinelist"))->subscribeEvent (
CEGUI::Listbox::EventMouseDoubleClick,
CEGUI::Event::Subscriber (&CommunityBox::HandleConnecteddblClick, this));
if(Visible)
frw->show();
else
frw->hide();
}
catch(CEGUI::Exception &ex)
{
LogHandler::getInstance()->LogToFile(std::string("Exception init community box: ") + ex.getMessage().c_str());
}
}
示例5: Initialize
//.........这里部分代码省略.........
static_cast<CEGUI::Editbox *> (
CEGUI::WindowManager::getSingleton().getWindow("Chat/edit"))->subscribeEvent (
CEGUI::Editbox::EventKeyDown,
CEGUI::Event::Subscriber (&ChatBox::HandleEnterKey, this));
static_cast<CEGUI::Editbox *> (
CEGUI::WindowManager::getSingleton().getWindow("Chat/edit"))->subscribeEvent (
CEGUI::Editbox::EventKeyUp,
CEGUI::Event::Subscriber (&ChatBox::HandleReleaseKey, this));
_lb = static_cast<CEGUI::Listbox *>
(CEGUI::WindowManager::getSingleton().createWindow( "TaharezLook/Listbox", "Chat/listchannel" ));
_lb->subscribeEvent(CEGUI::Listbox::EventSelectionChanged,
CEGUI::Event::Subscriber (&ChatBox::HandleLbSelected, this));
_lb->setProperty("Text", "Channels");
_lb->setProperty("UnifiedMaxSize", "{{1,0},{1,0}}");
_lb->setProperty("UnifiedAreaRect", "{{0,10},{1,-160},{0,120},{1,-40}}");
_lb->setProperty("AlwaysOnTop", "True");
_myChat->addChildWindow(_lb);
_lb->hide();
_myChannels = CEGUI::WindowManager::getSingleton().loadWindowLayout( "choosechannel.layout" );
_myChannels->setProperty("AlwaysOnTop", "True");
Root->addChildWindow(_myChannels);
_myChannels->hide();
_myChooseName = CEGUI::WindowManager::getSingleton().loadWindowLayout( "choosePlayerName.layout" );
_myChooseName->setProperty("AlwaysOnTop", "True");
Root->addChildWindow(_myChooseName);
_myChooseName->hide();
{
CEGUI::FrameWindow * fw = static_cast<CEGUI::FrameWindow *>(_myChannels);
fw->subscribeEvent ( CEGUI::FrameWindow::EventCloseClicked,
CEGUI::Event::Subscriber (&ChatBox::HandleCCCancel, this) );
static_cast<CEGUI::PushButton *> (
CEGUI::WindowManager::getSingleton().getWindow("Chat/chooseChannel/bOk"))->subscribeEvent (
CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber (&ChatBox::HandleCCOk, this));
static_cast<CEGUI::PushButton *> (
CEGUI::WindowManager::getSingleton().getWindow("Chat/chooseChannel/bCancel"))->subscribeEvent (
CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber (&ChatBox::HandleCCCancel, this));
}
{
CEGUI::FrameWindow * fw = static_cast<CEGUI::FrameWindow *>(_myChooseName);
fw->subscribeEvent ( CEGUI::FrameWindow::EventCloseClicked,
CEGUI::Event::Subscriber (&ChatBox::HandleCPCancel, this) );
static_cast<CEGUI::PushButton *> (
CEGUI::WindowManager::getSingleton().getWindow("Chat/choosePlayerName/bOk"))->subscribeEvent (
CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber (&ChatBox::HandleCPOk, this));
static_cast<CEGUI::PushButton *> (
CEGUI::WindowManager::getSingleton().getWindow("Chat/choosePlayerName/bCancel"))->subscribeEvent (
CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber (&ChatBox::HandleCPCancel, this));
}
CEGUI::FrameWindow * frw = static_cast<CEGUI::FrameWindow *> (
CEGUI::WindowManager::getSingleton().getWindow("ChatFrame"));
frw->subscribeEvent (CEGUI::FrameWindow::EventCloseClicked,
CEGUI::Event::Subscriber (&ChatBox::HandleCloseChatbox, this));
float PosX, PosY, SizeX, SizeY, OPosX, OPosY, OSizeX, OSizeY;
bool Visible;
ConfigurationManager::GetInstance()->GetFloat("Gui.Chatbox.PosX", PosX);
ConfigurationManager::GetInstance()->GetFloat("Gui.Chatbox.PosY", PosY);
ConfigurationManager::GetInstance()->GetFloat("Gui.Chatbox.SizeX", SizeX);
ConfigurationManager::GetInstance()->GetFloat("Gui.Chatbox.SizeY", SizeY);
ConfigurationManager::GetInstance()->GetFloat("Gui.Chatbox.OffsetPosX", OPosX);
ConfigurationManager::GetInstance()->GetFloat("Gui.Chatbox.OffsetPosY", OPosY);
ConfigurationManager::GetInstance()->GetFloat("Gui.Chatbox.OffsetSizeX", OSizeX);
ConfigurationManager::GetInstance()->GetFloat("Gui.Chatbox.OffsetSizeY", OSizeY);
ConfigurationManager::GetInstance()->GetBool("Gui.Chatbox.Visible", Visible);
frw->setPosition(CEGUI::UVector2(CEGUI::UDim(PosX, OPosX), CEGUI::UDim(PosY, OPosY)));
frw->setWidth(CEGUI::UDim(SizeX, OSizeX));
frw->setHeight(CEGUI::UDim(SizeY, OSizeY));
if(Visible)
frw->show();
else
frw->hide();
}
catch(CEGUI::Exception &ex)
{
LogHandler::getInstance()->LogToFile(std::string("Exception init chatbox: ") + ex.getMessage().c_str());
}
}
示例6: Initialize
/***********************************************************
initalize the box
***********************************************************/
void JournalBox::Initialize(CEGUI::Window* Root)
{
try
{
_myBox = CEGUI::WindowManager::getSingleton().loadWindowLayout( "questbook.layout",
"", "", &MyPropertyCallback);
Root->addChildWindow(_myBox);
CEGUI::FrameWindow * frw = static_cast<CEGUI::FrameWindow *> (
CEGUI::WindowManager::getSingleton().getWindow("JournalFrame"));
frw->subscribeEvent (
CEGUI::FrameWindow::EventCloseClicked,
CEGUI::Event::Subscriber (&JournalBox::HandleClose, this));
CEGUI::Tree * tree = static_cast<CEGUI::Tree *> (
CEGUI::WindowManager::getSingleton().getWindow("Root/JournalWin/tab/questtab/Tree"));
tree->subscribeEvent(CEGUI::Listbox::EventSelectionChanged,
CEGUI::Event::Subscriber (&JournalBox::HandleQuestTreeSelected, this));
CEGUI::Tree * tree2 = static_cast<CEGUI::Tree *> (
CEGUI::WindowManager::getSingleton().getWindow("Root/JournalWin/tab/questdonetab/Tree"));
tree2->subscribeEvent(CEGUI::Listbox::EventSelectionChanged,
CEGUI::Event::Subscriber (&JournalBox::HandleQuestDoneTreeSelected, this));
float PosX = ConfigurationManager::GetInstance()->GetValue("Gui.JournalBox.PosX", 0.65f);
float PosY = ConfigurationManager::GetInstance()->GetValue("Gui.JournalBox.PosY", 0.56f);
float SizeX = ConfigurationManager::GetInstance()->GetValue("Gui.JournalBox.SizeX", 0.35f);
float SizeY = ConfigurationManager::GetInstance()->GetValue("Gui.JournalBox.SizeY", 0.34f);
bool Visible = ConfigurationManager::GetInstance()->GetValue("Gui.JournalBox.Visible", false);
frw->setPosition(CEGUI::UVector2(CEGUI::UDim(PosX, 0), CEGUI::UDim(PosY, 0)));
frw->setWidth(CEGUI::UDim(SizeX, 0));
frw->setHeight(CEGUI::UDim(SizeY, 0));
if(Visible)
frw->show();
else
frw->hide();
// get quest topic tree which should be opened
std::string treeqopen = ConfigurationManager::GetInstance()->GetValue<std::string>("Gui.JournalBox.QuestTreeOpen", "");
std::string treedqopen = ConfigurationManager::GetInstance()->GetValue<std::string>("Gui.JournalBox.QuestDoneTreeOpen", "");
_selected_tree_quests = ConfigurationManager::GetInstance()->GetValue<std::string>("Gui.JournalBox.QuestTreeSelected", "");
_selected_tree_done_quests = ConfigurationManager::GetInstance()->GetValue<std::string>("Gui.JournalBox.QuestDoneTreeSelected", "");
StringHelper::Tokenize(treeqopen, _open_tree_quests, "##");
StringHelper::Tokenize(treedqopen, _open_tree_done_quests, "##");
static_cast<CEGUI::TabControl *> (
CEGUI::WindowManager::getSingleton().getWindow("Root/JournalWin/tab"))->setSelectedTab("Root/JournalWin/tab/questtab");
}
catch(CEGUI::Exception &ex)
{
LogHandler::getInstance()->LogToFile(std::string("Exception init InventoryBox: ") + ex.getMessage().c_str());
}
}