本文整理汇总了C++中BTextControl::SetExplicitMinSize方法的典型用法代码示例。如果您正苦于以下问题:C++ BTextControl::SetExplicitMinSize方法的具体用法?C++ BTextControl::SetExplicitMinSize怎么用?C++ BTextControl::SetExplicitMinSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BTextControl
的用法示例。
在下文中一共展示了BTextControl::SetExplicitMinSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BCheckBox
void
PartitionsPage::_FillPartitionsView(BView* view)
{
// show | name | type | size | path
int32 rowNumber = 0;
BMessage message;
for (int32 i = 0; fSettings->FindMessage("partition", i, &message) == B_OK;
i++, rowNumber++) {
// get partition data
bool show;
BString name;
BString type;
BString path;
int64 size;
message.FindBool("show", &show);
message.FindString("name", &name);
message.FindString("type", &type);
message.FindString("path", &path);
message.FindInt64("size", &size);
// check box
BCheckBox* checkBox = new BCheckBox("show", "",
_CreateControlMessage(kMessageShow, i));
if (show)
checkBox->SetValue(1);
// name
BTextControl* nameControl = new BTextControl("name", "",
name.String(), _CreateControlMessage(kMessageName, i));
nameControl->SetExplicitMinSize(BSize(StringWidth("WWWWWWWWWWWWWW"),
B_SIZE_UNSET));
// size
BString sizeText;
_CreateSizeText(size, &sizeText);
sizeText << ", " << type.String();
BStringView* typeView = new BStringView("type", sizeText.String());
typeView->SetExplicitAlignment(
BAlignment(B_ALIGN_LEFT, B_ALIGN_VERTICAL_UNSET));
// path
BStringView* pathView = new BStringView("path", path.String());
pathView->SetExplicitAlignment(
BAlignment(B_ALIGN_LEFT, B_ALIGN_VERTICAL_UNSET));
if (rowNumber > 0) {
BLayoutBuilder::Grid<>((BGridLayout*)view->GetLayout())
.Add(new BSeparatorView(B_HORIZONTAL), 0, rowNumber, 4, 1)
.SetRowWeight(rowNumber, 0);
rowNumber++;
}
BLayoutBuilder::Grid<>((BGridLayout*)view->GetLayout())
.Add(checkBox, 0, rowNumber, 1, 2)
.Add(nameControl, 1, rowNumber, 1, 2)
.Add(BSpaceLayoutItem::CreateHorizontalStrut(10), 2, rowNumber)
.Add(typeView, 3, rowNumber)
.Add(pathView, 3, rowNumber + 1)
.SetRowWeight(rowNumber + 1, 1);
rowNumber++;
}
}