当前位置: 首页>>代码示例>>C++>>正文


C++ BGridLayout::AlignLayoutWith方法代码示例

本文整理汇总了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);
//.........这里部分代码省略.........
开发者ID:simonsouth,项目名称:haiku,代码行数:101,代码来源:Prefs.cpp


注:本文中的BGridLayout::AlignLayoutWith方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。