本文整理汇总了C++中BGridLayout::AlignLayoutWith方法的典型用法代码示例。如果您正苦于以下问题:C++ BGridLayout::AlignLayoutWith方法的具体用法?C++ BGridLayout::AlignLayoutWith怎么用?C++ BGridLayout::AlignLayoutWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BGridLayout
的用法示例。
在下文中一共展示了BGridLayout::AlignLayoutWith方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BMessage
TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
bool* attachAttributes, bool* cquotes, int32* account, int32* replyTo,
char** preamble, char** sig, uint32* encoding, bool* warnUnencodable,
bool* spellCheckStartOn, bool* autoMarkRead, uint8* buttonBar)
:
BWindow(rect, B_TRANSLATE("Mail preferences"),
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE
| B_AUTO_UPDATE_SIZE_LIMITS),
fNewWrap(wrap),
fWrap(*fNewWrap),
fNewAttachAttributes(attachAttributes),
fAttachAttributes(*fNewAttachAttributes),
fNewButtonBar(buttonBar),
fButtonBar(*fNewButtonBar),
fNewColoredQuotes(cquotes),
fColoredQuotes(*fNewColoredQuotes),
fNewAccount(account),
fAccount(*fNewAccount),
fNewReplyTo(replyTo),
fReplyTo(*fNewReplyTo),
fNewPreamble(preamble),
fNewSignature(sig),
fSignature((char*)malloc(strlen(*fNewSignature) + 1)),
fNewFont(font),
fFont(*fNewFont),
fNewEncoding(encoding),
fEncoding(*fNewEncoding),
fNewWarnUnencodable(warnUnencodable),
fWarnUnencodable(*fNewWarnUnencodable),
fNewSpellCheckStartOn(spellCheckStartOn),
fSpellCheckStartOn(*fNewSpellCheckStartOn),
fNewAutoMarkRead(autoMarkRead),
fAutoMarkRead(*autoMarkRead)
{
strcpy(fSignature, *fNewSignature);
BMenuField* menu;
// group boxes
const float kSpacing = 8;
BGridView* interfaceView = new BGridView(kSpacing, kSpacing);
BGridLayout* interfaceLayout = interfaceView->GridLayout();
interfaceLayout->SetInsets(kSpacing, kSpacing, kSpacing, kSpacing);
BGridView* mailView = new BGridView(kSpacing, kSpacing);
BGridLayout* mailLayout = mailView->GridLayout();
mailLayout->SetInsets(kSpacing, kSpacing, kSpacing, kSpacing);
interfaceLayout->AlignLayoutWith(mailLayout, B_HORIZONTAL);
BBox* interfaceBox = new BBox(B_FANCY_BORDER, interfaceView);
interfaceBox->SetLabel(B_TRANSLATE("User interface"));
BBox* mailBox = new BBox(B_FANCY_BORDER, mailView);
mailBox->SetLabel(B_TRANSLATE("Mailing"));
// revert, ok & cancel
BButton* okButton = new BButton("ok", B_TRANSLATE("OK"),
new BMessage(P_OK));
okButton->MakeDefault(true);
BButton* cancelButton = new BButton("cancel", B_TRANSLATE("Cancel"),
new BMessage(P_CANCEL));
fRevert = new BButton("revert", B_TRANSLATE("Revert"),
new BMessage(P_REVERT));
fRevert->SetEnabled(false);
// User Interface
int32 layoutRow = 0;
fButtonBarMenu = _BuildButtonBarMenu(*buttonBar);
menu = new BMenuField("bar", B_TRANSLATE("Button bar:"), fButtonBarMenu);
add_menu_to_layout(menu, interfaceLayout, layoutRow);
fFontMenu = _BuildFontMenu(font);
menu = new BMenuField("font", B_TRANSLATE("Font:"), fFontMenu);
add_menu_to_layout(menu, interfaceLayout, layoutRow);
fSizeMenu = _BuildSizeMenu(font);
menu = new BMenuField("size", B_TRANSLATE("Size:"), fSizeMenu);
add_menu_to_layout(menu, interfaceLayout, layoutRow);
fColoredQuotesMenu = _BuildColoredQuotesMenu(fColoredQuotes);
menu = new BMenuField("cquotes", B_TRANSLATE("Colored quotes:"),
fColoredQuotesMenu);
//.........这里部分代码省略.........