本文整理汇总了C++中BTabView::AddTab方法的典型用法代码示例。如果您正苦于以下问题:C++ BTabView::AddTab方法的具体用法?C++ BTabView::AddTab怎么用?C++ BTabView::AddTab使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BTabView
的用法示例。
在下文中一共展示了BTabView::AddTab方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: BGLView
OpenGLView::OpenGLView()
:
BGroupView("OpenGLView", B_VERTICAL)
{
BGLView* glView = new BGLView(BRect(0, 0, 1, 1), "gl info", B_FOLLOW_NONE, 0,
BGL_RGB | BGL_DOUBLE);
glView->Hide();
AddChild(glView);
glView->LockGL();
float tabViewWidth = this->StringWidth("M") * 42;
float tabViewHeight = this->StringWidth("M") * 16;
BTabView *tabView = new BTabView("tab view", B_WIDTH_FROM_LABEL);
tabView->SetExplicitMinSize(BSize(tabViewWidth, tabViewHeight));
tabView->AddTab(new CapabilitiesView());
tabView->AddTab(new ExtensionsView());
glView->UnlockGL();
GroupLayout()->SetSpacing(0);
BLayoutBuilder::Group<>(this)
.AddGroup(B_HORIZONTAL, 0)
.Add(new GearsView())
.AddGroup(B_VERTICAL, B_USE_DEFAULT_SPACING)
.SetInsets(0, B_USE_DEFAULT_SPACING,
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
.Add(new InfoView())
.Add(tabView)
.End()
.AddGlue()
.End();
}
示例3: BMessage
SettingsWindow::SettingsWindow(BRect frame, SettingsMessage* settings)
:
BWindow(frame, B_TRANSLATE("Settings"), B_TITLED_WINDOW_LOOK,
B_NORMAL_WINDOW_FEEL, B_AUTO_UPDATE_SIZE_LIMITS
| B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE),
fSettings(settings)
{
fApplyButton = new BButton(B_TRANSLATE("Apply"), new BMessage(MSG_APPLY));
fCancelButton = new BButton(B_TRANSLATE("Cancel"),
new BMessage(MSG_CANCEL));
fRevertButton = new BButton(B_TRANSLATE("Revert"),
new BMessage(MSG_REVERT));
fOpenFilePanel = NULL;
float spacing = be_control_look->DefaultItemSpacing();
BTabView* tabView = new BTabView("settings pages", B_WIDTH_FROM_LABEL);
tabView->SetBorder(B_NO_BORDER);
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
.SetInsets(0, B_USE_DEFAULT_SPACING, 0, B_USE_WINDOW_SPACING)
.Add(tabView)
.Add(new BSeparatorView(B_HORIZONTAL))
.AddGroup(B_HORIZONTAL)
.SetInsets(B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING,
B_USE_WINDOW_SPACING, 0)
.Add(fRevertButton)
.AddGlue()
.Add(fCancelButton)
.Add(fApplyButton);
tabView->AddTab(_CreateGeneralPage(spacing));
tabView->AddTab(_CreateFontsPage(spacing));
tabView->AddTab(_CreateProxyPage(spacing));
_SetupFontSelectionView(fStandardFontView,
new BMessage(MSG_STANDARD_FONT_CHANGED));
_SetupFontSelectionView(fSerifFontView,
new BMessage(MSG_SERIF_FONT_CHANGED));
_SetupFontSelectionView(fSansSerifFontView,
new BMessage(MSG_SANS_SERIF_FONT_CHANGED));
_SetupFontSelectionView(fFixedFontView,
new BMessage(MSG_FIXED_FONT_CHANGED));
fApplyButton->MakeDefault(true);
if (!frame.IsValid())
CenterOnScreen();
// load settings from disk
_RevertSettings();
// apply to WebKit
_ApplySettings();
// Start hidden
Hide();
Show();
}
示例4: 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());
}
示例5: BGroupLayout
PreferencesWindow::PreferencesWindow()
: BWindow(kDefaultFrame, "Preferences",
B_TITLED_WINDOW_LOOK,
B_NORMAL_WINDOW_FEEL,
B_AUTO_UPDATE_SIZE_LIMITS |
B_ASYNCHRONOUS_CONTROLS |
B_NOT_ZOOMABLE),
fTorrentPreferences(NULL),
fApplyButton(NULL),
fIncompleteFileNaming(NULL),
fTorrentSaveLocationPath(NULL),
fIncompleteDirEnabled(NULL),
fIncompleteDirPath(NULL),
fListeningPort(NULL),
fRandomPort(NULL),
fApplyPort(NULL),
fEnableForwardingPort(NULL),
fMaxConnection(NULL),
fApplyMaxConnection(NULL),
fTorrentMaxConnection(NULL),
fApplyTorrentMaxConnection(NULL),
fEnableDHTValue(NULL),
fEnablePEXValue(NULL),
fEnableUTPValue(NULL),
fEnableLPDValue(NULL),
fEncryptionMenu(NULL)
{
SetLayout(new BGroupLayout(B_VERTICAL));
//
// Get the torrent session.
// @TODO: clean up this mess..
//
fTorrentPreferences = static_cast<TorrentorApp*>(be_app)->Preferences();
float spacing = be_control_look->DefaultItemSpacing();
BTabView* tabView = new BTabView("settings pages", B_WIDTH_FROM_LABEL);
tabView->AddTab(_CreateTorrentsPage(spacing));
tabView->AddTab(_CreateConnectionPage(spacing));
AddChild(BGroupLayoutBuilder(B_VERTICAL, spacing)
.Add(tabView)
.SetInsets(spacing, spacing, spacing, spacing)
);
CenterOnScreen();
Run();
}
示例6: AddViews
void SeqPrefWin::AddViews(const BMessage& prefs)
{
BRect b = Bounds();
/* Add the bottom panel with the Cancel OK buttons. When this
* block is done, it will adjust the bounds accordingly (i.e.,
* without the space used by this view).
*/
{
float buttonW = 60, buttonH = 24;
float edgeR = 8, edgeB = 8, edgeT = 8;
BRect f(b);
f.top = f.bottom - edgeB - buttonH - edgeT;
BView* v = new BView( f, "button_panel", B_FOLLOW_LEFT_RIGHT | B_FOLLOW_BOTTOM, 0 );
if( v ) {
BRect f( b.right - edgeR - buttonW, edgeT, b.right - edgeR, edgeT + buttonH );
BButton* button = new BButton( f, "ok_button", "OK", new BMessage( OK_MSG ), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM );
if( button ) {
v->AddChild( button );
button->MakeDefault( true );
}
f.OffsetBy( 0-(buttonW + 10), 0 );
button = new BButton( f, "cancel_button", "Cancel", new BMessage( CANCEL_MSG ), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM );
if( button ) v->AddChild( button );
v->SetViewColor( Prefs().Color(AM_AUX_WINDOW_BG_C) );
AddChild( v );
b.bottom = b.bottom - edgeB - buttonH - edgeT - 1;
}
}
BTabView* tv = new BTabView(b, TABVIEW_STR);
if (!tv) return;
BView* fileView = NewFileView(b, prefs);
if (fileView) tv->AddTab(fileView);
BView* editView = NewEditView(b, prefs);
if (editView) tv->AddTab(editView);
BView* playbackView = NewTrackView(b, prefs);
if (playbackView) tv->AddTab(playbackView);
mFactoryView = NewFactoriesView(b, prefs);
if (mFactoryView) tv->AddTab(mFactoryView);
AddChild(tv);
/* NOTE: Have to do this after the tab view's been added to the window or else
* you get a crash. It's a bug in the tab view, nothing to be done about it.
*/
tv->SetTabWidth(B_WIDTH_FROM_WIDEST);
}
示例7: BMessage
OpenGLView::OpenGLView()
:
BGroupView("OpenGLView", B_VERTICAL)
{
BGLView* glView = new BGLView(BRect(0, 0, 1, 1), "gl info", B_FOLLOW_NONE, 0,
BGL_RGB | BGL_DOUBLE);
glView->Hide();
AddChild(glView);
glView->LockGL();
BMenu* menu = new BMenu(B_TRANSLATE("Automatic"));
menu->SetRadioMode(true);
menu->SetLabelFromMarked(true);
menu->AddItem(new BMenuItem(B_TRANSLATE("Automatic"),
new BMessage(MENU_AUTO_MESSAGE)));
menu->AddSeparatorItem();
menu->AddItem(new BMenuItem(B_TRANSLATE("Software Rasterizer"),
new BMessage(MENU_SWRAST_MESSAGE)));
menu->AddItem(new BMenuItem(B_TRANSLATE("Gallium Software Pipe"),
new BMessage(MENU_SWPIPE_MESSAGE)));
menu->AddItem(new BMenuItem(B_TRANSLATE("Gallium LLVM Pipe"),
new BMessage(MENU_SWLLVM_MESSAGE)));
BMenuField* menuField = new BMenuField("renderer",
B_TRANSLATE("3D Rendering Engine:"), menu);
// TODO: Set current Renderer
menuField->SetEnabled(false);
BTabView *tabView = new BTabView("tab view", B_WIDTH_FROM_LABEL);
tabView->AddTab(new InfoView());
tabView->AddTab(new CapabilitiesView());
tabView->AddTab(new ExtensionsView());
glView->UnlockGL();
GroupLayout()->SetSpacing(0);
BLayoutBuilder::Group<>(this)
.SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
.Add(menuField)
.AddGroup(B_HORIZONTAL)
.Add(tabView)
.SetInsets(0, B_USE_DEFAULT_SPACING, 0, 0);
}
示例8: BMessage
APRWindow::APRWindow(BRect frame)
:
BWindow(frame, B_TRANSLATE_SYSTEM_NAME("Appearance"), B_TITLED_WINDOW,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS
| B_QUIT_ON_WINDOW_CLOSE, B_ALL_WORKSPACES)
{
SetLayout(new BGroupLayout(B_HORIZONTAL));
fDefaultsButton = new BButton("defaults", B_TRANSLATE("Defaults"),
new BMessage(kMsgSetDefaults), B_WILL_DRAW);
fRevertButton = new BButton("revert", B_TRANSLATE("Revert"),
new BMessage(kMsgRevert), B_WILL_DRAW);
BTabView* tabView = new BTabView("tabview", B_WIDTH_FROM_LABEL);
fFontSettings = new FontView(B_TRANSLATE("Fonts"));
fColorsView = new APRView(B_TRANSLATE("Colors"));
fLookAndFeelSettings = new LookAndFeelSettingsView(
B_TRANSLATE("Look and feel"));
fAntialiasingSettings = new AntialiasingSettingsView(
B_TRANSLATE("Antialiasing"));
tabView->AddTab(fFontSettings);
tabView->AddTab(fColorsView);
tabView->AddTab(fLookAndFeelSettings);
tabView->AddTab(fAntialiasingSettings);
_UpdateButtons();
AddChild(BGroupLayoutBuilder(B_VERTICAL, 0)
.Add(tabView)
.Add(BSpaceLayoutItem::CreateVerticalStrut(5))
.Add(BGroupLayoutBuilder(B_HORIZONTAL)
.Add(fDefaultsButton)
.Add(fRevertButton)
.AddGlue()
)
.SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
);
}
示例9: 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);
}
示例10: BMessage
APRWindow::APRWindow(BRect frame)
:
BWindow(frame, B_TRANSLATE_SYSTEM_NAME("Appearance"), B_TITLED_WINDOW,
B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS, B_ALL_WORKSPACES)
{
SetLayout(new BGroupLayout(B_HORIZONTAL));
fDefaultsButton = new BButton("defaults", B_TRANSLATE("Defaults"),
new BMessage(kMsgSetDefaults), B_WILL_DRAW);
fRevertButton = new BButton("revert", B_TRANSLATE("Revert"),
new BMessage(kMsgRevert), B_WILL_DRAW);
BTabView* tabView = new BTabView("tabview", B_WIDTH_FROM_LABEL);
fAntialiasingSettings = new AntialiasingSettingsView(
B_TRANSLATE("Antialiasing"));
fDecorSettings = new DecorSettingsView(
B_TRANSLATE("Window Decorator"));
fColorsView = new APRView(B_TRANSLATE("Colors"), B_WILL_DRAW);
tabView->AddTab(fColorsView);
tabView->AddTab(fAntialiasingSettings);
tabView->AddTab(fDecorSettings);
fDefaultsButton->SetEnabled(fColorsView->IsDefaultable()
|| fAntialiasingSettings->IsDefaultable()
|| fDecorSettings->IsDefaultable());
fRevertButton->SetEnabled(false);
AddChild(BGroupLayoutBuilder(B_VERTICAL, 0)
.Add(tabView)
.Add(BSpaceLayoutItem::CreateVerticalStrut(5))
.Add(BGroupLayoutBuilder(B_HORIZONTAL)
.Add(fRevertButton)
.AddGlue()
.Add(fDefaultsButton)
)
.SetInsets(5, 5, 5, 5)
);
}
示例11: dummy
OpenGLView::OpenGLView()
: BView("OpenGLView", 0, NULL)
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
SetLayout(new BGroupLayout(B_VERTICAL));
const float kInset = 10;
BRect dummy(0, 0, 2, 2);
fGLView = new BGLView(dummy, (char*) "gl info", B_FOLLOW_NONE, 0,
BGL_RGB | BGL_DOUBLE);
fGLView->Hide();
AddChild(fGLView);
fGLView->LockGL();
LogoView *logoView = new LogoView(dummy);
BTabView *tabView = new BTabView("tab view", B_WIDTH_FROM_LABEL);
InfoView *infoView = new InfoView();
tabView->AddTab(infoView);
CapabilitiesView *capabilitiesView = new CapabilitiesView();
tabView->AddTab(capabilitiesView);
ExtensionsView *extensionsView = new ExtensionsView();
tabView->AddTab(extensionsView);
fGLView->UnlockGL();
AddChild(BGroupLayoutBuilder(B_VERTICAL)
.Add(logoView)
.Add(BGroupLayoutBuilder(B_HORIZONTAL)
.Add(tabView)
.SetInsets(kInset, kInset, kInset, kInset)
)
);
}
示例12: BMessage
//.........这里部分代码省略.........
BAlert* alert = new BAlert("Error",
B_TRANSLATE("Unable to find the available languages! You can't "
"use this preflet!"),
B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_STOP_ALERT);
alert->Go();
}
// Second list: active languages
fPreferredListView = new LanguageListView("preferred",
B_MULTIPLE_SELECTION_LIST);
BScrollView* scrollViewEnabled = new BScrollView("scroller",
fPreferredListView, B_WILL_DRAW | B_FRAME_EVENTS, false, true);
fPreferredListView->SetInvocationMessage(
new BMessage(kMsgPreferredLanguageInvoked));
fPreferredListView->SetDeleteMessage(
new BMessage(kMsgPreferredLanguageDeleted));
fPreferredListView->SetDragMessage(
new BMessage(kMsgPreferredLanguageDragged));
BLayoutBuilder::Group<>(languageTab)
.AddGroup(B_VERTICAL, spacing)
.Add(new BStringView("", B_TRANSLATE("Available languages")))
.Add(scrollView)
.End()
.AddGroup(B_VERTICAL, spacing)
.Add(new BStringView("", B_TRANSLATE("Preferred languages")))
.Add(scrollViewEnabled)
.End()
.SetInsets(spacing, spacing, spacing, spacing);
BView* countryTab = new BView(B_TRANSLATE("Country"), B_WILL_DRAW);
countryTab->SetLayout(new BGroupLayout(B_VERTICAL, 0));
BListView* listView = new BListView("country", B_SINGLE_SELECTION_LIST);
scrollView = new BScrollView("scroller", listView,
B_WILL_DRAW | B_FRAME_EVENTS, false, true);
listView->SetSelectionMessage(new BMessage(kMsgCountrySelection));
// get all available countries from ICU
// Use DateFormat::getAvailableLocale so we get only the one we can
// use. Maybe check the NumberFormat one and see if there is more.
int32_t localeCount;
const Locale* currentLocale = Locale::getAvailableLocales(localeCount);
for (int index = 0; index < localeCount; index++) {
UnicodeString countryFullName;
BString string;
BStringByteSink sink(&string);
currentLocale[index].getDisplayName(countryFullName);
countryFullName.toUTF8(sink);
LanguageListItem* item
= new LanguageListItem(string, currentLocale[index].getName(),
NULL);
listView->AddItem(item);
if (!strcmp(currentLocale[index].getName(), defaultCountry->Code()))
listView->Select(listView->CountItems() - 1);
}
// TODO: find a real solution intead of this hack
listView->SetExplicitMinSize(
BSize(25 * be_plain_font->Size(), B_SIZE_UNSET));
fFormatView = new FormatView(defaultCountry);
countryTab->AddChild(BLayoutBuilder::Group<>(B_HORIZONTAL, spacing)
.AddGroup(B_VERTICAL, 3)
.Add(scrollView)
.End()
.Add(fFormatView)
.SetInsets(spacing, spacing, spacing, spacing));
listView->ScrollToSelection();
tabView->AddTab(languageTab);
tabView->AddTab(countryTab);
BButton* button = new BButton(B_TRANSLATE("Defaults"),
new BMessage(kMsgDefaults));
fRevertButton = new BButton(B_TRANSLATE("Revert"),
new BMessage(kMsgRevert));
fRevertButton->SetEnabled(false);
BLayoutBuilder::Group<>(this, B_VERTICAL, spacing)
.Add(tabView)
.AddGroup(B_HORIZONTAL, spacing)
.Add(button)
.Add(fRevertButton)
.AddGlue()
.End()
.SetInsets(spacing, spacing, spacing, spacing)
.End();
_UpdatePreferredFromLocaleRoster();
SettingsReverted();
CenterOnScreen();
}
示例13: 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 );
//.........这里部分代码省略.........
示例14: 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)));
//.........这里部分代码省略.........
示例15: 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);
//.........这里部分代码省略.........