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


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

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


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

示例1: BMessage

NetworkWindow::NetworkWindow()
	:
	BWindow(BRect(100, 100, 400, 400), B_TRANSLATE("Network"), B_TITLED_WINDOW,
		B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS),
	fServicesItem(NULL),
	fDialUpItem(NULL),
	fOtherItem(NULL)
{
	// Profiles section
#if ENABLE_PROFILES
	BPopUpMenu* profilesPopup = new BPopUpMenu("<none>");
	_BuildProfilesMenu(profilesPopup, kMsgProfileSelected);

	BMenuField* profilesMenuField = new BMenuField("profiles_menu",
		B_TRANSLATE("Profile:"), profilesPopup);

	profilesMenuField->SetFont(be_bold_font);
	profilesMenuField->SetEnabled(false);
#endif

	// Settings section

	fRevertButton = new BButton("revert", B_TRANSLATE("Revert"),
		new BMessage(kMsgRevert));

	BMessage* message = new BMessage(kMsgToggleReplicant);
	BCheckBox* showReplicantCheckBox = new BCheckBox("showReplicantCheckBox",
		B_TRANSLATE("Show network status in Deskbar"), message);
	showReplicantCheckBox->SetExplicitMaxSize(
		BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
	showReplicantCheckBox->SetValue(_IsReplicantInstalled());

	fListView = new BOutlineListView("list", B_SINGLE_SELECTION_LIST,
		B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_FRAME_EVENTS | B_NAVIGABLE);
	fListView->SetSelectionMessage(new BMessage(kMsgItemSelected));

	BScrollView* scrollView = new BScrollView("ScrollView", fListView,
		0, false, true);
	scrollView->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));

	fAddOnShellView = new BView("add-on shell", 0,
		new BGroupLayout(B_VERTICAL));
	fAddOnShellView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));

	fInterfaceView = new InterfaceView();

	// Build the layout
	BLayoutBuilder::Group<>(this, B_VERTICAL)
		.SetInsets(B_USE_DEFAULT_SPACING)

#if ENABLE_PROFILES
		.AddGroup(B_HORIZONTAL, B_USE_SMALL_SPACING)
			.Add(profilesMenuField)
			.AddGlue()
		.End()
#endif
		.AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
			.Add(scrollView)
			.Add(fAddOnShellView)
			.End()
		.Add(showReplicantCheckBox)
		.AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
			.Add(fRevertButton)
			.AddGlue()
		.End();

	gNetworkWindow = this;

	_ScanInterfaces();
	_ScanAddOns();
	_UpdateRevertButton();

	fListView->Select(0);
	_SelectItem(fListView->ItemAt(0));
		// Call this manually, so that CenterOnScreen() below already
		// knows the final window size.

	// Set size of the list view from its contents
	float width;
	float height;
	fListView->GetPreferredSize(&width, &height);
	width += 2 * be_control_look->DefaultItemSpacing();
	fListView->SetExplicitSize(BSize(width, B_SIZE_UNSET));
	fListView->SetExplicitMinSize(BSize(width, std::min(height, 400.f)));

	CenterOnScreen();

	fSettings.StartMonitoring(this);
	start_watching_network(B_WATCH_NETWORK_INTERFACE_CHANGES
		| B_WATCH_NETWORK_LINK_CHANGES | B_WATCH_NETWORK_WLAN_CHANGES, this);
}
开发者ID:kodybrown,项目名称:haiku,代码行数:91,代码来源:NetworkWindow.cpp


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