本文整理汇总了C++中BTabView::ContainerView方法的典型用法代码示例。如果您正苦于以下问题:C++ BTabView::ContainerView方法的具体用法?C++ BTabView::ContainerView怎么用?C++ BTabView::ContainerView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BTabView
的用法示例。
在下文中一共展示了BTabView::ContainerView方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BTabView
SettingsWindow::SettingsWindow()
:
BWindow(BRect(100, 100, 500, 300), "MilkyTracker settings",
B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_NOT_RESIZABLE)
{
BTabView* tabView = new BTabView(Bounds(), "TabView");
BRect tabRect = tabView->ContainerView()->Bounds();
tabRect.InsetBy(5, 5);
fInterfaceSettingsView = new InterfaceSettingsView(tabRect);
fMidiSettingsView = new MidiSettingsView(tabRect);
tabView->AddTab(fInterfaceSettingsView);
tabView->AddTab(fMidiSettingsView);
AddChild(tabView);
}
示例2: rect
ConfigWindow::ConfigWindow()
:
BWindow(BRect(100, 100, 600, 540), B_TRANSLATE_SYSTEM_NAME("E-mail"),
B_TITLED_WINDOW,
B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_NOT_RESIZABLE),
fLastSelectedAccount(NULL),
fSaveSettings(false)
{
// create controls
BRect rect(Bounds());
BView *top = new BView(rect, NULL, B_FOLLOW_ALL, 0);
top->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
AddChild(top);
// determine font height
font_height fontHeight;
top->GetFontHeight(&fontHeight);
int32 height = (int32)(fontHeight.ascent + fontHeight.descent
+ fontHeight.leading) + 5;
rect.InsetBy(10, 10);
rect.bottom -= 18 + height;
BTabView *tabView = new BTabView(rect, NULL);
BView *view;
rect = tabView->Bounds();
rect.bottom -= tabView->TabHeight() + 4;
tabView->AddTab(view = new BView(rect, NULL, B_FOLLOW_ALL, 0));
tabView->TabAt(0)->SetLabel(B_TRANSLATE("Accounts"));
view->SetViewColor(top->ViewColor());
// accounts listview
rect = view->Bounds().InsetByCopy(10, 10);
rect.right = 190 - B_V_SCROLL_BAR_WIDTH;
rect.bottom -= height + 18;
fAccountsListView = new AccountsListView(rect, this);
view->AddChild(new BScrollView(NULL, fAccountsListView, B_FOLLOW_ALL, 0,
false, true));
rect.right += B_V_SCROLL_BAR_WIDTH;
rect.left -= 2;
rect.top = rect.bottom + 10;
rect.bottom = rect.top + height;
BRect sizeRect = rect;
sizeRect.right = sizeRect.left + 30 + view->StringWidth(
B_TRANSLATE("Add"));
view->AddChild(new BButton(sizeRect, NULL, B_TRANSLATE("Add"),
new BMessage(kMsgAddAccount), B_FOLLOW_BOTTOM));
sizeRect.left = sizeRect.right + 5;
sizeRect.right = sizeRect.left + 30 + view->StringWidth(
B_TRANSLATE("Remove"));
view->AddChild(fRemoveButton = new BButton(
sizeRect, NULL, B_TRANSLATE("Remove"),
new BMessage(kMsgRemoveAccount), B_FOLLOW_BOTTOM));
// accounts config view
rect = view->Bounds();
rect.left = fAccountsListView->Frame().right + B_V_SCROLL_BAR_WIDTH + 16;
rect.right -= 10;
fConfigView = new CenterContainer(rect);
view->AddChild(fConfigView);
_MakeHowToView();
// general settings
rect = tabView->ContainerView()->Bounds();
tabView->AddTab(view = new CenterContainer(rect));
tabView->TabAt(1)->SetLabel(B_TRANSLATE("Settings"));
rect = view->Bounds().InsetByCopy(10, 10);
rect.bottom = rect.top + height * 5 + 15;
BBox *box = new BBox(rect);
box->SetLabel(B_TRANSLATE("Mail checking"));
view->AddChild(box);
rect = box->Bounds().InsetByCopy(10, 10);
rect.top += 7;
rect.bottom = rect.top + height;
BRect tile = rect.OffsetByCopy(0, 1);
int32 labelWidth = (int32)view->StringWidth(B_TRANSLATE("Check every")) + 6;
tile.right = 80 + labelWidth;
fIntervalControl = new BTextControl(tile, "time",
B_TRANSLATE("Check every"), NULL, NULL);
fIntervalControl->SetDivider(labelWidth);
box->AddChild(fIntervalControl);
BPopUpMenu* frequencyPopUp = new BPopUpMenu(B_EMPTY_STRING);
const char* frequencyStrings[] = {
B_TRANSLATE_COMMENT("never", "mail checking frequency"),
B_TRANSLATE("minutes"),
B_TRANSLATE("hours"),
B_TRANSLATE("days")};
for (int32 i = 0; i < 4; i++) {
BMenuItem* item = new BMenuItem(frequencyStrings[i],
new BMessage(kMsgIntervalUnitChanged));
frequencyPopUp->AddItem(item);
//.........这里部分代码省略.........