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


C++ TabControl::subscribeEvent方法代码示例

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


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

示例1: SubEventShopCityChild

void SubEventShopCityChild(Window* pageWnd)
{
	TabControl* tbc = WTabControl(pageWnd);
	//
	tbc->subscribeEvent(TabControl::EventSelectionChanged,CEGUI::SubscriberSlot(OnShopCityChildTabContentSelChanged));
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:6,代码来源:ShopCityChild.cpp

示例2: initialise

/*************************************************************************ech
Sample specific initialisation goes here.
*************************************************************************/
bool MenuNavigationSample::initialise(CEGUI::GUIContext* gui_context)
{
    using namespace CEGUI;

    d_usedFiles = CEGUI::String(__FILE__);

    SchemeManager::getSingleton().createFromFile("TaharezLook.scheme");
    gui_context->getCursor().setDefaultImage("TaharezLook/MouseArrow");

    WindowManager& win_mgr = WindowManager::getSingleton();
    d_root = win_mgr.loadLayoutFromFile("MenuNavigationSample.layout");

    FontManager::FontList loadedFonts = FontManager::getSingleton().createFromFile("DejaVuSans-12.font");
    Font* defaultFont = loadedFonts.empty() ? 0 : loadedFonts.front();
    gui_context->setDefaultFont(defaultFont);

    gui_context->setRootWindow(d_root);

    MatrixNavigationStrategy* d_matrixNavigationStrategy = new MatrixNavigationStrategy();
    d_matrixWindowNavigator = new WindowNavigator(createMatrixNavigationMappings(),
        d_matrixNavigationStrategy);
    gui_context->setWindowNavigator(d_matrixWindowNavigator);

    LinearNavigationStrategy* d_linearNavigatorStrategy = new LinearNavigationStrategy();
    d_linearWindowNavigator = new WindowNavigator(createLinearNavigationMappings(),
        d_linearNavigatorStrategy);

    TabControl* tabControl = static_cast<TabControl*>(d_root->getChild("FrameWindow/TabControl"));
    tabControl->subscribeEvent(TabControl::EventSelectionChanged,
        Event::Subscriber(&MenuNavigationSample::handleTabSelectionChanged, this));

    Window* page1Window = win_mgr.loadLayoutFromFile("MenuNavigationSampleTabPage1.layout");
    d_logWidget1 = page1Window->getChild("StaticText");
    d_logWidget1->setText("OK");

    // 4 rows
    d_matrixNavigationStrategy->d_windows.resize(4);
    for (int i = 1; i <= 16; ++i)
    {
        std::ostringstream os;
        os << "Button" << i;

        PushButton* button = static_cast<PushButton*>(page1Window->getChild(os.str()));
        button->subscribeEvent(PushButton::EventClicked,
            Event::Subscriber(&MenuNavigationSample::handleNumberButtonClicked, this));

        d_matrixNavigationStrategy->d_windows.at((i - 1) % 4).push_back(button);
    }

    tabControl->addTab(page1Window);

    Window* page2Window = win_mgr.loadLayoutFromFile("MenuNavigationSampleTabPage2.layout");
    d_logWidget2 = page2Window->getChild("StaticText");
    d_logWidget2->setText("OK");

    Window* selectButton = page2Window->getChild("SelectButton");
    selectButton->subscribeEvent(PushButton::EventClicked,
        Event::Subscriber(&MenuNavigationSample::handleSelectButtonClicked, this));

    tabControl->addTab(page2Window);

    d_classesList = static_cast<ListWidget*>(page2Window->getChild("ClassesList"));
    d_classesList->setMultiSelectEnabled(true);
    initialiseClasses(d_classesList);

    d_linearNavigatorStrategy->d_windows.push_back(d_classesList);
    d_linearNavigatorStrategy->d_windows.push_back(selectButton);

    return true;
}
开发者ID:arkana-fts,项目名称:cegui,代码行数:73,代码来源:MenuNavigation.cpp


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