本文整理汇总了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.
示例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);
}
}
}
}
示例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);
}
}