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


C++ BView::Show方法代码示例

本文整理汇总了C++中BView::Show方法的典型用法代码示例。如果您正苦于以下问题:C++ BView::Show方法的具体用法?C++ BView::Show怎么用?C++ BView::Show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BView的用法示例。


在下文中一共展示了BView::Show方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetValue

void CollapsableBox::SetValue(int32 new_value)
{
	if (new_value != Value()) {
		BRect r = Bounds();
		
		if (!new_value)
			ResizeTo(r.Width(), m_collapsed_rect.Height());
		else
			ResizeTo(r.Width(), m_expanded_rect.Height());
		
		BView *child;
		
		child = ChildAt(0);
		while (child) {
			if (new_value)
				child->Show();
			else
				child->Hide();
			child = child->NextSibling();
		};
			
		Invalidate();
		BControl::SetValue(new_value);
		Invoke();
	};
	
}
开发者ID:diversys,项目名称:sanity,代码行数:27,代码来源:CollapsableBox.cpp

示例2: ActivateView

void TMediaTabView::ActivateView(EChildID which)
{
	// Give the view the control buttons
	BView* view = ChildAt(which);

	BPoint pt = view->Bounds().LeftBottom();
	// Get the target button position. Slightly different for the
	// different view types.
	if (which == kElementsView)
		pt.y -= kScrollHeight;
	else {
		pt.x++;
		pt.y -= kScrollHeight + 1;
	}

	for (int i = 0; i < 3; i++) {
		view->AddChild(fbuttons[i]);
		fbuttons[i]->MoveTo(pt);
		pt.x += kScrollHeight;
	}

	// Make sure it is visible
	if (view->IsHidden())
		view->Show();
}
开发者ID:Barrett17,项目名称:UltraDV,代码行数:25,代码来源:TMediaTabView.cpp

示例3: Select

void YabTabView::Select(int32 index)
{
        if (index < 0 || index >= CountTabs())
                index = Selection();

        BView *tab = TabAt(Selection());
        if (tab)
	{
		Invalidate();
		tab->Hide();
	}

        tab = TabAt(index);
        if (tab) 
	{
			if (index != 0 && !Bounds().Contains(TabFrame(index))){
		if (!Bounds().Contains(TabFrame(index).LeftTop()))
			fTabOffset += TabFrame(index).left - Bounds().left - 20.0f;
		else
			fTabOffset += TabFrame(index).right - Bounds().right + 20.0f;
			}


		Invalidate();
                tab->Show();
                fSelection = index;
                FocusChanged = index+1;
        }

}
开发者ID:HaikuArchives,项目名称:Yab,代码行数:30,代码来源:YabTabView.cpp

示例4: ChildAt

void
PairsView::CreateGameBoard()
{
	// Show hidden buttons
	for (int32 i = 0; i < CountChildren(); i++) {
		BView* child = ChildAt(i);
		if (child->IsHidden())
			child->Show();
	}
	_GenerateCardPos();
}
开发者ID:veer77,项目名称:Haiku-services-branch,代码行数:11,代码来源:PairsView.cpp

示例5: ToggleFields

void MainView::ToggleFields(bool on)
{
	Field *child = NULL;
   	BView *field = NULL;

	child = (Field *)ChildAt(0);
    while(child) {
		field = child->GetField();
                
        if(on) {
           	if(field->IsHidden()) field->Show();
  		}
        else {
			if(!field->IsHidden()) field->Hide();
		}
  		child = (Field *)child->NextSibling();
	}
}
开发者ID:brennanos,项目名称:XFile-Haiku,代码行数:18,代码来源:MainView.cpp

示例6: GetPreferredSize

void ArpConfigurePanel::GetPreferredSize(float* width, float* height)
{
	float maxw=0, maxh=0;
	size_t i;
	
	// Get dimensions of all configuration views.
	for( i=0; i<mConfigViews->size(); i++ ) {
		BView* view = 0;
		if( (view=mConfigViews->at(i)) != 0 ) {
			ArpD(cdb << ADH << "Processing dimens for view #" << i
							<< ", name="
							<< view->Name() << endl);
			float vwidth=0, vheight=0;
			// If this view is not attached to the window (i.e., it
			// is not currently displayed by the tab view), then it
			// may not be able to report correct dimensions.  To fix
			// this, we temporarily add it to your view.
			if( !view->Window() ) {
				ArpD(cdb << ADH << "Temporarily attaching view to window."
							<< endl);
				bool hidden = view->IsHidden();
				view->Hide();
				AddChild(view);
				view->GetPreferredSize(&vwidth, &vheight);
				RemoveChild(view);
				if( !hidden ) view->Show();
			} else {
				view->GetPreferredSize(&vwidth, &vheight);
			}
			ArpD(cdb << ADH << "Preferred width=" << vwidth
							<< ", height=" << vheight << endl);
			if( vwidth > maxw ) maxw = vwidth;
			if( vheight > maxh ) maxh = vheight;
		}
	}
	
	ArpD(cdb << ADH << "Final size=(" << (maxw+mTabWidth)
				<< ", " << (maxh+mTabHeight) << ")" << endl);
				
	if( width ) *width = maxw + mTabWidth + 2;
	if( height ) *height = maxh + mTabHeight + 2;
}
开发者ID:HaikuArchives,项目名称:Sequitur,代码行数:42,代码来源:ArpConfigurePanel.cpp


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