本文整理汇总了C++中BButton::SetExplicitMaxSize方法的典型用法代码示例。如果您正苦于以下问题:C++ BButton::SetExplicitMaxSize方法的具体用法?C++ BButton::SetExplicitMaxSize怎么用?C++ BButton::SetExplicitMaxSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BButton
的用法示例。
在下文中一共展示了BButton::SetExplicitMaxSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BALMLayout
FriendWindow(BRect frame)
:
BWindow(frame, "ALM Friend Test", B_TITLED_WINDOW,
B_QUIT_ON_WINDOW_CLOSE | B_AUTO_UPDATE_SIZE_LIMITS),
fLayout2(NULL),
fBoom(NULL),
fLeft(NULL),
fTop(NULL),
fRight(NULL),
fBottom(NULL)
{
BButton* button1 = _MakeButton("friends!");
BButton* button2 = _MakeButton("friends!");
BButton* button3 = _MakeButton("friends!");
BButton* button4 = _MakeButton("friends!");
BButton* button5 = _MakeButton("friends!");
BButton* button6 = _MakeButton("friends!");
BALMLayout* layout1 = new BALMLayout(10, 10);
BView* almView1 = _MakeALMView(layout1);
BReference<XTab> xTabs[2];
layout1->AddXTabs(xTabs, 2);
BALM::BALMLayoutBuilder(layout1)
.Add(button1, layout1->Left(), layout1->Top(),
xTabs[0], layout1->Bottom())
.StartingAt(button1)
.AddToRight(button2, xTabs[1])
.AddToRight(button3, layout1->Right());
fLayout2 = new BALMLayout(10, 10, layout1);
BView* almView2 = _MakeALMView(fLayout2);
BALM::BALMLayoutBuilder(fLayout2)
.Add(button4, fLayout2->Left(), fLayout2->Top(), xTabs[0])
.StartingAt(button4)
.AddBelow(button5, NULL, xTabs[1], fLayout2->Right())
.AddBelow(button6, fLayout2->Bottom(), xTabs[0]);
fLeft = fLayout2->Left();
fBottom = fLayout2->BottomOf(button5);
fTop = fLayout2->BottomOf(button4);
fRight = xTabs[1];
layout1->AreaFor(button2)->SetContentAspectRatio(1.0f);
fLayout2->Solver()->AddConstraint(-1.0f, layout1->Left(), 1.0f, xTabs[0],
LinearProgramming::kLE, 90.0f);
BButton* archiveButton = new BButton("clone", new BMessage('arcv'));
archiveButton->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED,
B_SIZE_UNSET));
BLayoutBuilder::Group<>(this, B_VERTICAL)
.Add(almView1->GetLayout())
.Add(almView2->GetLayout())
.Add(archiveButton);
}
示例2: _MakeButton
BButton* _MakeButton(const char* label)
{
BButton* button = new BButton(label, new BMessage('BOOM'));
button->SetExplicitMinSize(BSize(10, 50));
button->SetExplicitMaxSize(BSize(500, 500));
button->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH,
B_ALIGN_USE_FULL_HEIGHT));
return button;
}
示例3: BMessage
BButton*
ScreenWindow::_CreateColumnRowButton(bool columns, bool plus)
{
BMessage* message = new BMessage(kMsgWorkspaceLayoutChanged);
message->AddInt32("delta_x", columns ? (plus ? 1 : -1) : 0);
message->AddInt32("delta_y", !columns ? (plus ? 1 : -1) : 0);
BButton* button = new BButton(plus ? "+" : "-", message);
button->SetFontSize(be_plain_font->Size() * 0.9);
BSize size = button->MinSize();
size.width = button->StringWidth("+") + 16;
button->SetExplicitMinSize(size);
button->SetExplicitMaxSize(size);
fWorkspacesButtons[(columns ? 0 : 2) + (plus ? 1 : 0)] = button;
return button;
}