本文整理汇总了C++中BTabView::Bounds方法的典型用法代码示例。如果您正苦于以下问题:C++ BTabView::Bounds方法的具体用法?C++ BTabView::Bounds怎么用?C++ BTabView::Bounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BTabView
的用法示例。
在下文中一共展示了BTabView::Bounds方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BMessage
void
TTimeWindow::_InitWindow()
{
SetPulseRate(500000);
fDateTimeView = new DateTimeView(Bounds());
BRect bounds = fDateTimeView->Bounds();
fTimeZoneView = new TimeZoneView(bounds);
fBaseView = new TTimeBaseView(bounds, "baseView");
AddChild(fBaseView);
fBaseView->StartWatchingAll(fDateTimeView);
fBaseView->StartWatchingAll(fTimeZoneView);
bounds.OffsetBy(10.0, 10.0);
BTabView *tabView = new BTabView(bounds.InsetByCopy(-5.0, -5.0),
"tabView" , B_WIDTH_AS_USUAL, B_FOLLOW_NONE);
BTab *tab = new BTab();
tabView->AddTab(fDateTimeView, tab);
tab->SetLabel("Date & Time");
tab = new BTab();
tabView->AddTab(fTimeZoneView, tab);
tab->SetLabel("Time zone");
fBaseView->AddChild(tabView);
tabView->ResizeBy(0.0, tabView->TabHeight());
BRect rect = Bounds();
rect.left = 10;
rect.top = rect.bottom - 10;
fRevertButton = new BButton(rect, "revert", "Revert",
new BMessage(kMsgRevert), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM, B_WILL_DRAW);
fRevertButton->ResizeToPreferred();
fRevertButton->SetEnabled(false);
float buttonHeight = fRevertButton->Bounds().Height();
fRevertButton->MoveBy(0, -buttonHeight);
fBaseView->AddChild(fRevertButton);
fRevertButton->SetTarget(this);
fBaseView->ResizeTo(tabView->Bounds().Width() + 10.0,
tabView->Bounds().Height() + buttonHeight + 30.0);
ResizeTo(fBaseView->Bounds().Width(), fBaseView->Bounds().Height());
}
示例2: BView
InTextView::InTextView(BRect rect, char *name)
: BView(rect, name, B_FOLLOW_ALL_SIDES, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_FRAME_EVENTS |B_SUBPIXEL_PRECISE)
{
BRect r;
BTabView *tabView;
BTab *tab;
TOCView *tocView;
r = Bounds();
//r.InsetBy(5,5);
tabView = new BTabView(r, "tab_view");
tabView->SetViewColor(216,216,216,0);
r = tabView->Bounds();
r.InsetBy(5,5);
r.bottom -= tabView->TabHeight();
tab = new BTab();
tocView = new TOCView(r, "TOC_View");
tabView->AddTab(tocView, tab);
tab->SetLabel("Table of Contents");
tab = new BTab();
unitView = new UnitView(r,"Unit_View");
tabView->AddTab(unitView, tab);
tab->SetLabel("Lesson");
AddChild(tabView);
}
示例3: BMessage
/*! \brief Init user interface regardless of the parameter of constructor.
*/
void EventEditorMainWindow::InitUI()
{
ClearUI();
MainView = new BView( BWindow::Bounds(),
"Event Editor Main View",
B_FOLLOW_ALL,
B_WILL_DRAW | B_FRAME_EVENTS );
if ( MainView != NULL )
{
MainView->SetViewColor( ui_color(B_PANEL_BACKGROUND_COLOR ) );
BWindow::AddChild( MainView );
}
else
{
global_toReturn = B_NO_MEMORY;
be_app->PostMessage( B_QUIT_REQUESTED );
}
BGridLayout* layout = new BGridLayout( B_VERTICAL );
if ( !layout ) {
global_toReturn = B_NO_MEMORY;
be_app->PostMessage( B_QUIT_REQUESTED );
}
MainView->SetLayout( layout );
layout->SetInsets( 0, 0, 0, 5 );
layout->SetSpacing( 0, 2 );
menuBar = CreateMenuBar();
layout->AddView( menuBar, 0, 0 );
BTabView* tabView = new BTabView( Bounds().InsetBySelf( 5, 30 ),
"Tab view" );
if ( !tabView ) {
global_toReturn = B_NO_MEMORY;
be_app->PostMessage( B_QUIT_REQUESTED );
}
BLayoutItem* layoutItem = layout->AddView( tabView, 0, 1 );
if ( layoutItem ) {
layoutItem->SetExplicitAlignment( BAlignment( B_ALIGN_USE_FULL_WIDTH, B_ALIGN_USE_FULL_HEIGHT ) );
}
BRect individualTab = tabView->Bounds();
individualTab.bottom -= ( tabView->TabHeight() + 20 + menuBar->Bounds().Height() );
// Enable firing the activity in any case
fData.SetEventActivityFired( false );
// General view
genView = new EventEditor_GeneralView( individualTab, &fData );
if ( !genView || genView->InitCheck() != B_OK ) {
global_toReturn = B_NO_MEMORY;
be_app->PostMessage( B_QUIT_REQUESTED );
}
BTab* tab = new BTab();
tabView->AddTab( genView, tab );
tab->SetLabel( "General" );
// Reminder view
remView = new EventEditor_ReminderView( individualTab, &fData );
if ( !remView || remView->InitCheck() != B_OK ) {
global_toReturn = B_NO_MEMORY;
be_app->PostMessage( B_QUIT_REQUESTED );
}
tab = new BTab();
tabView->AddTab( remView, tab );
tab->SetLabel( "Reminder" );
// Event activity
actView = new ActivityView( individualTab.InsetByCopy( 5, 5 ), "Event activity", fData.GetEventActivity() );
if ( !actView || actView->InitCheck() != B_OK ) {
global_toReturn = B_NO_MEMORY;
be_app->PostMessage( B_QUIT_REQUESTED );
}
tab = new BTab();
tabView->AddTab( actView, tab );
tab->SetLabel( "Activity" );
// Note view
noteView = new EventEditor_NoteView( individualTab.InsetByCopy( 5, 5 ), &fData );
if ( !noteView || noteView->InitCheck() != B_OK ) {
global_toReturn = B_NO_MEMORY;
be_app->PostMessage( B_QUIT_REQUESTED );
}
tab = new BTab();
tabView->AddTab( noteView, tab );
tab->SetLabel( "Note" );
menuBar->SetTargetForItems( this );
// Save button
saveAndClose = new BButton( BRect( 0, 0, 1, 1 ),
"Save",
"Save",
new BMessage( kFileSave ) );
if ( !saveAndClose ) {
global_toReturn = B_NO_MEMORY;
be_app->PostMessage( B_QUIT_REQUESTED );
//.........这里部分代码省略.........
示例4: 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)));
//.........这里部分代码省略.........
示例5: 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);
//.........这里部分代码省略.........
示例6: InitWindow
// ResourceUsageWindow::InitWindow -- Initialization Commands here
void ResourceUsageWindow::InitWindow(BList &list)
{
BRect rtab = Bounds();
BRect rlist = Bounds();
rtab.top += 10;
rlist.top += 10;
rlist.left += 12;
rlist.right -= 15 + B_V_SCROLL_BAR_WIDTH;
rlist.bottom -= 47;
// Create the TabView and Tabs
BTabView *tabView = new BTabView(rtab,"resource_usage_tabview");
tabView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
rtab = tabView->Bounds();
rtab.InsetBy(5,5);
// Create the ListViews
BListView *IRQListView = new BListView(rlist, "IRQListView",
B_SINGLE_SELECTION_LIST, B_FOLLOW_LEFT | B_FOLLOW_TOP,
B_WILL_DRAW | B_NAVIGABLE);
BListView *DMAListView = new BListView(rlist, "DMAListView",
B_SINGLE_SELECTION_LIST, B_FOLLOW_LEFT | B_FOLLOW_TOP,
B_WILL_DRAW | B_NAVIGABLE);
BListView *IORangeListView = new BListView(rlist, "IORangeListView",
B_SINGLE_SELECTION_LIST, B_FOLLOW_LEFT | B_FOLLOW_TOP,
B_WILL_DRAW | B_NAVIGABLE);
BListView *memoryListView = new BListView(rlist, "memoryListView",
B_SINGLE_SELECTION_LIST, B_FOLLOW_LEFT | B_FOLLOW_TOP,
B_WILL_DRAW | B_NAVIGABLE);
BScrollView *IRQScrollView = new BScrollView("scroll_list1", IRQListView,
B_FOLLOW_LEFT|B_FOLLOW_TOP, 0, false, true, B_FANCY_BORDER);
BScrollView *DMAScrollView = new BScrollView("scroll_list2", DMAListView,
B_FOLLOW_LEFT|B_FOLLOW_TOP, 0, false, true, B_FANCY_BORDER);
BScrollView *IORangeScrollView = new BScrollView("scroll_list3",
IORangeListView, B_FOLLOW_LEFT|B_FOLLOW_TOP, 0, false, true,
B_FANCY_BORDER);
BScrollView *memoryScrollView = new BScrollView("scroll_list4",
memoryListView, B_FOLLOW_LEFT|B_FOLLOW_TOP, 0, false, true,
B_FANCY_BORDER);
BTab *tab = new BTab();
tabView->AddTab(IRQScrollView, tab);
tab->SetLabel(B_TRANSLATE("IRQ"));
tab = new BTab();
tabView->AddTab(DMAScrollView, tab);
tab->SetLabel(B_TRANSLATE("DMA"));
tab = new BTab();
tabView->AddTab(IORangeScrollView, tab);
tab->SetLabel(B_TRANSLATE("IO Range"));
tab = new BTab();
tabView->AddTab(memoryScrollView, tab);
tab->SetLabel(B_TRANSLATE("Memory Range"));
{
uint32 mask = 1;
for (int i=0;i<16;mask<<=1,i++) {
bool first = true;
for (int32 j=0; j<list.CountItems(); j++) {
DevicesInfo *deviceInfo = (DevicesInfo *)list.ItemAt(j);
struct device_configuration *current = deviceInfo->GetCurrent();
resource_descriptor r;
int32 num = count_resource_descriptors_of_type(current,
B_IRQ_RESOURCE);
for (int32 k=0;k<num;k++) {
get_nth_resource_descriptor_of_type(current, k, B_IRQ_RESOURCE,
&r, sizeof(resource_descriptor));
if (mask & r.d.m.mask) {
IRQListView->AddItem(new IRQDMAItem(first ? i : -1,
deviceInfo->GetCardName()));
first = false;
}
}
}
if (first) {
IRQListView->AddItem(new IRQDMAItem(i, ""));
}
}
}
{
uint32 mask = 1;
for (int i=0;i<8;mask<<=1,i++) {
bool first = true;
for (int32 j=0; j<list.CountItems(); j++) {
DevicesInfo *deviceInfo = (DevicesInfo *)list.ItemAt(j);
struct device_configuration *current = deviceInfo->GetCurrent();
resource_descriptor r;
int32 num = count_resource_descriptors_of_type(current,
//.........这里部分代码省略.........