本文整理汇总了C++中BScrollView::SetTarget方法的典型用法代码示例。如果您正苦于以下问题:C++ BScrollView::SetTarget方法的具体用法?C++ BScrollView::SetTarget怎么用?C++ BScrollView::SetTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BScrollView
的用法示例。
在下文中一共展示了BScrollView::SetTarget方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
void
InspectorWindow::_Init()
{
fLanguage = new CppLanguage();
fExpressionInfo = new ExpressionInfo();
fExpressionInfo->AddListener(this);
BScrollView* scrollView;
BMenu* hexMenu = new BMenu("Hex Mode");
BMessage* message = new BMessage(MSG_SET_HEX_MODE);
message->AddInt32("mode", HexModeNone);
BMenuItem* item = new BMenuItem("<None>", message, '0');
hexMenu->AddItem(item);
message = new BMessage(*message);
message->ReplaceInt32("mode", HexMode8BitInt);
item = new BMenuItem("8-bit integer", message, '1');
hexMenu->AddItem(item);
message = new BMessage(*message);
message->ReplaceInt32("mode", HexMode16BitInt);
item = new BMenuItem("16-bit integer", message, '2');
hexMenu->AddItem(item);
message = new BMessage(*message);
message->ReplaceInt32("mode", HexMode32BitInt);
item = new BMenuItem("32-bit integer", message, '3');
hexMenu->AddItem(item);
message = new BMessage(*message);
message->ReplaceInt32("mode", HexMode64BitInt);
item = new BMenuItem("64-bit integer", message, '4');
hexMenu->AddItem(item);
BMenu* endianMenu = new BMenu("Endian Mode");
message = new BMessage(MSG_SET_ENDIAN_MODE);
message->AddInt32("mode", EndianModeLittleEndian);
item = new BMenuItem("Little Endian", message, 'L');
endianMenu->AddItem(item);
message = new BMessage(*message);
message->ReplaceInt32("mode", EndianModeBigEndian);
item = new BMenuItem("Big Endian", message, 'B');
endianMenu->AddItem(item);
BMenu* textMenu = new BMenu("Text Mode");
message = new BMessage(MSG_SET_TEXT_MODE);
message->AddInt32("mode", TextModeNone);
item = new BMenuItem("<None>", message, 'N');
textMenu->AddItem(item);
message = new BMessage(*message);
message->ReplaceInt32("mode", TextModeASCII);
item = new BMenuItem("ASCII", message, 'A');
textMenu->AddItem(item);
BLayoutBuilder::Group<>(this, B_VERTICAL)
.SetInsets(B_USE_DEFAULT_SPACING)
.AddGroup(B_HORIZONTAL)
.Add(fAddressInput = new BTextControl("addrInput",
"Target Address:", "",
new BMessage(MSG_INSPECT_ADDRESS)))
.Add(fPreviousBlockButton = new BButton("navPrevious", "<",
new BMessage(MSG_NAVIGATE_PREVIOUS_BLOCK)))
.Add(fNextBlockButton = new BButton("navNext", ">",
new BMessage(MSG_NAVIGATE_NEXT_BLOCK)))
.End()
.AddGroup(B_HORIZONTAL)
.Add(fHexMode = new BMenuField("hexMode", "Hex Mode:",
hexMenu))
.AddGlue()
.Add(fEndianMode = new BMenuField("endianMode", "Endian Mode:",
endianMenu))
.AddGlue()
.Add(fTextMode = new BMenuField("viewMode", "Text Mode:",
textMenu))
.End()
.Add(scrollView = new BScrollView("memory scroll",
NULL, 0, false, true), 3.0f)
.AddGroup(B_HORIZONTAL)
.Add(fWritableBlockIndicator = new BStringView("writableIndicator",
_GetCurrentWritableIndicator()))
.AddGlue()
.Add(fEditBlockButton = new BButton("editBlock", "Edit",
new BMessage(MSG_EDIT_CURRENT_BLOCK)))
.Add(fCommitBlockButton = new BButton("commitBlock", "Commit",
new BMessage(MSG_COMMIT_MODIFIED_BLOCK)))
.Add(fRevertBlockButton = new BButton("revertBlock", "Revert",
new BMessage(MSG_REVERT_MODIFIED_BLOCK)))
.End()
.End();
fHexMode->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
fEndianMode->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
fTextMode->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
int32 targetEndian = fTeam->GetArchitecture()->IsBigEndian()
? EndianModeBigEndian : EndianModeLittleEndian;
scrollView->SetTarget(fMemoryView = MemoryView::Create(fTeam, this));
fAddressInput->SetTarget(this);
fPreviousBlockButton->SetTarget(this);
fNextBlockButton->SetTarget(this);
fPreviousBlockButton->SetEnabled(false);
//.........这里部分代码省略.........
示例3: BMessage
void
InspectorWindow::_Init()
{
BScrollView* scrollView;
BMenu* hexMenu = new BMenu("Hex Mode");
BMessage* message = new BMessage(MSG_SET_HEX_MODE);
message->AddInt32("mode", HexModeNone);
BMenuItem* item = new BMenuItem("<None>", message, '0');
hexMenu->AddItem(item);
message = new BMessage(*message);
message->ReplaceInt32("mode", HexMode8BitInt);
item = new BMenuItem("8-bit integer", message, '1');
hexMenu->AddItem(item);
message = new BMessage(*message);
message->ReplaceInt32("mode", HexMode16BitInt);
item = new BMenuItem("16-bit integer", message, '2');
hexMenu->AddItem(item);
message = new BMessage(*message);
message->ReplaceInt32("mode", HexMode32BitInt);
item = new BMenuItem("32-bit integer", message, '3');
hexMenu->AddItem(item);
message = new BMessage(*message);
message->ReplaceInt32("mode", HexMode64BitInt);
item = new BMenuItem("64-bit integer", message, '4');
hexMenu->AddItem(item);
BMenu* endianMenu = new BMenu("Endian Mode");
message = new BMessage(MSG_SET_ENDIAN_MODE);
message->AddInt32("mode", EndianModeLittleEndian);
item = new BMenuItem("Little Endian", message, 'L');
endianMenu->AddItem(item);
message = new BMessage(*message);
message->ReplaceInt32("mode", EndianModeBigEndian);
item = new BMenuItem("Big Endian", message, 'B');
endianMenu->AddItem(item);
BMenu* textMenu = new BMenu("Text Mode");
message = new BMessage(MSG_SET_TEXT_MODE);
message->AddInt32("mode", TextModeNone);
item = new BMenuItem("<None>", message, 'N');
textMenu->AddItem(item);
message = new BMessage(*message);
message->ReplaceInt32("mode", TextModeASCII);
item = new BMenuItem("ASCII", message, 'A');
textMenu->AddItem(item);
BLayoutBuilder::Group<>(this, B_VERTICAL)
.SetInsets(4.0f, 4.0f, 4.0f, 4.0f)
.AddGroup(B_HORIZONTAL, 4.0f)
.Add(fAddressInput = new BTextControl("addrInput",
"Target Address:", "",
new BMessage(MSG_INSPECT_ADDRESS)))
.Add(fPreviousBlockButton = new BButton("navPrevious", "<",
new BMessage(MSG_NAVIGATE_PREVIOUS_BLOCK)))
.Add(fNextBlockButton = new BButton("navNext", ">",
new BMessage(MSG_NAVIGATE_NEXT_BLOCK)))
.End()
.AddGroup(B_HORIZONTAL, 4.0f)
.Add(fHexMode = new BMenuField("hexMode", "Hex Mode:",
hexMenu))
.AddGlue()
.Add(fEndianMode = new BMenuField("endianMode", "Endian Mode:",
endianMenu))
.AddGlue()
.Add(fTextMode = new BMenuField("viewMode", "Text Mode:",
textMenu))
.End()
.Add(scrollView = new BScrollView("memory scroll",
NULL, 0, false, true), 3.0f)
.End();
fHexMode->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
fEndianMode->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
fTextMode->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
int32 targetEndian = fTeam->GetArchitecture()->IsBigEndian()
? EndianModeBigEndian : EndianModeLittleEndian;
scrollView->SetTarget(fMemoryView = MemoryView::Create(fTeam));
fAddressInput->SetTarget(this);
fPreviousBlockButton->SetTarget(this);
fNextBlockButton->SetTarget(this);
fPreviousBlockButton->SetEnabled(false);
fNextBlockButton->SetEnabled(false);
hexMenu->SetLabelFromMarked(true);
hexMenu->SetTargetForItems(fMemoryView);
endianMenu->SetLabelFromMarked(true);
endianMenu->SetTargetForItems(fMemoryView);
textMenu->SetLabelFromMarked(true);
textMenu->SetTargetForItems(fMemoryView);
// default to 8-bit format w/ text display
hexMenu->ItemAt(1)->SetMarked(true);
textMenu->ItemAt(1)->SetMarked(true);
if (targetEndian == EndianModeBigEndian)
endianMenu->ItemAt(1)->SetMarked(true);
//.........这里部分代码省略.........