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


C++ TabButton类代码示例

本文整理汇总了C++中TabButton的典型用法代码示例。如果您正苦于以下问题:C++ TabButton类的具体用法?C++ TabButton怎么用?C++ TabButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了TabButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


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