本文整理汇总了C++中TabButton类的典型用法代码示例。如果您正苦于以下问题:C++ TabButton类的具体用法?C++ TabButton怎么用?C++ TabButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TabButton类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: OnTabPressed
void TabControl::OnTabPressed( Controls::Base* control )
{
TabButton* pButton = gwen_cast<TabButton>(control);
if ( !pButton ) return;
Base* pPage = pButton->GetPage();
if ( !pPage ) return;
if ( m_pCurrentButton == pButton)
return;
if ( m_pCurrentButton )
{
Base* pPage = m_pCurrentButton->GetPage();
if ( pPage )
{
pPage->SetHidden( true );
}
m_pCurrentButton->Redraw();
m_pCurrentButton = NULL;
}
m_pCurrentButton = pButton;
pPage->SetHidden( false );
m_TabStrip->Invalidate();
Invalidate();
}
开发者ID:gered,项目名称:MyGameFramework,代码行数:30,代码来源:gwen_tabcontrol.cpp
示例2: 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);
}
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:32,代码来源:CEGUITabControl.cpp
示例3: OnTabPressed
void TabControl::OnTabPressed( Controls::Base* control )
{
if (!control)
return;
TabButton* pButton = control->DynamicCastTabButton();
if ( !pButton ) return;
Base* pPage = pButton->GetPage();
if ( !pPage ) return;
if ( m_pCurrentButton == pButton)
return;
if ( m_pCurrentButton )
{
Base* pPage = m_pCurrentButton->GetPage();
if ( pPage )
{
pPage->SetHidden( true );
}
m_pCurrentButton = NULL;
}
m_pCurrentButton = pButton;
pPage->SetHidden( false );
m_TabStrip->Invalidate();
Invalidate();
}
开发者ID:20-sim,项目名称:bullet3,代码行数:31,代码来源:TabControl.cpp
示例4: makeTabVisible_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);
}
}
开发者ID:akadjoker,项目名称:gmogre3d,代码行数:29,代码来源:CEGUITabControl.cpp
示例5: CanvasPosToLocal
bool TabStrip::DragAndDrop_HandleDrop(Gwen::DragAndDrop::Package* /*pPackage*/, int x, int y)
{
Gwen::Point LocalPos = CanvasPosToLocal(Gwen::Point(x, y));
Base* el = DragAndDrop::SourceControl;
TabButton* pButton = el ? el->DynamicCastTabButton() : 0;
TabControl* pTabControl = GetParent() ? GetParent()->DynamicCastTabControl() : 0;
if (pTabControl && pButton)
{
if (pButton->GetTabControl() != pTabControl)
{
// We've moved tab controls!
pTabControl->AddPage(pButton);
}
}
Base* DroppedOn = GetControlAt(LocalPos.x, LocalPos.y);
if (DroppedOn)
{
Gwen::Point DropPos = DroppedOn->CanvasPosToLocal(Gwen::Point(x, y));
DragAndDrop::SourceControl->BringNextToControl(DroppedOn, DropPos.x > DroppedOn->Width() / 2);
}
else
{
DragAndDrop::SourceControl->BringToFront();
}
return true;
}
开发者ID:Hongtae,项目名称:bullet3,代码行数:29,代码来源:TabStrip.cpp
示例6: 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;
}
开发者ID:akadjoker,项目名称:gmogre3d,代码行数:11,代码来源:CEGUITabControl.cpp
示例7: TabButton
TabButton* Toolbar::addButton(const QPixmap& _icon)
{
TabButton* button = new TabButton(this);
button->setImage(_icon);
addButton(button);
return button;
}
开发者ID:mailru,项目名称:icqdesktop,代码行数:10,代码来源:toolbar.cpp
示例8: removeButtonForTabContent
/*************************************************************************
Remove tab button
*************************************************************************/
void TabControl::removeButtonForTabContent(Window* wnd)
{
// get
TabButton* tb = static_cast<TabButton*>(
d_tabButtonPane->getChild(makeButtonName(wnd)));
// remove
d_tabButtonIndexMap.erase(tb->getTabIndex());
d_tabButtonPane->removeChildWindow(tb);
// destroy
WindowManager::getSingleton().destroyWindow(tb);
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:14,代码来源:CEGUITabControl.cpp
示例9: render
void FalagardTabButton::render()
{
TabButton* w = static_cast<TabButton*>(d_window);
// get WidgetLookFeel for the assigned look.
const WidgetLookFeel& wlf = getLookNFeel();
TabControl* tc = w->getParent() ? dynamic_cast<TabControl*>(w->getParent()->getParent()) : 0;
String prefix((tc && tc->getTabPanePosition() == TabControl::Bottom) ? "Bottom" : "Top");
String state;
if (w->isEffectiveDisabled())
state = "Disabled";
else if (w->isSelected())
state = "Selected";
else if (w->isPushed())
state = "Pushed";
else if (w->isHovering())
state = "Hover";
else if (w->isFocused())
state = "Focused";
else
state = "Normal";
if (!wlf.isStateImageryPresent(prefix + state))
{
state = "Normal";
if (!wlf.isStateImageryPresent(prefix + state))
prefix = "";
}
wlf.getStateImagery(prefix + state).render(*w);
}
开发者ID:OpenTechEngine-Libraries,项目名称:CEGUI,代码行数:32,代码来源:TabButton.cpp
示例10: pLargestTab
void TabStrip::Layout( Skin::Base* skin )
{
Gwen::Point pLargestTab( 5, 5 );
int iNum = 0;
for ( Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter )
{
TabButton* pButton = gwen_cast<TabButton>(*iter);
if ( !pButton ) continue;
pButton->SizeToContents();
Margin m;
int iNotFirst = iNum > 0 ? -1 : 0;
if ( m_iDock == Pos::Top )
{
m.left = iNotFirst;
pButton->Dock( Pos::Left );
}
if ( m_iDock == Pos::Left )
{
m.top = iNotFirst;
pButton->Dock( Pos::Top );
}
if ( m_iDock == Pos::Right )
{
m.top = iNotFirst;
pButton->Dock( Pos::Top );
}
if ( m_iDock == Pos::Bottom )
{
m.left = iNotFirst;
pButton->Dock( Pos::Left );
}
pLargestTab.x = Utility::Max( pLargestTab.x, pButton->Width() );
pLargestTab.y = Utility::Max( pLargestTab.y, pButton->Height() );
pButton->SetMargin( m );
iNum++;
}
if ( m_iDock == Pos::Top || m_iDock == Pos::Bottom )
SetSize( Width(), pLargestTab.y );
if ( m_iDock == Pos::Left || m_iDock == Pos::Right )
SetSize( pLargestTab.x, Height() );
BaseClass::Layout( skin );
}
开发者ID:gered,项目名称:MyGameFramework,代码行数:54,代码来源:gwen_tabstrip.cpp
示例11: TabButton
bool TabBar::AddButton(const int id,
const QString & title,
const QIcon & icon)
{
TabButton * button = new TabButton(this, id);
button->setText(title);
button->setIcon(icon);
layout_.addWidget(button);
buttons_.push_back(button);
connect(button, SIGNAL(clicked(const int, bool)),
this, SLOT(OnClicked(const int, bool)));
return true;
}
开发者ID:manhere,项目名称:booxsdk,代码行数:15,代码来源:tab_bar.cpp
示例12: 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.");
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:19,代码来源:CEGUITabControl.cpp
示例13: getSelectedTabIndex
/*************************************************************************
Return whether the tab content window is currently selected.
*************************************************************************/
uint TabControl::getSelectedTabIndex() const
{
uint index;
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;
if (tb->isSelected())
{
index = i->first;
break;
}
}
return index;
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:20,代码来源:CEGUITabControl.cpp
示例14: Base
TabButton* TabControl::AddPage( TextObject strText, Controls::Base* pPage )
{
if ( !pPage )
{
pPage = new Base( this );
}
else
{
pPage->SetParent( this );
}
TabButton* pButton = new TabButton( m_TabStrip );
pButton->SetText( strText );
pButton->SetPage( pPage );
pButton->SetTabable( false );
AddPage( pButton );
return pButton;
}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:18,代码来源:TabControl.cpp
示例15: removeTab
TabButton * TabBar::addTab( QWidget * _w, const QString & _text, int _id,
bool _add_stretch, bool _text_is_tooltip )
{
// already tab with id?
if( m_tabs.contains( _id ) )
{
// then remove it
removeTab( _id );
}
QString caption = ( _text_is_tooltip ) ? QString( "" ) : _text;
// create tab-button
TabButton * b = new TabButton( caption, _id, this );
connect( b, SIGNAL( clicked( int ) ), this, SLOT( tabClicked( int ) ) );
b->setIconSize( QSize( 48, 48 ) );
b->setFixedSize( 64, 64 );
b->show();
if( _text_is_tooltip )
{
ToolTip::add( b, _text );
}
// small workaround, because QBoxLayout::addWidget(...) doesn't
// work properly, so we first have to remove all tabs from the
// layout and them add them in the correct order
QMap<int, QPair<TabButton *, QWidget *> >::iterator it;
for( it = m_tabs.begin(); it != m_tabs.end(); ++it )
{
m_layout->removeWidget( it.value().first );
}
m_tabs.insert( _id, qMakePair( b, _w ) );
for( it = m_tabs.begin(); it != m_tabs.end(); ++it )
{
m_layout->addWidget( it.value().first );
}
if( _add_stretch )
{
m_layout->addStretch();
}
// we assume, parent-widget is a widget acting as widget-stack so all
// widgets have the same size and only the one on the top is visible
_w->setFixedSize( _w->parentWidget()->size() );
b->setFont( pointSize<8>( b->font() ) );
return( b );
}
开发者ID:DanielAeolusLaude,项目名称:lmms,代码行数:49,代码来源:TabBar.cpp
示例16: createTabButton
/*************************************************************************
Add tab button
*************************************************************************/
void TabControl::addButtonForTabContent(Window* wnd)
{
// Create the button
TabButton* tb = createTabButton(makeButtonName(wnd));
// Copy font
tb->setFont(getFont());
// Set target window
tb->setTargetWindow(wnd);
// Set index
tb->setTabIndex(d_nextTabIndex++);
// Instert into map
d_tabButtonIndexMap.insert(
TabButtonIndexMap::value_type(tb->getTabIndex(), tb));
// add the button
d_tabButtonPane->addChildWindow(tb);
// Subscribe to clicked event so that we can change tab
tb->subscribeEvent(TabButton::EventClicked,
Event::Subscriber(&TabControl::handleTabButtonClicked, this));
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:23,代码来源:CEGUITabControl.cpp
示例17: createTabButton
/*************************************************************************
Add tab button
*************************************************************************/
void TabControl::addButtonForTabContent(Window* wnd)
{
// Create the button
TabButton* tb = createTabButton(makeButtonName(wnd));
// Copy font
tb->setFont(getFont());
// Set target window
tb->setTargetWindow(wnd);
// Instert into map
d_tabButtonVector.push_back(tb);
// add the button
getTabButtonPane()->addChildWindow(tb);
// Subscribe to clicked event so that we can change tab
tb->subscribeEvent(TabButton::EventClicked,
Event::Subscriber(&TabControl::handleTabButtonClicked, this));
tb->subscribeEvent(TabButton::EventDragged,
Event::Subscriber(&TabControl::handleDraggedPane, this));
tb->subscribeEvent(TabButton::EventScrolled,
Event::Subscriber(&TabControl::handleWheeledPane, this));
}
开发者ID:akadjoker,项目名称:gmogre3d,代码行数:23,代码来源:CEGUITabControl.cpp
示例18: qDebug
TabWidget::TabWidget( QWidget* parent )
{
qDebug() << "[TABWIDGET] Constructing";
mGrabbedWidget = 0;
mTabs = 0;
// set the tab position
setTabsPosition();
mStatusBar = &mStatusBar->getInstance();
// create the tabbar
mBar = new TabBar;
setTabBar( mBar );
// connect the mouse clicks
connect( mBar, SIGNAL( tabRightClicked( int, QPoint ) ),
this, SLOT( tabRightClicked( int, QPoint ) ) );
connect( mBar, SIGNAL( tabMiddleClicked( int, QPoint ) ),
this, SLOT( tabMiddleClicked( int, QPoint ) ) );
TabButton* newTabButton = new TabButton( this );
TabButton* mMenuButton = new TabButton( this );
connect( newTabButton, SIGNAL( clicked() ),
this, SLOT( addUnityBrowser()) );
connect( newTabButton, SIGNAL( middleClicked() ),
this, SLOT( addUnityBrowserWithSR() ) );
connect( mMenuButton, SIGNAL( clicked() ),
mMenuButton, SLOT( showMenu()) );
mMenuButton->setMenu( kueueMainMenu() );
newTabButton->setIcon( QIcon( ":icons/menus/newtab.png" ) );
mMenuButton->setIcon( QIcon(":/icons/kueue.png") );
if ( Settings::unityEnabled() )
{
setCornerWidget( newTabButton, Qt::TopRightCorner );
}
setCornerWidget( mMenuButton, Qt::TopLeftCorner );
// create the main browser tabs...
mQueueBrowser = new QueueBrowser( this );
mSubownerBrowser = new SubownerBrowser( this );
mPersonalTab = new BrowserWithSearch( mQueueBrowser, this );
mSubownerTab = new BrowserWithSearch( mSubownerBrowser, this );
connect( mQueueBrowser, SIGNAL( setMenus() ),
this, SLOT( setMenus() ) );
connect( mSubownerBrowser, SIGNAL( setMenus() ),
this, SLOT( setMenus() ) );
connect( mQueueBrowser, SIGNAL( expandAll() ),
this, SLOT( expandAllTables() ) );
connect( mQueueBrowser, SIGNAL( closeAll() ),
this, SLOT( closeAllTables() ) );
mQmonBrowser = new QMonBrowser( this );
mMonitorTab = new BrowserWithSearch( mQmonBrowser, this );
mStatsBrowser = new StatsBrowser( this );
mStatsTab = new BrowserWithSearch( mStatsBrowser, this );
if ( Settings::unityEnabled() )
{
addUnityBrowser();
rebuildMaps();
}
mSubVisible = true;
// ...and add them to the tabbar
insertTab( 0, mPersonalTab, QIcon( ":icons/conf/targets.png" ), "Personal queue" );
insertTab( 1, mSubownerTab, QIcon( ":icons/conf/targets.png" ), "Subowned SRs" );
insertTab( 2, mMonitorTab, QIcon( ":/icons/conf/monitor.png" ), "Queue monitor" );
insertTab( 3, mStatsTab, QIcon( ":/icons/conf/stats.png" ), "Statistics" );
QShortcut* search = new QShortcut( QKeySequence( Qt::CTRL + Qt::Key_F ), this );
connect( search, SIGNAL( activated() ),
this, SLOT( showSearch() ) );
refreshTabs();
}
开发者ID:bochi,项目名称:kueue,代码行数:99,代码来源:tabwidget.cpp
示例19: pLargestTab
void TabStrip::Layout(Skin::Base* skin)
{
Gwen::Point pLargestTab(5, 5);
int iNum = 0;
for (Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter)
{
if (!*iter)
continue;
TabButton* pButton = (*iter)->DynamicCastTabButton();
if (!pButton) continue;
pButton->SizeToContents();
Margin m;
int iActive = pButton->IsActive() ? 0 : 2;
int iNotFirst = iNum > 0 ? -1 : 0;
int iControlOverhang = -3;
if (m_iDock == Pos::Top)
{
m.top = iActive;
m.left = iNotFirst;
m.bottom = iControlOverhang;
pButton->Dock(Pos::Left);
}
if (m_iDock == Pos::Left)
{
m.left = iActive * 2;
m.right = iControlOverhang;
m.top = iNotFirst;
pButton->Dock(Pos::Top);
}
if (m_iDock == Pos::Right)
{
m.right = iActive * 2;
m.left = iControlOverhang;
m.top = iNotFirst;
pButton->Dock(Pos::Top);
}
if (m_iDock == Pos::Bottom)
{
m.bottom = iActive;
m.left = iNotFirst;
m.top = iControlOverhang;
pButton->Dock(Pos::Left);
}
pLargestTab.x = Utility::Max(pLargestTab.x, pButton->Width());
pLargestTab.y = Utility::Max(pLargestTab.y, pButton->Height());
pButton->SetMargin(m);
iNum++;
}
if (m_iDock == Pos::Top || m_iDock == Pos::Bottom)
SetSize(Width(), pLargestTab.y);
if (m_iDock == Pos::Left || m_iDock == Pos::Right)
SetSize(pLargestTab.x, Height());
BaseClass::Layout(skin);
}
开发者ID:Hongtae,项目名称:bullet3,代码行数:67,代码来源:TabStrip.cpp
示例20: getButtonForTabContents
/*************************************************************************
Return whether the tab content window is currently selected.
*************************************************************************/
bool TabControl::isTabContentsSelected(Window* wnd) const
{
TabButton* button = getButtonForTabContents(wnd);
return button->isSelected();
}
开发者ID:akadjoker,项目名称:gmogre3d,代码行数:8,代码来源:CEGUITabControl.cpp
注:本文中的TabButton类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论