本文整理汇总了C++中BScrollView类的典型用法代码示例。如果您正苦于以下问题:C++ BScrollView类的具体用法?C++ BScrollView怎么用?C++ BScrollView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BScrollView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BView
TEnclosuresView::TEnclosuresView(BRect rect, BRect wind_rect)
: BView(rect, "m_enclosures", B_FOLLOW_TOP | B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW),
fFocus(false)
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
BFont font(be_plain_font);
font.SetSize(font.Size() * kPlainFontSizeScale);
SetFont(&font);
fOffset = 12;
BRect r;
r.left = ENCLOSE_TEXT_H + font.StringWidth(
TR("Attachments: ")) + 5;
r.top = ENCLOSE_FIELD_V;
r.right = wind_rect.right - wind_rect.left - B_V_SCROLL_BAR_WIDTH - 9;
r.bottom = Frame().Height() - 8;
fList = new TListView(r, this);
fList->SetInvocationMessage(new BMessage(LIST_INVOKED));
BScrollView *scroll = new BScrollView("", fList, B_FOLLOW_LEFT_RIGHT |
B_FOLLOW_TOP, 0, false, true);
AddChild(scroll);
scroll->ScrollBar(B_VERTICAL)->SetRange(0, 0);
}
示例2: SetViewColor
/*******************************************************
* Setup the main view. Add in all the niffty components
* we have made and get things rolling
*******************************************************/
PrefKeys::PrefKeys():BView("Prefs keys",0){
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
// add the prefs list at the left
list = new BOutlineListView("key list");
BScrollView *sv = new BScrollView("scroll", list, B_WILL_DRAW, false, true, B_PLAIN_BORDER);
sv->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
sv->MakeFocus(false);
BListItem *item = NULL;
for (int32 i=0; i<KeyBind.CountBindings(); i++){
if (KeyBind.GetMessage(KeyBind.GetID(i)) == SPLITTER){
if (item) list->Collapse(item);
list->AddItem(item = new KeyItem(Language.get(KeyBind.GetID(i)), 0, 0, 0, 0, -1));
}else{
list->AddUnder(new KeyItem(Language.get(KeyBind.GetID(i)), KeyBind.GetKey(KeyBind.GetID(i)), KeyBind.GetMod(KeyBind.GetID(i)), KeyBind.GetKeyAlt(KeyBind.GetID(i)), KeyBind.GetModAlt(KeyBind.GetID(i)), i), item);
}
}
if (item) list->Collapse(item);
m_index = -1;
BLayoutBuilder::Group<>(this)
.AddGroup(B_VERTICAL, B_USE_DEFAULT_SPACING)
.SetInsets(B_USE_WINDOW_SPACING)
.Add(sv);
}
示例3: MakeFocus
void HTextView::MakeFocus(bool focused)
{
BScrollView* scrollView = dynamic_cast<BScrollView*>(Parent());
if (scrollView)
scrollView->SetBorderHighlighted(focused);
if (focused)
SelectAll();
BTextView::MakeFocus(focused);
} /* HTextView::MakeFocus */
示例4:
void
MemoryView::MakeFocus(bool isFocused)
{
BScrollView* parent = dynamic_cast<BScrollView*>(Parent());
if (parent != NULL)
parent->SetBorderHighlighted(isFocused);
BView::MakeFocus(isFocused);
}
示例5: BView
/*******************************************************
* Setup the main view. Add in all the niffty components
* we have made and get things rolling
*******************************************************/
KeymapView::KeymapView()
:
BView(BRect(0,0,300,100), "Prefs keys", B_FOLLOW_ALL, B_WILL_DRAW)
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
// add the prefs list at the left
list = new BOutlineListView("key list");
BScrollView *sv = new BScrollView("scroll", list,
B_FOLLOW_ALL_SIDES, false, true, B_PLAIN_BORDER);
sv->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
sv->MakeFocus(false);
BObjectList<BListItem> items(false);
for (int32 i=0; i<gKeyBind->CountKeys(); i++) {
uint32 code = gKeyBind->GetCode(i);
if (code == FABER_SPLITTER)
continue;
BListItem* item = items.ItemAt(items.CountItems()-1);
if (code == FABER_ITEM_END || code == FABER_EOF) {
//if (item != NULL) {
list->Collapse(item);
items.RemoveItemAt(items.CountItems()-1);
//}
continue;
}
if (code == FABER_ITEM_START) {
BListItem* newItem = new KeyItem(gKeyBind->GetLabel(i), 0, 0, 0, 0, -1);
if (items.CountItems() > 0) {
list->AddUnder(newItem, item);
} else {
list->AddItem(newItem);
}
items.AddItem(newItem);
} else if (item != NULL) {
list->AddUnder(new KeyItem(gKeyBind->GetLabel(i),
gKeyBind->GetKey(code),
gKeyBind->GetMod(code), gKeyBind->GetKeyAlt(code),
gKeyBind->GetModAlt(code), i), item);
}
}
m_index = -1;
BLayoutBuilder::Group<>(this, B_VERTICAL, 1)
.Add(sv, 0)
.End();
}
示例6: BView
// Setup the main view. Add in all the niffty components
// we have made and get things rolling
KeymapView::KeymapView()
:
BView(BRect(0,0,300,100), "Prefs keys", B_FOLLOW_ALL, B_WILL_DRAW)
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
// add the prefs list at the left
fListView = new BOutlineListView("key list");
BScrollView* scrollView = new BScrollView("scroll", fListView,
B_FOLLOW_ALL_SIDES, false, true, B_PLAIN_BORDER);
scrollView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
scrollView->MakeFocus(false);
BObjectList<BListItem> items(false);
for (int32 i=0; i < FaberShortcut::CountKeys(); i++) {
KeyBind* bind = FaberShortcut::KeyBindAt(i);
if (bind->itemType == FABER_SPLITTER)
continue;
BListItem* item = items.ItemAt(items.CountItems()-1);
if (item != NULL && (bind->itemType == FABER_ITEM_END
|| bind->itemType == FABER_EOF)) {
fListView->Collapse(item);
items.RemoveItemAt(items.CountItems()-1);
continue;
}
if (bind->itemType == FABER_ITEM_START) {
BListItem* newItem = new KeyItem(bind->label, 0, 0, -1);
if (items.CountItems() > 0)
fListView->AddUnder(newItem, item);
else
fListView->AddItem(newItem);
items.AddItem(newItem);
} else if (item != NULL) {
fListView->AddUnder(new KeyItem(bind->label,
bind->key,
bind->mod, i), item);
}
}
fIndex = -1;
BLayoutBuilder::Group<>(this, B_VERTICAL, 1)
.Add(scrollView, 0)
.End();
}
示例7: RemoveSelf
BScrollView *
DTextView::MakeScrollView(const char *name, bool horizontal, bool vertical)
{
if (Parent())
RemoveSelf();
BScrollView *sv = new BScrollView(name, this, ResizingMode(), 0,
horizontal, vertical);
sv->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
return sv;
}
示例8: BWindow
FreqWindow::FreqWindow(BPoint p) : BWindow(BRect(p.x,p.y,p.x,p.y),Language.get("FREQ_WINDOW"),B_FLOATING_WINDOW_LOOK,B_FLOATING_APP_WINDOW_FEEL, B_NOT_RESIZABLE|B_NOT_ZOOMABLE)
{
BRect r(0,0,180,180);
ResizeTo(r.Width(), r.Height());
MoveBy(-r.Width()/2, -r.Height()/2);
view = new BView(r, NULL, B_FOLLOW_ALL, B_WILL_DRAW);
r.InsetBy(8,8);
r.right = 70;
r.top += 28; // space for the textbox
list = new BListView(r,"Freq list");
BScrollView *sv = new BScrollView("scroll", list, B_FOLLOW_ALL_SIDES, B_WILL_DRAW, false, true, B_PLAIN_BORDER);
sv->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
sv->MakeFocus(false);
view->AddChild(sv);
r.Set(4,8,85,28);
text = new SpinControl(r, NULL, NULL, new BMessage(SET_TEXT), 4000, 96000, 44100, 500);
view->AddChild(text);
r = Bounds();
r.left = r.right - 85;
r.top = r.bottom - 32;
r.bottom -=8;
r.right -= 8;
view->AddChild(new BButton(r, NULL, Language.get("OK"), new BMessage(SET)) );
r.OffsetBy(0,-30);
view->AddChild(new BButton(r, NULL, Language.get("CANCEL"), new BMessage(QUIT)) );
view->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
AddChild(view);
BStringItem *it;
list->AddItem(it = new BStringItem("96000"));
list->AddItem(it = new BStringItem("64000"));
list->AddItem(it = new BStringItem("48000"));
list->AddItem(it = new BStringItem("44100"));
list->AddItem(it = new BStringItem("32000"));
list->AddItem(it = new BStringItem("22050"));
list->AddItem(it = new BStringItem("16000"));
list->AddItem(it = new BStringItem("12500"));
list->AddItem(it = new BStringItem("11025"));
list->AddItem(it = new BStringItem("8000"));
list->SetSelectionMessage(new BMessage(SELECT));
list->SetInvocationMessage(new BMessage(SELECT));
SetList();
m_old = Pool.frequency;
Run();
Show();
}
示例9: BOutlineListView
void
TimeZoneView::_InitView()
{
fZoneList = new BOutlineListView("cityList", B_SINGLE_SELECTION_LIST);
fZoneList->SetSelectionMessage(new BMessage(H_CITY_CHANGED));
fZoneList->SetInvocationMessage(new BMessage(H_SET_TIME_ZONE));
_BuildZoneMenu();
BScrollView* scrollList = new BScrollView("scrollList", fZoneList,
B_FRAME_EVENTS | B_WILL_DRAW, false, true);
scrollList->SetExplicitMinSize(BSize(200, 0));
fCurrent = new TTZDisplay("currentTime", B_TRANSLATE("Current time:"));
fPreview = new TTZDisplay("previewTime", B_TRANSLATE("Preview time:"));
fSetZone = new BButton("setTimeZone", B_TRANSLATE("Set time zone"),
new BMessage(H_SET_TIME_ZONE));
fSetZone->SetEnabled(false);
fSetZone->SetExplicitAlignment(
BAlignment(B_ALIGN_RIGHT, B_ALIGN_BOTTOM));
BStringView* text = new BStringView("clockSetTo",
B_TRANSLATE("Hardware clock set to:"));
fLocalTime = new BRadioButton("localTime",
B_TRANSLATE("Local time (Windows compatible)"), new BMessage(kRTCUpdate));
fGmtTime = new BRadioButton("greenwichMeanTime",
B_TRANSLATE("GMT (UNIX compatible)"), new BMessage(kRTCUpdate));
if (fUseGmtTime)
fGmtTime->SetValue(B_CONTROL_ON);
else
fLocalTime->SetValue(B_CONTROL_ON);
_ShowOrHidePreview();
fOldUseGmtTime = fUseGmtTime;
const float kInset = be_control_look->DefaultItemSpacing();
BLayoutBuilder::Group<>(this)
.Add(scrollList)
.AddGroup(B_VERTICAL, kInset)
.Add(text)
.AddGroup(B_VERTICAL, kInset)
.Add(fLocalTime)
.Add(fGmtTime)
.End()
.AddGlue()
.Add(fCurrent)
.Add(fPreview)
.Add(fSetZone)
.End()
.SetInsets(kInset, kInset, kInset, kInset);
}
示例10: BWindow
AddOnListInfo::AddOnListInfo(BRect frame,BView *mother)
: BWindow(frame,"DontWorryWindow",B_BORDERED_WINDOW_LOOK, B_MODAL_SUBSET_WINDOW_FEEL,B_AVOID_FOCUS ),
_motherMessenger(mother)
{
CPreferences prefs(PREF_FILE_NAME,PREF_PATH_NAME);
BRect listRect = Bounds();
BScrollView *scrollinfo;
BView *scrollHBar;
float scrollHsize;
_lastClass = NULL;
_typeRequested = -1;
// initialisees les images
prefs.Load();
_classesBitmap = prefs.GetBitmap("classes");
_metodesBitmap = prefs.GetBitmap("metodes");
_variablesBitmap = prefs.GetBitmap("variables");
_privateBitmap = prefs.GetBitmap("private");
_protectedBitmap = prefs.GetBitmap("protected");
_virtualBitmap = prefs.GetBitmap("virtual");
listRect.right -= 15;
listRect.bottom -=15;
_listOfInfos = new AddOnListView(listRect);
scrollinfo = new BScrollView("scroll-info",_listOfInfos,B_FOLLOW_ALL_SIDES,0,true,true);
// deplace la scroll bar du bas
scrollHBar = scrollinfo->FindView("_HSB_");
scrollHBar->ResizeBy(-70,0);
scrollHBar->MoveBy(70,0);
scrollHsize = (scrollHBar->Bounds()).Height()+1;
listRect = scrollinfo->Bounds();
_progress = new AddOnProgressView(BRect(2,listRect.bottom-scrollHsize,70,listRect.bottom-1));
scrollinfo->AddChild(_progress);
AddChild(scrollinfo);
// place le focus sur la liste
_listOfInfos->MakeFocus(true);
// envoyer le pointer de la fenetre a la vue pour les deplacement
BMessage moveMsg(MOVE_WINDOW_PTR);
moveMsg.AddPointer(WINDOW_RESULT_PTR,this);
_motherMessenger.SendMessage(&moveMsg);
}
示例11: Bounds
void
TSignatureView::AttachedToWindow()
{
BRect rect = Bounds();
float name_text_length = StringWidth(kNameText);
float sig_text_length = StringWidth(kSigText);
float divide_length;
if (name_text_length > sig_text_length)
divide_length = name_text_length;
else
divide_length = sig_text_length;
rect.InsetBy(8,0);
rect.top+= 8;
fName = new TNameControl(rect, kNameText, new BMessage(NAME_FIELD));
AddChild(fName);
fName->SetDivider(divide_length + 10);
fName->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
rect.OffsetBy(0,fName->Bounds().Height()+5);
rect.bottom = rect.top + kSigHeight;
rect.left = fName->TextView()->Frame().left;
BRect text = rect;
text.OffsetTo(10,0);
fTextView = new TSigTextView(rect, text);
BScrollView *scroller = new BScrollView("SigScroller", fTextView, B_FOLLOW_ALL, 0, false, true);
AddChild(scroller);
scroller->ResizeBy(-1 * scroller->ScrollBar(B_VERTICAL)->Frame().Width() - 9, 0);
scroller->MoveBy(7,0);
/* back up a bit to make room for the label */
rect = scroller->Frame();
BStringView *stringView = new BStringView(rect, "SigLabel", kSigText);
AddChild(stringView);
float tWidth, tHeight;
stringView->GetPreferredSize(&tWidth, &tHeight);
/* the 5 is for the spacer in the TextView */
rect.OffsetBy(-1 *(tWidth) - 5, 0);
rect.right = rect.left + tWidth;
rect.bottom = rect.top + tHeight;
stringView->MoveTo(rect.LeftTop());
stringView->ResizeTo(rect.Width(), rect.Height());
/* Resize the View to the correct height */
scroller->SetResizingMode(B_FOLLOW_NONE);
ResizeTo(Frame().Width(), scroller->Frame().bottom + 8);
scroller->SetResizingMode(B_FOLLOW_ALL);
}
示例12: BView
/*
* BLSettingsBlockedView(BRect canvas);
*
*/
BLSettingsBlockedView::BLSettingsBlockedView(BRect canvas, BLSettings* bls)
: BView(canvas, "blockedview", B_FOLLOW_ALL_SIDES, B_WILL_DRAW), Settings(bls), FilePanel(NULL)
{
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
float Padding = 5.0;
float ButtonHeight = 25.0;
/* Calculate list view position */
BRect rectLVPos = BRect(canvas.left + Padding, canvas.top + Padding, canvas.right - (Padding + B_V_SCROLL_BAR_WIDTH + 3), canvas.bottom - (Padding + 3 + B_H_SCROLL_BAR_HEIGHT + 35));
/* Create and add listview and scrollview*/
ListView = new BListView(rectLVPos, "Blocked");
BScrollView* scrollview = new BScrollView("scroll_blocked", ListView, B_FOLLOW_LEFT | B_FOLLOW_TOP, B_NO_BORDER, true, true);
scrollview->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
AddChild(scrollview);
/* Calculate the size and position of the Add button */
BRect btnAddRect(Bounds().right - (Padding + 60), Bounds().bottom - (Padding + ButtonHeight + 3), scrollview->Bounds().right, Bounds().bottom - (Padding + 3));
/* Create and add the Add button */
btnAdd = new BButton(btnAddRect, "BeLoginSettings_AddButton", "Add", new BMessage(BL_ADD_ITEM));
btnAdd->MakeDefault(true);
btnAdd->SetTarget(this);
AddChild(btnAdd);
/* Calculate the size and position of the Add button */
BRect TextControlRect(ListView->Bounds().left , Bounds().bottom - (Padding + ButtonHeight), Bounds().right - (Padding*2 + btnAdd->Bounds().Width()) , ListView->Bounds().bottom - Padding);
/* Create and add the password Textcontrol */
txtSignature = new BTextControl(TextControlRect, "BeLoginView_signature", "", "", NULL);
txtSignature->SetDivider(0.0);
AddChild(txtSignature);
/* Add blocked to list */
BLBlocked* blocked = Settings->GetBlocked();
for(int i=0;i<blocked->CountItems();i++)
ListView->AddItem(new BStringItem((blocked->ItemAt(i))->String()));
/* Set up messaging */
ListView->SetInvocationMessage(new BMessage(BL_REMOVE_ITEM));
ListView->SetTarget(this);
txtSignature->SetText("application/");
}
示例13: Create_TEdit
BView *
Create_TEdit(BRect rct,int type)
{
BView *bt;
BScrollView *sc;
MyContainLv *bt1;
bool a = false,b = false;
switch(type)
{
case 1: a = false; b =true; break;
case 2: a = true; b = false; break;
case 3: a = b = true; break;
}
BRect kt = BRect(4,4,rct.IntegerWidth() - 4 - ((b) ? 14 : 0),rct.IntegerHeight() - 4 - ((a) ? 14 : 0));
if (bt = new BTextView(kt,"",BRect(5,5,kt.Width()-5,kt.Height()-5),B_FOLLOW_NONE,B_WILL_DRAW))
{
if (sc = new BScrollView("",bt,B_FOLLOW_ALL,0,a,b))
{
if (a)
{
BScrollBar *xi;
if (xi = sc->ScrollBar(B_HORIZONTAL))
{
xi->SetRange(0,0);
}
}
if (bt1 = new MyContainLv(rct))
{
bt1->AddChild(sc);
return(bt1);
}
}
}
return(NULL);
}
示例14: CppLanguage
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);
//.........这里部分代码省略.........
示例15: BMenuBar
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),
//.........这里部分代码省略.........