Пример #1
0
/*=============================================================================================*\
|	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.
Пример #2
0
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);
			}
		}
	}
}
Пример #3
0
/**
	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);
	}
}