当前位置: 首页>>代码示例>>C++>>正文


C++ Scrollbar::setDocumentSize方法代码示例

本文整理汇总了C++中cegui::Scrollbar::setDocumentSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Scrollbar::setDocumentSize方法的具体用法?C++ Scrollbar::setDocumentSize怎么用?C++ Scrollbar::setDocumentSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cegui::Scrollbar的用法示例。


在下文中一共展示了Scrollbar::setDocumentSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: resetDeepthSliders

void MainGameScreen::resetDeepthSliders()
{
    CEGUI::Scrollbar* DepthSliderTop = static_cast<CEGUI::Scrollbar*> (GUI->getWindowManager()->getWindow("MainGameScreen/DepthScrollerTop"));
    if (DepthSliderTop != NULL)
    {
        int32_t ZMax = GAME->getMap()->getHighest() - GAME->getMap()->getLowest();
        DepthSliderTop->setDocumentSize(ZMax);
    }

    CEGUI::Scrollbar* DepthSliderBottom = static_cast<CEGUI::Scrollbar*> (GUI->getWindowManager()->getWindow("MainGameScreen/DepthScrollerBottom"));
    if (DepthSliderBottom != NULL)
    {
        int32_t ZMax = GAME->getMap()->getHighest() - GAME->getMap()->getLowest();
        float OldPosition = DepthSliderBottom->getScrollPosition();
        if (OldPosition > ZMax)
        {
            DepthSliderBottom->setDocumentSize(ZMax);
            DepthSliderBottom->setScrollPosition(ZMax);
        } else {
            DepthSliderBottom->setScrollPosition(ZMax);
        }
    }
}
开发者ID:Ackak,项目名称:Khazad,代码行数:23,代码来源:MainGameScreen.cpp

示例2: Init

bool MainGameScreen::Init()
{
    RootWindow = CEGUI::WindowManager::getSingleton().loadWindowLayout("MainGameScreen.layout");

    try
    {
        CEGUI::Window* GameOptionsButton = GUI->getWindowManager()->getWindow("MainGameScreen/TopBar/GameOptionsButton");
        if (GameOptionsButton != NULL)
        {
            GameOptionsButton->subscribeEvent(CEGUI::PushButton::EventMouseClick, CEGUI::Event::Subscriber(&MainGameScreen::GameOptionsOpen, this));
        }

        CEGUI::Window* GameOptionsWindow = GUI->getWindowManager()->getWindow("MainGameScreen/GameOptionsWindow");
        if (GameOptionsWindow != NULL)
        {
            GameOptionsWindow->subscribeEvent(CEGUI::FrameWindow::EventCloseClicked, CEGUI::Event::Subscriber(&MainGameScreen::GameOptionsClose, this));
        }

        CEGUI::Window* PathTesterWindow = GUI->getWindowManager()->getWindow("MainGameScreen/PathProfileWindow");
        if (PathTesterWindow != NULL)
        {
            PathTesterWindow->subscribeEvent(CEGUI::FrameWindow::EventCloseClicked, CEGUI::Event::Subscriber(&MainGameScreen::PathProfilerClose, this));
        }

        CEGUI::Window* ZoneButton = GUI->getWindowManager()->getWindow("MainGameScreen/TopBar/ZoneButton");
        if (ZoneButton != NULL)
        {
            ZoneButton->subscribeEvent(CEGUI::FrameWindow::EventMouseClick, CEGUI::Event::Subscriber(&MainGameScreen::ZoneButtonClick, this));
        }

        CEGUI::Window* SaveButton = GUI->getWindowManager()->getWindow("MainGameScreen/GameOptionsWindow/SaveGameButton");
        if (SaveButton != NULL)
        {
            SaveButton->subscribeEvent(CEGUI::PushButton::EventMouseClick, CEGUI::Event::Subscriber(&MainGameScreen::SaveGame, this));
        }

        CEGUI::Window* PathProfileButton = GUI->getWindowManager()->getWindow("MainGameScreen/GameOptionsWindow/PathProfilerButton");
        if (PathProfileButton != NULL)
        {
            PathProfileButton->subscribeEvent(CEGUI::PushButton::EventMouseClick, CEGUI::Event::Subscriber(&MainGameScreen::PathProfilerOpen, this));
        }

        CEGUI::Window* ExitButton = GUI->getWindowManager()->getWindow("MainGameScreen/GameOptionsWindow/ExitButton");
        if (ExitButton != NULL)
        {
            ExitButton->subscribeEvent(CEGUI::PushButton::EventMouseClick, CEGUI::Event::Subscriber(&MainGameScreen::ExitGame, this));
        }

        CEGUI::Window* TestSuiteButton = GUI->getWindowManager()->getWindow("MainGameScreen/PathProfileWindow/RunSuiteButton");
        if (TestSuiteButton != NULL)
        {
            TestSuiteButton->subscribeEvent(CEGUI::PushButton::EventMouseClick, CEGUI::Event::Subscriber(&MainGameScreen::RunSuitePressed, this));
        }

        CEGUI::Scrollbar* DepthSliderTop = static_cast<CEGUI::Scrollbar*> (GUI->getWindowManager()->getWindow("MainGameScreen/DepthScrollerTop"));
        if (DepthSliderTop != NULL)
        {
            DepthSliderTop->setDocumentSize(1000);
            DepthSliderTop->setScrollPosition(0);
            DepthSliderTop->subscribeEvent(CEGUI::Scrollbar::EventScrollPositionChanged, CEGUI::Event::Subscriber(&MainGameScreen::DepthSliderMoved, this));
        }

        CEGUI::Scrollbar* DepthSliderBottom = static_cast<CEGUI::Scrollbar*> (GUI->getWindowManager()->getWindow("MainGameScreen/DepthScrollerBottom"));
        if (DepthSliderBottom != NULL)
        {
            DepthSliderBottom->setDocumentSize(1000);
            DepthSliderBottom->setScrollPosition(1000);
            DepthSliderBottom->subscribeEvent(CEGUI::Scrollbar::EventScrollPositionChanged, CEGUI::Event::Subscriber(&MainGameScreen::DepthSliderMoved, this));
        }

        CEGUI::Window* PauseButton = GUI->getWindowManager()->getWindow("MainGameScreen/TopBar/PauseButton");
        if (PauseButton != NULL)
        {
            PauseButton->subscribeEvent(CEGUI::PushButton::EventMouseClick, CEGUI::Event::Subscriber(&MainGameScreen::MainGameScreen::PausePressed, this));
        }

        CEGUI::Window* PlayButton = GUI->getWindowManager()->getWindow("MainGameScreen/TopBar/PlayButton");
        if (PauseButton != NULL)
        {
            PlayButton->subscribeEvent(CEGUI::PushButton::EventMouseClick, CEGUI::Event::Subscriber(&MainGameScreen::MainGameScreen::PlayPressed, this));
        }

        CEGUI::Window* DigButton = GUI->getWindowManager()->getWindow("MainGameScreen/BottomWindow/DigButton");
        if (DigButton != NULL)
        {
            DigButton->subscribeEvent(CEGUI::PushButton::EventMouseClick, CEGUI::Event::Subscriber(&MainGameScreen::MainGameScreen::DigPressed, this));
        }

    }

    catch(CEGUI::Exception &e)
    {
    }
}
开发者ID:Ackak,项目名称:Khazad,代码行数:94,代码来源:MainGameScreen.cpp


注:本文中的cegui::Scrollbar::setDocumentSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。