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


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

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


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

示例1: Expand

/*=============================================================================================*\
|	Expand																						|
+-----------------------------------------------------------------------------------------------+
|	Effet: Reduire la view, la fenetre mere et deplacer les autre view si necessaire.			|
\*=============================================================================================*/
void ShrinkView::Expand()
{
	BView * pTempView;	//Utiliser pour parcourir les View attacher a la meme fenetre mere.
	
	//Agradir la View.
	ResizeTo(Frame().Width(), m_fFullHeight);
	m_bShrink = false;

	//Redimentionner la fenetre mere
	if( Window() != NULL )
	{
		Window()->ResizeBy(0, m_fFullHeight - 15.0 );		
	}
	
	//Deplacer, si necessaire, les autre View. 
	pTempView = this;
	while( pTempView->PreviousSibling() != NULL)
	{
		pTempView = pTempView->PreviousSibling();
	}
	while(pTempView != NULL)
	{
		if(Frame().top + 16.0 <= pTempView->Frame().top )
		{	
			pTempView->MoveBy(0, m_fFullHeight - 15.0);
		}
		pTempView = pTempView->NextSibling();
	}
	
	Draw(Bounds());
}//End of Expand.
开发者ID:BackupTheBerlios,项目名称:dengon-svn,代码行数:36,代码来源:ShrinkView.cpp

示例2:

void
BRadioButton::SetValue(int32 value)
{
	if (value != Value()) {
		BControl::SetValueNoUpdate(value);
		Invalidate();

		if (value == B_CONTROL_ON) {
			for (BView *sibling = NextSibling(); sibling != NULL; sibling = sibling->NextSibling()) {
				BRadioButton *rbtn = cast_as(sibling, BRadioButton);
				if (rbtn != NULL) rbtn->SetValue(B_CONTROL_OFF);
			}
			for (BView *sibling = PreviousSibling(); sibling != NULL; sibling = sibling->PreviousSibling()) {
				BRadioButton *rbtn = cast_as(sibling, BRadioButton);
				if (rbtn != NULL) rbtn->SetValue(B_CONTROL_OFF);
			}
		}
	}
}
开发者ID:D-os,项目名称:BeFree,代码行数:19,代码来源:RadioButton.cpp

示例3: MouseDown

/**
	Starts dragging.
*/
void SplitView::MouseDown(BPoint where)
{
    // This is an event hook so there must be a Looper.
    BMessage *message = Looper()->CurrentMessage();
    int32 clicks = 0;
    message->FindInt32("clicks", &clicks);
    fDoubleClick = clicks == 2;
	if (!fDragged) {
		fDragged = true;
		fGrabPoint = where;
		BView *child = NULL;
		for (int i=0; (child = ChildAt(i)); i++) {
			if (fLayout.Mode() == B_HORIZONTAL && child->Frame().left > where.x)
				break;
			if (fLayout.Mode() == B_VERTICAL && child->Frame().top > where.y)
				break;
		}
		if (child)
			fSelected = child->PreviousSibling();
		Draw(Bounds());
		// Subscribe to off-view mouse events.
		SetMouseEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY | B_LOCK_WINDOW_FOCUS);
	}
}
开发者ID:HaikuArchives,项目名称:Album,代码行数:27,代码来源:SplitView.cpp


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