本文整理汇总了C++中BStringView::SetExplicitMinSize方法的典型用法代码示例。如果您正苦于以下问题:C++ BStringView::SetExplicitMinSize方法的具体用法?C++ BStringView::SetExplicitMinSize怎么用?C++ BStringView::SetExplicitMinSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BStringView
的用法示例。
在下文中一共展示了BStringView::SetExplicitMinSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BStringView
BStringView*
InfoWin::_CreateInfo(const char* name)
{
BStringView* view = new BStringView(name, "");
view->SetExplicitMinSize(BSize(200, B_SIZE_UNSET));
view->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
view->SetTruncation(B_TRUNCATE_SMART);
return view;
}
示例2: BMessage
ModifierKeysWindow::ModifierKeysWindow()
:
BWindow(BRect(0, 0, 360, 220), B_TRANSLATE("Modifier keys"),
B_FLOATING_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE
| B_AUTO_UPDATE_SIZE_LIMITS)
{
get_key_map(&fCurrentMap, &fCurrentBuffer);
get_key_map(&fSavedMap, &fSavedBuffer);
BStringView* keyRole = new BStringView("key role",
B_TRANSLATE_COMMENT("Role", "As in the role of a modifier key"));
keyRole->SetAlignment(B_ALIGN_RIGHT);
keyRole->SetFont(be_bold_font);
BStringView* keyLabel = new BStringView("key label",
B_TRANSLATE_COMMENT("Key", "As in a computer keyboard key"));
keyLabel->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
keyLabel->SetFont(be_bold_font);
BMenuField* shiftMenuField = _CreateShiftMenuField();
shiftMenuField->SetAlignment(B_ALIGN_RIGHT);
BMenuField* controlMenuField = _CreateControlMenuField();
controlMenuField->SetAlignment(B_ALIGN_RIGHT);
BMenuField* optionMenuField = _CreateOptionMenuField();
optionMenuField->SetAlignment(B_ALIGN_RIGHT);
BMenuField* commandMenuField = _CreateCommandMenuField();
commandMenuField->SetAlignment(B_ALIGN_RIGHT);
fShiftConflictView = new ConflictView("shift warning view");
fShiftConflictView->SetExplicitMaxSize(BSize(15, 15));
fControlConflictView = new ConflictView("control warning view");
fControlConflictView->SetExplicitMaxSize(BSize(15, 15));
fOptionConflictView = new ConflictView("option warning view");
fOptionConflictView->SetExplicitMaxSize(BSize(15, 15));
fCommandConflictView = new ConflictView("command warning view");
fCommandConflictView->SetExplicitMaxSize(BSize(15, 15));
fCancelButton = new BButton("cancelButton", B_TRANSLATE("Cancel"),
new BMessage(B_QUIT_REQUESTED));
fRevertButton = new BButton("revertButton", B_TRANSLATE("Revert"),
new BMessage(kMsgRevertModifiers));
fRevertButton->SetEnabled(false);
fOkButton = new BButton("okButton", B_TRANSLATE("Set modifier keys"),
new BMessage(kMsgApplyModifiers));
fOkButton->MakeDefault(true);
// Build the layout
SetLayout(new BGroupLayout(B_VERTICAL));
float forcedMinWidth = be_plain_font->StringWidth("XXX") * 4;
keyRole->SetExplicitMinSize(BSize(forcedMinWidth, B_SIZE_UNSET));
BLayoutItem* shiftLabel = shiftMenuField->CreateLabelLayoutItem();
shiftLabel->SetExplicitMinSize(BSize(forcedMinWidth, B_SIZE_UNSET));
BLayoutItem* controlLabel = controlMenuField->CreateLabelLayoutItem();
controlLabel->SetExplicitMinSize(BSize(forcedMinWidth, B_SIZE_UNSET));
BLayoutItem* optionLabel = optionMenuField->CreateLabelLayoutItem();
optionLabel->SetExplicitMinSize(BSize(forcedMinWidth, B_SIZE_UNSET));
BLayoutItem* commandLabel = commandMenuField->CreateLabelLayoutItem();
commandLabel->SetExplicitMinSize(BSize(forcedMinWidth, B_SIZE_UNSET));
AddChild(BLayoutBuilder::Group<>(B_VERTICAL, B_USE_SMALL_SPACING)
.AddGroup(B_HORIZONTAL)
.Add(keyRole)
.Add(keyLabel)
.End()
.AddGroup(B_HORIZONTAL)
.Add(shiftLabel)
.Add(shiftMenuField->CreateMenuBarLayoutItem())
.Add(fShiftConflictView)
.End()
.AddGroup(B_HORIZONTAL)
.Add(controlLabel)
.Add(controlMenuField->CreateMenuBarLayoutItem())
.Add(fControlConflictView)
.End()
.AddGroup(B_HORIZONTAL)
.Add(optionLabel)
.Add(optionMenuField->CreateMenuBarLayoutItem())
.Add(fOptionConflictView)
.End()
.AddGroup(B_HORIZONTAL)
.Add(commandLabel)
.Add(commandMenuField->CreateMenuBarLayoutItem())
.Add(fCommandConflictView)
.End()
.AddGlue()
.AddGroup(B_HORIZONTAL)
.Add(fCancelButton)
.AddGlue()
.Add(fRevertButton)
.Add(fOkButton)
//.........这里部分代码省略.........