本文整理汇总了C++中BCheckBox::ResizeTo方法的典型用法代码示例。如果您正苦于以下问题:C++ BCheckBox::ResizeTo方法的具体用法?C++ BCheckBox::ResizeTo怎么用?C++ BCheckBox::ResizeTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BCheckBox
的用法示例。
在下文中一共展示了BCheckBox::ResizeTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//calculate the view positions of all the MatrixLayoutItems
//on the items list with offsets based upon matrixLeft
//and matrixTop
void
LayoutMatrix :: Calc( const float paramMatrixLeft,
const float paramMatrixTop,
sem_id paramSemID)
{
int32 numItems = mpItemsList->CountItems();
if (!numItems) return;
if (acquire_sem(paramSemID) != B_NO_ERROR)
{
warning(myPrefs->FailAqSem);
return;
}
bool hasPopUpMenu = false;
TextItem * scratchTextItem;
for ( int i = 0;
i < numItems;
i++)
{
((LayoutMatrixItem *)(mpItemsList->ItemAt(i)))->Calc();
}
float widest = 0;
float tallest = 0;
int32 index = 0;
for ( int i = 0;
i < numItems;
i++)
{
LayoutMatrixItem * lmi = (LayoutMatrixItem *)mpItemsList->ItemAt(index++);
if (lmi->mfWidthPref > widest)
{
widest = lmi->mfWidthPref;
}
if (lmi->mfHeightPref > tallest)
{
tallest = lmi->mfHeightPref;
}
}
if (mui32Flags & SAMESIZE)
{//SAMESIZE makes all items the same size as the largest
index = 0;
//Resize all items to match largest:
for ( uint32 i = 0;
i < mui32Rows;
i++)
{
for ( uint32 j = 0;
j < mui32Columns;
j++)
{
LayoutMatrixItem * lmi = (LayoutMatrixItem *)mpItemsList->ItemAt(index++);
switch (lmi->mui32Kind)
{
case KIND_MYSPACER:
{
MySpacer * scratchMySpacer = (MySpacer *)lmi->mpItem;
if (scratchMySpacer->mbSAMEFromWidest)
{
scratchMySpacer->ResizeTo(widest, tallest);
}
}
break;
case KIND_MYBUTTON:
{
BButton * scratchMyButton = (BButton *)lmi->mpItem;
scratchMyButton->ResizeTo(widest, tallest);
}
break;
case KIND_MYSLIDER:
{
BSlider * scratchMySlider = (BSlider *)lmi->mpItem;
scratchMySlider->ResizeTo(widest, tallest);
}
break;
case KIND_STRINGDRAWER:
{
BStringView * scratchMyStringView = (BStringView *)lmi->mpItem;
scratchMyStringView->ResizeTo(widest, tallest);
}
break;
case KIND_MYCHECKBOX:
{
BCheckBox * scratchMyCheckBox = (BCheckBox *)lmi->mpItem;
scratchMyCheckBox->ResizeTo(widest, tallest);
}
break;
case KIND_MYPICTUREBUTTON:
{
BPictureButton * scratchMyPictureButton = (BPictureButton *)lmi->mpItem;
scratchMyPictureButton->ResizeTo(widest, tallest);
}
break;
case KIND_MYCOLORCONTROL:
{
BColorControl * scratchMyColorControl = (BColorControl *)lmi->mpItem;
scratchMyColorControl->ResizeTo(widest, tallest);
}
break;
//.........这里部分代码省略.........