本文整理汇总了C++中TabControl::getTabHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ TabControl::getTabHeight方法的具体用法?C++ TabControl::getTabHeight怎么用?C++ TabControl::getTabHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TabControl
的用法示例。
在下文中一共展示了TabControl::getTabHeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialise
// method to initialse the samples windows and events.
bool initialise(CEGUI::GUIContext* guiContext)
{
d_guiContext = guiContext;
d_usedFiles = CEGUI::String(__FILE__);
// load font and setup default if not loaded via scheme
Font& defaultFont = FontManager::getSingleton().createFromFile("DejaVuSans-12.font");
// Set default font for the gui context
guiContext->setDefaultFont(&defaultFont);
// we will use of the WindowManager.
WindowManager& winMgr = WindowManager::getSingleton();
// load scheme and set up defaults
SchemeManager::getSingleton().createFromFile(SKIN ".scheme");
d_guiContext->getMouseCursor().setDefaultImage(SKIN "/MouseArrow");
// load an image to use as a background
if (!ImageManager::getSingleton().isDefined("SpaceBackgroundImage"))
ImageManager::getSingleton().addFromImageFile("SpaceBackgroundImage", "SpaceBackground.jpg");
// here we will use a StaticImage as the root, then we can use it to place a background image
Window* background = winMgr.createWindow(SKIN "/StaticImage");
// set area rectangle
background->setArea(URect(cegui_reldim(0), cegui_reldim(0),
cegui_reldim(1), cegui_reldim(1)));
// disable frame and standard background
background->setProperty("FrameEnabled", "false");
background->setProperty("BackgroundEnabled", "false");
// set the background image
background->setProperty("Image", "SpaceBackgroundImage");
// install this as the root GUI sheet
d_guiContext->setRootWindow(background);
// set tooltip styles (by default there is none)
d_guiContext->setDefaultTooltipType(SKIN "/Tooltip");
// load some demo windows and attach to the background 'root'
background->addChild(winMgr.loadLayoutFromFile("TabControlDemo.layout"));
TabControl* tc = static_cast<TabControl*>(background->getChild("Frame/TabControl"));
// Add some pages to tab control
tc->addTab(winMgr.loadLayoutFromFile("TabPage1.layout"));
tc->addTab(winMgr.loadLayoutFromFile("TabPage2.layout"));
WindowManager::getSingleton().DEBUG_dumpWindowNames("asd");
static_cast<PushButton*>(
background->getChild("Frame/TabControl/Page1/AddTab"))->subscribeEvent(
PushButton::EventClicked,
Event::Subscriber(&TabControlDemo::handleAddTab, this));
// Click to visit this tab
static_cast<PushButton*>(
background->getChild("Frame/TabControl/Page1/Go"))->subscribeEvent(
PushButton::EventClicked,
Event::Subscriber(&TabControlDemo::handleGoto, this));
// Click to make this tab button visible (when scrolling is required)
static_cast<PushButton*>(
background->getChild("Frame/TabControl/Page1/Show"))->subscribeEvent(
PushButton::EventClicked,
Event::Subscriber(&TabControlDemo::handleShow, this));
static_cast<PushButton*>(
background->getChild("Frame/TabControl/Page1/Del"))->subscribeEvent(
PushButton::EventClicked,
Event::Subscriber(&TabControlDemo::handleDel, this));
RadioButton* rb = static_cast<RadioButton*>(
background->getChild("Frame/TabControl/Page1/TabPaneTop"));
rb->setSelected(tc->getTabPanePosition() == TabControl::Top);
rb->subscribeEvent(
RadioButton::EventSelectStateChanged,
Event::Subscriber(&TabControlDemo::handleTabPanePos, this));
rb = static_cast<RadioButton*>(
background->getChild("Frame/TabControl/Page1/TabPaneBottom"));
rb->setSelected(tc->getTabPanePosition() == TabControl::Bottom);
rb->subscribeEvent(
RadioButton::EventSelectStateChanged,
Event::Subscriber(&TabControlDemo::handleTabPanePos, this));
Scrollbar* sb = static_cast<Scrollbar*>(
background->getChild("Frame/TabControl/Page1/TabHeight"));
sb->setScrollPosition(tc->getTabHeight().d_offset);
sb->subscribeEvent(
Scrollbar::EventScrollPositionChanged,
Event::Subscriber(&TabControlDemo::handleTabHeight, this));
sb = static_cast<Scrollbar*>(
background->getChild("Frame/TabControl/Page1/TabPadding"));
sb->setScrollPosition(tc->getTabTextPadding().d_offset);
sb->subscribeEvent(
Scrollbar::EventScrollPositionChanged,
Event::Subscriber(&TabControlDemo::handleTabPadding, this));
refreshPageList();
//.........这里部分代码省略.........