本文整理汇总了C++中BCheckBox::SetExplicitMaxSize方法的典型用法代码示例。如果您正苦于以下问题:C++ BCheckBox::SetExplicitMaxSize方法的具体用法?C++ BCheckBox::SetExplicitMaxSize怎么用?C++ BCheckBox::SetExplicitMaxSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BCheckBox
的用法示例。
在下文中一共展示了BCheckBox::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);
}