本文整理汇总了C++中cegui::Window::setVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ Window::setVisible方法的具体用法?C++ Window::setVisible怎么用?C++ Window::setVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::Window
的用法示例。
在下文中一共展示了Window::setVisible方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitPetStrenthenWnd
void InitPetStrenthenWnd(CEGUI::Window* mainPage, long type)
{
if (!mainPage || (type<PET_QUALITYUP_ID || type>PET_FFUP_ID))
return;
char tempText[256];
for (int i = PET_QUALITYUP_ID; i <= PET_FFUP_ID; i+=PET_QUALITYUP_ID)
{
sprintf(tempText, "PetStrengthen/%d", i);
CEGUI::Window* strenthenWnd = mainPage->getChildRecursive(tempText);
if (strenthenWnd)
{
strenthenWnd->setVisible(false);
}
}
sprintf(tempText, "PetStrengthen/%d", type);
CEGUI::Window* strenthenWnd = mainPage->getChildRecursive(tempText);
if (strenthenWnd)
{
strenthenWnd->setVisible(true);
}
CEGUI::Window* explainTextWnd = mainPage->getChildRecursive("PetStrengthen/ExplainText");
if (explainTextWnd)
{
explainTextWnd->setText(GetInst(PetSetup).GetExplainTextByID(type).c_str());
}
}
示例2: onListSelectionChanged
bool onListSelectionChanged(const CEGUI::EventArgs &args) {
int id = -1;
if (m_pCombobox->getSelectedItem()) {
id = m_pCombobox->getItemIndex(m_pCombobox->getSelectedItem());
m_Exit.setExitType(static_cast<EExitTypes>(id));
}
m_pContentId->setVisible(id == EXIT_ENEMY_DEATH);
m_pContentRegion->setVisible(id == EXIT_REGION);
return true;
}
示例3: CEditBoxExit
CEditBoxExit(int id,
CEGUI::Window *pParent,
float fButtonSize,
const CEGUI::String &sTitle,
CExit &exit)
: CEditBoxBase(id, pParent, fButtonSize, sTitle),
m_Exit(exit),
m_BackupExit(exit) {
using namespace CEGUI;
Combobox *pComboBox = dynamic_cast<Combobox*>(m_pWindow->createChild("OgreTray/Combobox", "ExitSelect"));
m_pCombobox = pComboBox;
pComboBox->setPosition(UVector2(UDim(0, 0), UDim(0, 0)));
pComboBox->setSize(USize(UDim(1, 0), UDim(0, 3 * fButtonSize)));
pComboBox->addItem(new ListboxTextItem("Region"));
pComboBox->addItem(new ListboxTextItem("Enemy death"));
pComboBox->setAutoSizeListHeightToContent(true);
pComboBox->setReadOnly(true);
pComboBox->subscribeEvent(Combobox::EventListSelectionAccepted,
Event::Subscriber(&CEditBoxExit::onListSelectionChanged, this));
// id
m_pContentId = m_pWindow->createChild("DefaultWindow", "id");
m_pContentId->setPosition(UVector2(UDim(0, 0), UDim(0, fButtonSize)));
m_pContentId->setSize(USize(UDim(1, 0), UDim(0, 2 * fButtonSize)));
Window *pLabel = m_pContentId->createChild("OgreTray/Label", "Exitidlabel");
pLabel->setPosition(UVector2(UDim(0, 0), UDim(0, 0)));
pLabel->setSize(USize(UDim(0, fButtonSize), UDim(0, fButtonSize)));
pLabel->setText("id");
Window *pEditBox = m_pContentId->createChild("OgreTray/Editbox", "Exitid");
pEditBox->setPosition(UVector2(UDim(0, fButtonSize), UDim(0, 0)));
pEditBox->setSize(USize(UDim(1, -fButtonSize), UDim(0, fButtonSize)));
pEditBox->setText(m_Exit.getID());
m_pContentId->setVisible(m_Exit.getExitType() == EXIT_ENEMY_DEATH);
// region
m_pContentRegion = m_pWindow->createChild("DefaultWindow", "region");
m_pContentRegion->setPosition(UVector2(UDim(0, 0), UDim(0, fButtonSize)));
m_pContentRegion->setSize(USize(UDim(1, 0), UDim(0, 2 * fButtonSize)));
createVector(m_pContentRegion, "pos", m_Exit.getBoundingBox().getPosition().x, m_Exit.getBoundingBox().getPosition().y, fButtonSize, 0);
createVector(m_pContentRegion, "size", m_Exit.getBoundingBox().getSize().x, m_Exit.getBoundingBox().getSize().y, fButtonSize, fButtonSize);
m_pContentRegion->setVisible(m_Exit.getExitType() == EXIT_REGION);
// default selected exit type
m_pCombobox->setItemSelectState(m_Exit.getExitType(), true);
}
示例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: 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;
}
示例6: SetButtons
void MessageBox::SetButtons(const MessageBoxButtons& buttons)
{
float32 sumWidth = 0;
for (MessageBoxButtons::const_iterator it = buttons.begin(); it != buttons.end(); ++it)
{
CEGUI::Window* button = GetButton(*it);
OC_DASSERT(button != 0);
float32 width = button->getWidth().d_offset;
sumWidth += width;
}
float32 totalWidth = sumWidth + BUTTON_MARGIN * (buttons.size() - 1);
float32 left = 0;
for (MessageBoxButtons::const_iterator it = buttons.begin(); it != buttons.end(); ++it)
{
CEGUI::Window* button = GetButton(*it);
OC_DASSERT(button != 0);
float32 width = button->getWidth().d_offset;
button->setPosition(CEGUI::UVector2(CEGUI::UDim(0.5f, -0.5f * totalWidth + left), button->getPosition().d_y));
button->setWidth(CEGUI::UDim(0, width));
button->setVisible(true);
button->setID((CEGUI::uint)*it);
button->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUISystem::MessageBox::OnButtonClicked, this));
left += width + BUTTON_MARGIN;
}
mMinWidth = totalWidth + 2.0f * BUTTON_MARGIN;
}
示例7:
// GUIText
_MEMBER_FUNCTION_IMPL(GUIText, constructor)
{
// Get our GUI
CGUI * pGUI = g_pClient->GetGUI();
CEGUI::Window * pWindow = pGUI->CreateGUIStaticText();
if(!pWindow || SQ_FAILED(sq_setinstance(pVM, pWindow)))
{
CLogFile::Printf("Can't create GUIText.");
sq_pushbool(pVM, false);
return 1;
}
//_SET_RELEASE_HOOK(GUIElement);
CClientScriptManager * pClientScriptManager = g_pClient->GetClientScriptManager();
pClientScriptManager->GetGUIManager()->Add(pWindow, pClientScriptManager->GetScriptingManager()->Get(pVM));
pWindow->setVisible(true);
pWindow->setProperty("FrameEnabled", "false");
pWindow->setProperty("BackgroundEnabled", "false");
pWindow->setFont(pGUI->GetFont("tahoma-bold"));
pWindow->setProperty("TextColours", "tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF");
SubscribeGuiEvents(pWindow);
sq_pushbool(pVM, true);
return 1;
}
示例8: OnClose
bool PetStrenthen::OnClose(const CEGUI::EventArgs& e)
{
CEGUI::Window* wnd = static_cast<const CEGUI::WindowEventArgs&>(e).window;
if( !wnd ) return false;
wnd->setVisible(false);
return true;
}
示例9: GameOptionsOpen
bool MainGameScreen::GameOptionsOpen(const CEGUI::EventArgs& pEventArgs)
{
GAME->setPause(true);
CEGUI::Window* GameOptionsWindow = GUI->getWindowManager()->getWindow("MainGameScreen/GameOptionsWindow");
GameOptionsWindow->setVisible(true);
GameOptionsWindow->moveToFront();
return true;
}
示例10: PathProfilerOpen
bool MainGameScreen::PathProfilerOpen(const CEGUI::EventArgs& pEventArgs)
{
GAME->setPause(true);
CEGUI::Window* PathProfileWindow = GUI->getWindowManager()->getWindow("MainGameScreen/PathProfileWindow");
PathProfileWindow->setVisible(true);
PathProfileWindow->moveToFront();
return true;
}
示例11: Close
bool GoodsViewerPage::Close()
{
CEGUI::Window *pPage = GetPageWindow();
if(pPage)
{
pPage->setVisible(false);
pPage->setAlwaysOnTop(false);
}
else
return false;
return true;
}
示例12: playerDestroyed
bool GameState::playerDestroyed(Viper *viper)
{
if(viper == player)
{
CEGUI::Window *win = CEGUI::WindowManager::getSingletonPtr()->getWindow("GameState/GameOver");
win->setVisible(true);
isPlayerAlive = false;
CEGUI::WindowManager &wmgr = CEGUI::WindowManager::getSingleton();
CEGUI::ProgressBar * bar = (CEGUI::ProgressBar *)wmgr.getWindow("GameState/Life");
bar->setProgress(0);
return false;
}
return true;
}
示例13: Open
bool RankPage::Open()
{
CEGUI::Window* wnd = GetPageWindow();
if(wnd)
{
wnd->setVisible(true);
wnd->setAlwaysOnTop(true);
}
else
{
throw CEGUI::InvalidRequestException("RankPage Open failed!");
return false;
}
return true;
}
示例14: Close
bool RankPage::Close()
{
CEGUI::Window* pPage = GetPageWindow();
if(!pPage)
{
throw CEGUI::InvalidRequestException("RankPage Close failed!");
return false;
}
else
{
pPage->setVisible(false);
pPage->setAlwaysOnTop(false);
}
return true;
}
示例15: Open
bool GoodsViewerPage::Open()
{
CEGUI::Window *pPage = GetPageWindow();
if (pPage)
{
pPage->setVisible(true);
pPage->activate();
pPage->setAlwaysOnTop(true);
}
else
{
CEGUI::InvalidRequestException("GoodsViewerPage Open Failed!");
return false;
}
return true;
}