本文整理汇总了C++中BGroupView::SetName方法的典型用法代码示例。如果您正苦于以下问题:C++ BGroupView::SetName方法的具体用法?C++ BGroupView::SetName怎么用?C++ BGroupView::SetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BGroupView
的用法示例。
在下文中一共展示了BGroupView::SetName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BMessage
void
TeamWindow::_Init()
{
BScrollView* sourceScrollView;
const float splitSpacing = 3.0f;
BLayoutBuilder::Group<>(this, B_VERTICAL, 0.0f)
.Add(fMenuBar = new BMenuBar("Menu"))
.AddSplit(B_VERTICAL, splitSpacing)
.GetSplitView(&fFunctionSplitView)
.SetInsets(B_USE_SMALL_INSETS)
.Add(fTabView = new BTabView("tab view"), 0.4f)
.AddSplit(B_HORIZONTAL, splitSpacing)
.GetSplitView(&fSourceSplitView)
.AddGroup(B_VERTICAL, B_USE_SMALL_SPACING)
.AddGroup(B_HORIZONTAL, B_USE_SMALL_SPACING)
.Add(fRunButton = new BButton("Run"))
.Add(fStepOverButton = new BButton("Step over"))
.Add(fStepIntoButton = new BButton("Step into"))
.Add(fStepOutButton = new BButton("Step out"))
.AddGlue()
.End()
.Add(fSourcePathView = new BStringView(
"source path",
"Source path unavailable."), 4.0f)
.Add(sourceScrollView = new BScrollView("source scroll",
NULL, 0, true, true), splitSpacing)
.End()
.Add(fLocalsTabView = new BTabView("locals view"))
.End()
.AddSplit(B_VERTICAL, splitSpacing)
.GetSplitView(&fConsoleSplitView)
.SetInsets(0.0)
.Add(fConsoleOutputView = ConsoleOutputView::Create())
.End()
.End();
// add source view
sourceScrollView->SetTarget(fSourceView = SourceView::Create(fTeam, this));
// add threads tab
BSplitView* threadGroup = new BSplitView(B_HORIZONTAL, splitSpacing);
threadGroup->SetName("Threads");
fTabView->AddTab(threadGroup);
BLayoutBuilder::Split<>(threadGroup)
.GetSplitView(&fThreadSplitView)
.Add(fThreadListView = ThreadListView::Create(fTeam, this))
.Add(fStackTraceView = StackTraceView::Create(this));
// add images tab
BSplitView* imagesGroup = new BSplitView(B_HORIZONTAL, splitSpacing);
imagesGroup->SetName("Images");
fTabView->AddTab(imagesGroup);
BLayoutBuilder::Split<>(imagesGroup)
.GetSplitView(&fImageSplitView)
.Add(fImageListView = ImageListView::Create(fTeam, this))
.Add(fImageFunctionsView = ImageFunctionsView::Create(this));
// add breakpoints tab
BGroupView* breakpointsGroup = new BGroupView(B_HORIZONTAL,
B_USE_SMALL_SPACING);
breakpointsGroup->SetName("Breakpoints");
fTabView->AddTab(breakpointsGroup);
BLayoutBuilder::Group<>(breakpointsGroup)
// .SetInsets(0.0f)
.Add(fBreakpointsView = BreakpointsView::Create(fTeam, this));
// add local variables tab
BView* tab = fVariablesView = VariablesView::Create(this);
fLocalsTabView->AddTab(tab);
// add registers tab
tab = fRegistersView = RegistersView::Create(fTeam->GetArchitecture());
fLocalsTabView->AddTab(tab);
fRunButton->SetMessage(new BMessage(MSG_THREAD_RUN));
fStepOverButton->SetMessage(new BMessage(MSG_THREAD_STEP_OVER));
fStepIntoButton->SetMessage(new BMessage(MSG_THREAD_STEP_INTO));
fStepOutButton->SetMessage(new BMessage(MSG_THREAD_STEP_OUT));
fRunButton->SetTarget(this);
fStepOverButton->SetTarget(this);
fStepIntoButton->SetTarget(this);
fStepOutButton->SetTarget(this);
fSourcePathView->SetExplicitMinSize(BSize(100.0, B_SIZE_UNSET));
fSourcePathView->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
BMessageFilter* filter = new(std::nothrow) PathViewMessageFilter(
BMessenger(this));
if (filter != NULL)
fSourcePathView->AddFilter(filter);
// add menus and menu items
BMenu* menu = new BMenu("Team");
fMenuBar->AddItem(menu);
BMenuItem* item = new BMenuItem("Restart", new BMessage(
MSG_TEAM_RESTART_REQUESTED), 'R', B_SHIFT_KEY);
menu->AddItem(item);
item->SetTarget(this);
item = new BMenuItem("Close", new BMessage(B_QUIT_REQUESTED),
//.........这里部分代码省略.........
示例2: BMessage
BSCWindow::BSCWindow()
:
BDirectWindow(kWindowRect, "BeScreenCapture", B_TITLED_WINDOW,
B_ASYNCHRONOUS_CONTROLS|B_AUTO_UPDATE_SIZE_LIMITS),
fController(dynamic_cast<Controller*>(gControllerLooper)),
fCapturing(false)
{
OutputView *outputView
= new OutputView(fController);
AdvancedOptionsView *advancedView
= new AdvancedOptionsView(fController);
fStartStopButton = new BButton("Start", "Start Recording",
new BMessage(kMsgGUIStartCapture));
fStartStopButton->SetTarget(fController);
fStartStopButton->SetExplicitAlignment(BAlignment(B_ALIGN_RIGHT, B_ALIGN_MIDDLE));
fCardLayout = new BCardLayout();
BView* cardsView = new BView("status", 0, fCardLayout);
cardsView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
fCardLayout->AddView(fCamStatus = new CamStatusView("CamStatusView"));
fCamStatus->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE));
BView* statusView = BLayoutBuilder::Group<>()
.SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
.AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
.Add(fStringView = new BStringView("stringview", kEncodingString))
.Add(fStatusBar = new BStatusBar("", ""))
.End()
.View();
statusView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE));
fStatusBar->SetExplicitMinSize(BSize(100, 20));
fCardLayout->AddView(statusView);
BLayoutBuilder::Group<>(this, B_VERTICAL)
.AddGroup(B_VERTICAL, 1)
.SetInsets(B_USE_DEFAULT_SPACING, 1,
B_USE_DEFAULT_SPACING, 1)
.Add(fTabView = new BTabView("Tab View", B_WIDTH_FROM_LABEL))
.AddGroup(B_HORIZONTAL)
.Add(cardsView)
.Add(fStartStopButton)
.End()
.End();
fCardLayout->SetVisibleItem((int32)0);
BGroupView* outputGroup = new BGroupView(B_HORIZONTAL);
outputGroup->SetName("Output");
outputGroup->GroupLayout()->SetInsets(B_USE_DEFAULT_SPACING,
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING);
fTabView->AddTab(outputGroup);
BLayoutBuilder::Group<>(outputGroup)
.Add(outputView);
BGroupView* advancedGroup = new BGroupView(B_HORIZONTAL);
advancedGroup->SetName("Advanced Options");
advancedGroup->GroupLayout()->SetInsets(B_USE_DEFAULT_SPACING,
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING);
fTabView->AddTab(advancedGroup);
BLayoutBuilder::Group<>(advancedGroup)
.Add(advancedView);
if (fController->LockLooper()) {
// controller should watch for these messages
//StartWatching(fController, kMsgGUIStartCapture);
//StartWatching(fController, kMsgGUIStopCapture);
StartWatching(fController, kSelectionWindowClosed);
advancedView->StartWatching(fController, kClipSizeChanged);
//StartWatching(fCamStatus, kMsgControllerCaptureResumed);
// watch Controller for these
fController->StartWatching(this, B_UPDATE_STATUS_BAR);
fController->StartWatching(this, B_RESET_STATUS_BAR);
fController->StartWatching(this, kMsgControllerEncodeStarted);
fController->StartWatching(this, kMsgControllerEncodeProgress);
fController->StartWatching(this, kMsgControllerEncodeFinished);
fController->StartWatching(this, kMsgControllerTargetFrameChanged);
fController->StartWatching(this, kMsgControllerCaptureStarted);
fController->StartWatching(this, kMsgControllerCaptureStopped);
fController->StartWatching(fCamStatus, kMsgControllerCaptureStarted);
fController->StartWatching(fCamStatus, kMsgControllerCaptureStopped);
fController->StartWatching(fCamStatus, kMsgControllerCapturePaused);
fController->StartWatching(fCamStatus, kMsgControllerCaptureResumed);
fController->StartWatching(outputView, kMsgControllerTargetFrameChanged);
fController->StartWatching(outputView, kMsgControllerCodecListUpdated);
fController->UnlockLooper();
}
StartWatching(outputView, kSelectionWindowClosed);
StartWatching(outputView, kClipSizeChanged);
CenterOnScreen();
//.........这里部分代码省略.........
示例3: BMessage
BSCWindow::BSCWindow()
:
BDirectWindow(kWindowRect, "BeScreenCapture", B_TITLED_WINDOW,
B_ASYNCHRONOUS_CONTROLS|B_AUTO_UPDATE_SIZE_LIMITS),
fController(dynamic_cast<Controller*>(gControllerLooper)),
fCapturing(false)
{
OutputView *outputView
= new OutputView(fController);
PostProcessingView *ppView
= new PostProcessingView("Post Processing");
AdvancedOptionsView *advancedView
= new AdvancedOptionsView(fController);
fStartStopButton = new BButton("Start", "Start Recording",
new BMessage(kMsgGUIToggleCapture));
const char *kString = "Encoding movie...";
BLayoutBuilder::Group<>(this, B_VERTICAL)
.AddGroup(B_VERTICAL, B_USE_DEFAULT_SPACING)
.SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
.Add(fTabView = new BTabView("Tab View", B_WIDTH_FROM_LABEL))
.AddGroup(B_HORIZONTAL)
.Add(fCamStatus = new CamStatusView("CamStatusView"))
.Add(fStringView = new BStringView("stringview", kString))
.Add(fStatusBar = new BStatusBar("", ""))
.AddGlue(1)
.Add(fStartStopButton)
.End()
.End();
BGroupView* outputGroup = new BGroupView(B_HORIZONTAL);
outputGroup->SetName("Output");
outputGroup->GroupLayout()->SetInsets(B_USE_DEFAULT_SPACING,
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING);
fTabView->AddTab(outputGroup);
BLayoutBuilder::Group<>(outputGroup)
.Add(outputView);
BGroupView* postGroup = new BGroupView(B_HORIZONTAL);
postGroup->SetName("Post Processing");
postGroup->GroupLayout()->SetInsets(B_USE_DEFAULT_SPACING,
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING);
fTabView->AddTab(postGroup);
BLayoutBuilder::Group<>(postGroup)
.Add(ppView);
BGroupView* advancedGroup = new BGroupView(B_HORIZONTAL);
advancedGroup->SetName("Advanced Options");
advancedGroup->GroupLayout()->SetInsets(B_USE_DEFAULT_SPACING,
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING);
fTabView->AddTab(advancedGroup);
BLayoutBuilder::Group<>(advancedGroup)
.Add(advancedView);
fStatusBar->Hide();
fStringView->Hide();
if (fController->LockLooper()) {
// controller should watch for capture messages
StartWatching(fController, kMsgGUIToggleCapture);
StartWatching(fCamStatus, kAreaSelected);
//StartWatching(fCamStatus, kMsgControllerCaptureResumed);
// watch Controller for these
fController->StartWatching(this, B_UPDATE_STATUS_BAR);
fController->StartWatching(this, B_RESET_STATUS_BAR);
fController->StartWatching(this, kMsgControllerEncodeStarted);
fController->StartWatching(this, kMsgControllerEncodeProgress);
fController->StartWatching(this, kMsgControllerEncodeFinished);
fController->UnlockLooper();
}
StartWatching(fCamStatus, kMsgGUIToggleCapture);
CenterOnScreen();
}
示例4: app
int
main(int argc, char** argv)
{
BApplication app("application/x-vnd.haiku-look");
BWindow* window = new Window(BRect(50, 50, 100, 100),
"Look at these pretty controls!", B_TITLED_WINDOW,
B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS
| B_QUIT_ON_WINDOW_CLOSE);
window->SetLayout(new BGroupLayout(B_HORIZONTAL));
// create some controls
// BListView
BListView* listView = new BListView();
for (int32 i = 0; i < 20; i++) {
BString itemLabel("List item ");
itemLabel << i + 1;
listView->AddItem(new BStringItem(itemLabel.String()));
}
BScrollView* scrollView = new BScrollView("scroller", listView, 0,
true, true);
scrollView->SetExplicitMinSize(BSize(300, 140));
// BColumnListView
BColumnListView* columnListView = new BColumnListView("clv", 0,
B_FANCY_BORDER);
// B_PLAIN_BORDER);
// B_NO_BORDER);
columnListView->AddColumn(new BTitledColumn("Short",
150, 50, 500, B_ALIGN_LEFT), 0);
columnListView->AddColumn(new BTitledColumn("Medium Length",
100, 50, 500, B_ALIGN_CENTER), 1);
columnListView->AddColumn(new BTitledColumn("Some Long Column Name",
130, 50, 500, B_ALIGN_RIGHT), 2);
// for (int32 i = 0; i < 20; i++) {
// BString itemLabel("List Item ");
// itemLabel << i + 1;
// columnListView->AddItem(new BStringItem(itemLabel.String()));
// }
BGridView* controls = new BGridView(kInset, kInset);
BGridLayout* layout = controls->GridLayout();
controls->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED));
int32 row = 0;
add_controls<BButton>(layout, row);
add_controls<BCheckBox>(layout, row);
add_controls<BRadioButton>(layout, row);
add_menu_fields(layout, row);
add_text_controls(layout, row);
add_sliders(layout, row);
add_status_bars(layout, row);
BColorControl* colorControl = new BColorControl(B_ORIGIN, B_CELLS_32x8,
8.0f, "color control");
layout->AddView(colorControl, 0, row, 4);
BTabView* tabView = new BTabView("tab view", B_WIDTH_FROM_WIDEST);
BGroupView* content = new BGroupView(B_VERTICAL, kInset);
BLayoutBuilder::Group<>(content)
.Add(scrollView)
.Add(columnListView)
.Add(controls)
.SetInsets(kInset, kInset, kInset, kInset);
content->SetName("Tab 1");
tabView->AddTab(content);
BView* tab2 = new BView("Tab 2", 0);
tab2->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
tabView->AddTab(tab2);
tabView->AddTab(new BView("Tab 3", 0));
BMenuBar* menuBar = new BMenuBar("menu bar");
BMenu* menu = new BMenu("File");
menu->AddItem(new BMenuItem("Test Open BFilePanel",
new BMessage(MSG_TEST_OPEN_FILE_PANEL)));
menu->AddItem(new BMenuItem("Test Save BFilePanel",
new BMessage(MSG_TEST_SAVE_FILE_PANEL)));
menu->AddItem(new BMenuItem("Click me!", NULL));
menu->AddItem(new BMenuItem("Another option", NULL));
menu->AddSeparatorItem();
menu->AddItem(new BMenuItem("Quit", new BMessage(B_QUIT_REQUESTED)));
menuBar->AddItem(menu);
menu = new BMenu("Edit");
menu->SetEnabled(false);
menu->AddItem(new BMenuItem("Cut", NULL));
menu->AddItem(new BMenuItem("Copy", NULL));
menu->AddSeparatorItem();
menu->AddItem(new BMenuItem("Past", NULL));
menuBar->AddItem(menu);
menu = new BMenu("One Item");
menu->AddItem(new BMenuItem("Only", NULL));
menuBar->AddItem(menu);
menu = new BMenu("Sub Menu");
//.........这里部分代码省略.........