本文整理汇总了C++中BTabView::Frame方法的典型用法代码示例。如果您正苦于以下问题:C++ BTabView::Frame方法的具体用法?C++ BTabView::Frame怎么用?C++ BTabView::Frame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BTabView
的用法示例。
在下文中一共展示了BTabView::Frame方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rect
ConfigWindow::ConfigWindow()
:
BWindow(BRect(100.0, 100.0, 580.0, 540.0), "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(5, 5);
rect.bottom -= 11 + 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(8, 8);
rect.right = 140 - B_V_SCROLL_BAR_WIDTH;
rect.bottom -= height + 12;
fAccountsListView = new AccountsListView(rect);
view->AddChild(new BScrollView(NULL, fAccountsListView, B_FOLLOW_ALL, 0,
false, true));
rect.right += B_V_SCROLL_BAR_WIDTH;
rect.top = rect.bottom + 8;
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+3;
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;
view->AddChild(fConfigView = new CenterContainer(rect));
MakeHowToView();
// general settings
rect = tabView->Bounds();
rect.bottom -= tabView->TabHeight() + 4;
tabView->AddTab(view = new CenterContainer(rect));
tabView->TabAt(1)->SetLabel(B_TRANSLATE("Settings"));
rect = view->Bounds().InsetByCopy(8, 8);
rect.right -= 1;
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(8, 8);
rect.top += 7;
rect.bottom = rect.top + height + 5;
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("never"),
B_TRANSLATE("minutes"),
B_TRANSLATE("hours"),
B_TRANSLATE("days")
};
BMenuItem *item;
for (int32 i = 0; i < 4; i++) {
frequencyPopUp->AddItem(item = new BMenuItem(frequencyStrings[i],
new BMessage(kMsgIntervalUnitChanged)));
//.........这里部分代码省略.........
示例2: rect
ConfigWindow::ConfigWindow()
: BWindow(BRect(200.0, 200.0, 640.0, 640.0),
"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(5,5); rect.bottom -= 11 + height;
BTabView *tabView = new BTabView(rect,NULL);
BView *view,*generalView;
rect = tabView->Bounds(); rect.bottom -= tabView->TabHeight() + 4;
tabView->AddTab(view = new BView(rect,NULL,B_FOLLOW_ALL,0));
tabView->TabAt(0)->SetLabel(MDR_DIALECT_CHOICE ("Accounts","アカウント"));
view->SetViewColor(top->ViewColor());
// accounts listview
rect = view->Bounds().InsetByCopy(8,8);
rect.right = 140 - B_V_SCROLL_BAR_WIDTH;
rect.bottom -= height + 12;
fAccountsListView = new AccountsListView(rect);
view->AddChild(new BScrollView(NULL,fAccountsListView,B_FOLLOW_ALL,0,false,true));
rect.right += B_V_SCROLL_BAR_WIDTH;
rect.top = rect.bottom + 8; rect.bottom = rect.top + height;
BRect sizeRect = rect;
sizeRect.right = sizeRect.left + 30 + view->StringWidth(MDR_DIALECT_CHOICE ("Add","追加"));
view->AddChild(new BButton(sizeRect,NULL,MDR_DIALECT_CHOICE ("Add","追加"),
new BMessage(kMsgAddAccount),B_FOLLOW_BOTTOM));
sizeRect.left = sizeRect.right+3;
sizeRect.right = sizeRect.left + 30 + view->StringWidth(MDR_DIALECT_CHOICE ("Remove","削除"));
view->AddChild(fRemoveButton = new BButton(sizeRect,NULL,MDR_DIALECT_CHOICE ("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;
view->AddChild(fConfigView = new CenterContainer(rect));
MakeHowToView();
// general settings
rect = tabView->Bounds(); rect.bottom -= tabView->TabHeight() + 4;
tabView->AddTab(view = new CenterContainer(rect));
tabView->TabAt(1)->SetLabel(MDR_DIALECT_CHOICE ("General","一般"));
rect = view->Bounds().InsetByCopy(8,8);
rect.right -= 1; rect.bottom = rect.top + height * 5 + 15;
BBox *box = new BBox(rect);
box->SetLabel(MDR_DIALECT_CHOICE ("Retrieval Frequency","メールチェック間隔"));
view->AddChild(box);
rect = box->Bounds().InsetByCopy(8,8);
rect.top += 7; rect.bottom = rect.top + height + 5;
BRect tile = rect.OffsetByCopy(0,1);
int32 labelWidth = (int32)view->StringWidth(MDR_DIALECT_CHOICE ("Check every:","メールチェック間隔:"))+6;
tile.right = 80 + labelWidth;
fIntervalControl = new BTextControl(tile,"time",MDR_DIALECT_CHOICE ("Check every:","メールチェック間隔:"),
NULL,NULL);
fIntervalControl->SetDivider(labelWidth);
box->AddChild(fIntervalControl);
BPopUpMenu *frequencyPopUp = new BPopUpMenu(B_EMPTY_STRING);
const char *frequencyStrings[] = {
MDR_DIALECT_CHOICE ("Never","チェックしない"),
MDR_DIALECT_CHOICE ("Minutes","分毎チェック"),
MDR_DIALECT_CHOICE ("Hours","時間毎チェック"),
MDR_DIALECT_CHOICE ("Days","日間毎チェック")};
BMenuItem *item;
for (int32 i = 0;i < 4;i++)
{
frequencyPopUp->AddItem(item = new BMenuItem(frequencyStrings[i],new BMessage(kMsgIntervalUnitChanged)));
if (i == 1)
item->SetMarked(true);
}
tile.left = tile.right + 5; tile.right = rect.right;
tile.OffsetBy(0,-1);
fIntervalUnitField = new BMenuField(tile,"frequency", B_EMPTY_STRING, frequencyPopUp);
fIntervalUnitField->SetDivider(0.0);
box->AddChild(fIntervalUnitField);
rect.OffsetBy(0,height + 9); rect.bottom -= 2;
fPPPActiveCheckBox = new BCheckBox(rect,"ppp active",
MDR_DIALECT_CHOICE ("only when PPP is active","PPP接続中時のみ"), NULL);
//.........这里部分代码省略.........