本文整理汇总了C++中cegui::Scrollbar::subscribeEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ Scrollbar::subscribeEvent方法的具体用法?C++ Scrollbar::subscribeEvent怎么用?C++ Scrollbar::subscribeEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::Scrollbar
的用法示例。
在下文中一共展示了Scrollbar::subscribeEvent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setHandlers
void GUIManager::setHandlers ()
{
CEGUI::WindowManager & wm = CEGUI::WindowManager::getSingleton();
CEGUI::FrameWindow *dsFrame = static_cast<CEGUI::FrameWindow *>(
wm.getWindow("Sheet/DatasetFrame"));
dsFrame->hide();
// Handle behavior of options-button
CEGUI::PushButton *button = static_cast<CEGUI::PushButton *>(
wm.getWindow("Sheet/Options"));
button->subscribeEvent(CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber(&GUIManager::handleOptionsVisibility, this));
button = dsFrame->getCloseButton();
button->subscribeEvent(CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber(&GUIManager::handleOptionsVisibility, this));
// Connect activate buttons on tabs
auto connectFrames = [=](CEGUI::Window *tab) {
CEGUI::PushButton *button =
static_cast<CEGUI::PushButton *>(tab->getChild(3));
button->subscribeEvent(CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber(&GUIManager::handleDSActivation, this));
button = static_cast<CEGUI::PushButton *>(tab->getChild(4));
button->subscribeEvent(CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber(&GUIManager::handleDSDeactivation, this));
CEGUI::Scrollbar *sb = static_cast<CEGUI::Scrollbar *>(tab->getChild(2));
sb->subscribeEvent(CEGUI::Scrollbar::EventScrollPositionChanged,
CEGUI::Event::Subscriber(&GUIManager::handleScrollbarChanged, this));
CEGUI::Listbox *lb = static_cast<CEGUI::Listbox *>(tab->getChild(0));
lb->subscribeEvent(CEGUI::Listbox::EventSelectionChanged,
CEGUI::Event::Subscriber(&GUIManager::handleDSSelection, this));
};
CEGUI::Window *tab = wm.getWindow("Sheet/DatasetFrame/TabControl/HTab");
connectFrames(tab);
tab = wm.getWindow("Sheet/DatasetFrame/TabControl/PTab");
connectFrames(tab);
tab = wm.getWindow("Sheet/DatasetFrame/TabControl/CTab");
connectFrames(tab);
CEGUI::Scrollbar *sb = static_cast<CEGUI::Scrollbar *>(
wm.getWindow("Sheet/DimensionSlider"));
sb->subscribeEvent(CEGUI::Scrollbar::EventScrollPositionChanged,
CEGUI::Event::Subscriber(&GUIManager::handleBigScrollbarChanged, this));
}
示例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)
{
}
}