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


C++ BMenuField::SetExplicitMaxSize方法代码示例

本文整理汇总了C++中BMenuField::SetExplicitMaxSize方法的典型用法代码示例。如果您正苦于以下问题:C++ BMenuField::SetExplicitMaxSize方法的具体用法?C++ BMenuField::SetExplicitMaxSize怎么用?C++ BMenuField::SetExplicitMaxSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BMenuField的用法示例。


在下文中一共展示了BMenuField::SetExplicitMaxSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: BMessage


//.........这里部分代码省略.........
	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);
	add_menu_to_layout(menu, interfaceLayout, layoutRow);

	fSpellCheckStartOnMenu = _BuildSpellCheckStartOnMenu(fSpellCheckStartOn);
	menu = new BMenuField("spellCheckStartOn",
		B_TRANSLATE("Initial spell check mode:"),
		fSpellCheckStartOnMenu);
	add_menu_to_layout(menu, interfaceLayout, layoutRow);

	fAutoMarkReadMenu = _BuildAutoMarkReadMenu(fAutoMarkRead);
	menu = new BMenuField("autoMarkRead",
		B_TRANSLATE("Automatically mark mail as read:"),
		fAutoMarkReadMenu);
	add_menu_to_layout(menu, interfaceLayout, layoutRow);
	// Mail Accounts

	layoutRow = 0;

	fAccountMenu = _BuildAccountMenu(fAccount);
	menu = new BMenuField("account", B_TRANSLATE("Default account:"),
		fAccountMenu);
	add_menu_to_layout(menu, mailLayout, layoutRow);

	fReplyToMenu = _BuildReplyToMenu(fReplyTo);
	menu = new BMenuField("replyTo", B_TRANSLATE("Reply account:"),
		fReplyToMenu);
	add_menu_to_layout(menu, mailLayout, layoutRow);

	// Mail Contents

	fReplyPreamble = new BTextControl("replytext",
		B_TRANSLATE("Reply preamble:"),
		*preamble, new BMessage(P_REPLY_PREAMBLE));
	fReplyPreamble->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);

	fReplyPreambleMenu = _BuildReplyPreambleMenu();
	menu = new BMenuField("replyPreamble", NULL, fReplyPreambleMenu);
	menu->SetExplicitMaxSize(BSize(27, B_SIZE_UNSET));

	mailLayout->AddItem(fReplyPreamble->CreateLabelLayoutItem(), 0, layoutRow);
	mailLayout->AddItem(fReplyPreamble->CreateTextViewLayoutItem(), 1,
		layoutRow);
	mailLayout->AddView(menu, 2, layoutRow);
	layoutRow++;

	fSignatureMenu = _BuildSignatureMenu(*sig);
	menu = new BMenuField("sig", B_TRANSLATE("Auto signature:"),
		fSignatureMenu);
	add_menu_to_layout(menu, mailLayout, layoutRow);

	fEncodingMenu = _BuildEncodingMenu(fEncoding);
	menu = new BMenuField("enc", B_TRANSLATE("Encoding:"), fEncodingMenu);
	add_menu_to_layout(menu, mailLayout, layoutRow);

	fWarnUnencodableMenu = _BuildWarnUnencodableMenu(fWarnUnencodable);
	menu = new BMenuField("warnUnencodable", B_TRANSLATE("Warn unencodable:"),
		fWarnUnencodableMenu);
	add_menu_to_layout(menu, mailLayout, layoutRow);

	fWrapMenu = _BuildWrapMenu(*wrap);
	menu = new BMenuField("wrap", B_TRANSLATE("Text wrapping:"), fWrapMenu);
	add_menu_to_layout(menu, mailLayout, layoutRow);

	fAttachAttributesMenu = _BuildAttachAttributesMenu(*attachAttributes);
	menu = new BMenuField("attachAttributes", B_TRANSLATE("Attach attributes:"),
		fAttachAttributesMenu);
	add_menu_to_layout(menu, mailLayout, layoutRow);

	SetLayout(new BGroupLayout(B_HORIZONTAL));

	AddChild(BGroupLayoutBuilder(B_VERTICAL, kSpacing)
		.Add(interfaceBox)
		.Add(mailBox)
		.Add(BGroupLayoutBuilder(B_HORIZONTAL, kSpacing)
			.Add(fRevert)
			.AddGlue()
			.Add(cancelButton)
			.Add(okButton)
		)
		.SetInsets(kSpacing, kSpacing, kSpacing, kSpacing)
	);

	Show();
}
开发者ID:simonsouth,项目名称:haiku,代码行数:101,代码来源:Prefs.cpp


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