本文整理汇总了C++中TabButton::getTargetWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ TabButton::getTargetWindow方法的具体用法?C++ TabButton::getTargetWindow怎么用?C++ TabButton::getTargetWindow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TabButton
的用法示例。
在下文中一共展示了TabButton::getTargetWindow方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: selectTab_impl
/*************************************************************************
Select tab implementation
*************************************************************************/
void TabControl::selectTab_impl(Window* wnd)
{
bool modified = false;
bool foundSelected = false;
// Iterate in order of tab index
TabButtonIndexMap::iterator i, iend;
iend = d_tabButtonIndexMap.end();
for (i = d_tabButtonIndexMap.begin(); i != iend; ++i)
{
// get corresponding tab button and content window
TabButton* tb = i->second;
Window* child = tb->getTargetWindow();
// Should we be selecting?
bool selectThis = (child == wnd);
// Are we modifying this tab?
modified = modified || (tb->isSelected() != selectThis);
foundSelected = foundSelected || selectThis;
// Select tab & set visible if this is the window, not otherwise
tb->setSelected(selectThis);
tb->setRightOfSelected(foundSelected);
child->setVisible(selectThis);
}
// Trigger event?
if (modified)
{
WindowEventArgs args(this);
onSelectionChanged(args);
}
}
示例2: selectTab_impl
/*************************************************************************
Select tab implementation
*************************************************************************/
void TabControl::selectTab_impl(Window* wnd)
{
makeTabVisible_impl(wnd);
bool modified = false;
// Iterate in order of tab index
for (size_t i = 0; i < d_tabButtonVector.size(); ++i)
{
// get corresponding tab button and content window
TabButton* tb = d_tabButtonVector [i];
Window* child = tb->getTargetWindow();
// Should we be selecting?
bool selectThis = (child == wnd);
// Are we modifying this tab?
modified = modified || (tb->isSelected() != selectThis);
// Select tab & set visible if this is the window, not otherwise
tb->setSelected(selectThis);
child->setVisible(selectThis);
}
// Trigger event?
if (modified)
{
WindowEventArgs args(this);
onSelectionChanged(args);
}
}
示例3: handleTabButtonClicked
/*************************************************************************
Tab button clicked
*************************************************************************/
bool TabControl::handleTabButtonClicked(const EventArgs& args)
{
const WindowEventArgs& wargs = static_cast<const WindowEventArgs&>(args);
TabButton* tabButton = static_cast<TabButton*>(wargs.window);
setSelectedTab(tabButton->getTargetWindow()->getName());
return true;
}
示例4: makeTabVisible_impl
/*************************************************************************
Make tab visible implementation
*************************************************************************/
void TabControl::makeTabVisible_impl(Window* wnd)
{
TabButton *tb = 0;
for (size_t i = 0; i < d_tabButtonVector.size (); ++i)
{
// get corresponding tab button and content window
tb = d_tabButtonVector [i];
Window* child = tb->getTargetWindow();
if (child == wnd)
break;
tb = 0;
}
if (!tb)
return;
float ww = getPixelSize ().d_width;
float x = tb->getXPosition().asAbsolute (ww);
float w = tb->getPixelSize ().d_width;
float lx = 0, rx = ww;
Window *scrollLeftBtn = 0, *scrollRightBtn = 0;
String name = getName() + ButtonScrollLeftSuffix;
if (WindowManager::getSingleton().isWindowPresent (name))
{
scrollLeftBtn = WindowManager::getSingleton().getWindow (name);
lx = scrollLeftBtn->getArea ().d_max.d_x.asAbsolute (ww);
scrollLeftBtn->setWantsMultiClickEvents (false);
}
name = getName() + ButtonScrollRightSuffix;
if (WindowManager::getSingleton().isWindowPresent (name))
{
scrollRightBtn = WindowManager::getSingleton().getWindow (name);
rx = scrollRightBtn->getXPosition ().asAbsolute (ww);
scrollRightBtn->setWantsMultiClickEvents (false);
}
if (x < lx)
d_firstTabOffset += lx - x;
else
{
if (x + w <= rx)
return; // nothing to do
d_firstTabOffset += rx - (x + w);
}
performChildWindowLayout ();
}
示例5: getButtonForTabContents
/*************************************************************************
Return the tab button for the given tab content window
*************************************************************************/
TabButton* TabControl::getButtonForTabContents(Window* wnd) const
{
TabButtonIndexMap::const_iterator i, iend;
iend = d_tabButtonIndexMap.end();
for (i = d_tabButtonIndexMap.begin(); i != iend; ++i)
{
// get corresponding tab button and content window
TabButton* tb = i->second;
Window* child = tb->getTargetWindow();
if (child == wnd)
{
return tb;
}
}
throw UnknownObjectException((utf8*)"TabControl::getButtonForTabContents - The Window object is not a tab contents.");
}