本文整理汇总了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));
}
示例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;
}