/******************************************************* * 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); }
/******************************************************* * 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(); }
// 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(); }
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; }
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(); }
/* * 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/"); }
ProjectSettingsWindow::ProjectSettingsWindow(BRect frame, Project* project) : BWindow(frame, TR("Project settings"), B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_NOT_RESIZABLE | B_AUTO_UPDATE_SIZE_LIMITS), fProject(project), fDirty(false) { if (fProject == NULL) debugger("Bad project given to Project Settings window"); fRefFilter = new TypedRefFilter(NULL, B_DIRECTORY_NODE); BMessenger messenger(this); entry_ref projectFolderRef; BEntry(fProject->GetPath().GetFolder()).GetRef(&projectFolderRef); fFilePanel = new BFilePanel(B_OPEN_PANEL, &messenger, &projectFolderRef, B_DIRECTORY_NODE, true, new BMessage(M_ADD_PATH), fRefFilter); fAutolock = new BAutolock(fProject); AddCommonFilter(new EscapeCancelFilter()); fTargetText = new AutoTextControl("targetname", TR("Target name:"), fProject->GetTargetName(), new BMessage(M_TARGET_NAME_CHANGED)); BPopUpMenu* targetTypeMenu = new BPopUpMenu(TR("Target type")); targetTypeMenu->AddItem(new BMenuItem(TR("Application"), new BMessage(M_SET_TARGET_TYPE))); targetTypeMenu->AddItem(new BMenuItem(TR("Shared library"), new BMessage(M_SET_TARGET_TYPE))); targetTypeMenu->AddItem(new BMenuItem(TR("Static library"), new BMessage(M_SET_TARGET_TYPE))); targetTypeMenu->AddItem(new BMenuItem(TR("Device driver"), new BMessage(M_SET_TARGET_TYPE))); fTypeField = new BMenuField("type", TR("Target type:"), targetTypeMenu); SetToolTip(fTypeField, TR("The kind of program you want to build")); BMenuItem* item = targetTypeMenu->ItemAt(fProject->TargetType()); if (item != NULL) item->SetMarked(true); fIncludeList = new IncludeList(fProject->GetPath().GetFolder()); SetToolTip(fIncludeList, TR("The folders you want Paladin to search for header files")); BScrollView* includeScrollView = new BScrollView("includescrollview", fIncludeList, B_WILL_DRAW, true, true); includeScrollView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); includeScrollView->SetExplicitMinSize( BSize(be_plain_font->StringWidth("M") * 34.0f, be_plain_font->StringWidth("M") * 12.0f)); for (int32 i = 0; i < fProject->CountLocalIncludes(); i++) { fIncludeList->AddItem(new BStringItem( fProject->LocalIncludeAt(i).Relative().String())); } float buttonWidth = be_plain_font->StringWidth("+") * 2.0f + 3.0f; BButton* addButton = new BButton("addbutton", TR("+"), new BMessage(M_SHOW_ADD_PATH)); addButton->SetExplicitSize(BSize(buttonWidth, buttonWidth)); addButton->SetToolTip(TR("Add a file to the include path list")); BButton* removeButton = new BButton("removebutton", TR("−"), new BMessage(M_REMOVE_PATH)); removeButton->SetExplicitSize(BSize(buttonWidth, buttonWidth)); removeButton->SetToolTip(TR("Remove the selected path")); // general tab fGeneralView = new BView(TR("General"), B_WILL_DRAW); fGeneralView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); BLayoutBuilder::Group<>(fGeneralView, B_VERTICAL, 0) .AddGrid(B_USE_DEFAULT_SPACING, B_USE_SMALL_SPACING) .Add(fTargetText->CreateLabelLayoutItem(), 0, 0) .Add(fTargetText->CreateTextViewLayoutItem(), 1, 0) .Add(fTypeField->CreateLabelLayoutItem(), 0, 1) .AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING, 1, 1) .Add(fTypeField->CreateMenuBarLayoutItem()) .AddGlue() .End() .End() .AddStrut(B_USE_DEFAULT_SPACING) .AddGroup(B_VERTICAL, 2.0f) .Add(new BStringView("include paths", TR("Include paths:"))) .AddGroup(B_HORIZONTAL, B_USE_SMALL_SPACING) .Add(includeScrollView) .AddGroup(B_VERTICAL, B_USE_SMALL_SPACING) .Add(addButton) .Add(removeButton) .AddGlue() .End() .End() .End() .SetInsets(B_USE_DEFAULT_SPACING) .End(); BPopUpMenu* optimizationMenu = new BPopUpMenu(TR("Optimization")); optimizationMenu->AddItem(new BMenuItem(TR("None"), new BMessage(M_SET_OP_VALUE))); optimizationMenu->AddItem(new BMenuItem(TR("Some"), new BMessage(M_SET_OP_VALUE))); optimizationMenu->AddItem(new BMenuItem(TR("More"), new BMessage(M_SET_OP_VALUE))); optimizationMenu->AddItem(new BMenuItem(TR("Full"), new BMessage(M_SET_OP_VALUE))); fOpField = new BMenuField("optimize", TR("Optimize:"), optimizationMenu); SetToolTip(fOpField, TR("Compiler optimization level. " "Disabled when debugging info is checked.")); item = optimizationMenu->ItemAt(fProject->OpLevel()); if (item != NULL) item->SetMarked(true); fOpSizeBox = new BCheckBox("opsizebox", TR("Optimize for size over speed"), new BMessage(M_TOGGLE_OPSIZE)); if (fProject->OpForSize()) fOpSizeBox->SetValue(B_CONTROL_ON); if (fProject->Debug()) { fOpField->SetEnabled(false); fOpSizeBox->SetEnabled(false); } fDebugBox = new BCheckBox("debugbox", TR("Build debugging information"), new BMessage(M_TOGGLE_DEBUG)); SetToolTip(fDebugBox, TR("Check this if you want to use your program in a debugger " "during development. You'll want to rebuild your project " "after change this.")); if (fProject->Debug()) fDebugBox->SetValue(B_CONTROL_ON); fProfileBox = new BCheckBox("profilebox", TR("Build profiling information"), new BMessage(M_TOGGLE_PROFILE)); SetToolTip(fProfileBox, TR("Check this if you want to use your program " "with gprof or bprof for profiling.")); if (fProject->Profiling()) fProfileBox->SetValue(B_CONTROL_ON); fCompileText = new AutoTextControl("extracc", "Extra compiler options:", fProject->ExtraCompilerOptions(), new BMessage(M_CCOPTS_CHANGED)); SetToolTip(fCompileText, TR("Extra GCC flags you wish included when each file is compiled.")); fLinkText = new AutoTextControl("extrald" ,TR("Extra linker options:"), fProject->ExtraLinkerOptions(), new BMessage(M_LDOPTS_CHANGED)); SetToolTip(fLinkText, TR("Extra GCC linker flags you wish included when your project " "is linked.")); // build tab fBuildView = new BView("Build", B_WILL_DRAW); fBuildView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); BLayoutBuilder::Group<>(fBuildView, B_VERTICAL) .AddGrid(B_USE_DEFAULT_SPACING, B_USE_SMALL_SPACING) .Add(fOpField->CreateLabelLayoutItem(), 0, 0) .AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING, 1, 0) .Add(fOpField->CreateMenuBarLayoutItem()) .AddGlue() .End() .AddGroup(B_VERTICAL, 0.0f, 1, 2) .Add(fOpSizeBox) .AddStrut(B_USE_SMALL_SPACING) .Add(fDebugBox) .Add(fProfileBox) .End() .End() .AddGlue() .AddGroup(B_VERTICAL, 0) .Add(fCompileText->CreateLabelLayoutItem()) .Add(fCompileText->CreateTextViewLayoutItem()) .End() .AddGroup(B_VERTICAL, 0) .Add(fLinkText->CreateLabelLayoutItem()) .Add(fLinkText->CreateTextViewLayoutItem()) .End() .SetInsets(B_USE_DEFAULT_SPACING) .End(); fTabView = new BTabView("tabview", B_WIDTH_FROM_LABEL); fTabView->SetBorder(B_NO_BORDER); fTabView->AddTab(fGeneralView); fTabView->AddTab(fBuildView); fTabView->Select(0L); BLayoutBuilder::Group<>(this, B_VERTICAL, 0) .AddStrut(B_USE_SMALL_SPACING) .Add(fTabView) .End(); targetTypeMenu->SetTargetForItems(this); optimizationMenu->SetTargetForItems(this); fIncludeList->Select(0); fTargetText->MakeFocus(true); }
ProjectSettingsWindow::ProjectSettingsWindow(BRect frame, Project *proj) : DWindow(frame,TR("Project Settings"),B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_NOT_H_RESIZABLE), fProject(proj), fDirty(false) { if (!fProject) debugger("Bad project given to Project Settings window"); fRefFilter = new TypedRefFilter(NULL,B_DIRECTORY_NODE); BMessenger msgr(this); entry_ref projfolder_ref; BEntry(fProject->GetPath().GetFolder()).GetRef(&projfolder_ref); fFilePanel = new BFilePanel(B_OPEN_PANEL,&msgr,&projfolder_ref,B_DIRECTORY_NODE, true, new BMessage(M_ADD_PATH),fRefFilter); fAutolock = new BAutolock(fProject); AddCommonFilter(new EscapeCancelFilter()); BView *top = GetBackgroundView(); BRect r(Bounds()); fTabView = new BTabView(r,"tabview"); top->AddChild(fTabView); r.InsetBy(5,5); r.bottom -= fTabView->TabHeight(); BRect bounds = r.OffsetToCopy(0,0); fGeneralView = new BView(r,TR("General"),B_FOLLOW_ALL,B_WILL_DRAW); fGeneralView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); fTabView->AddTab(fGeneralView); r.right -= 10.0; fTargetText = new AutoTextControl(r,"targetname",TR("Target Name:"), fProject->GetTargetName(), new BMessage(M_TARGET_NAME_CHANGED), B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP); fGeneralView->AddChild(fTargetText); float pwidth, pheight; fTargetText->GetPreferredSize(&pwidth, &pheight); fTargetText->ResizeTo(r.Width(),pheight); r.bottom = r.top + pheight; fTargetText->SetDivider(fTargetText->StringWidth(TR("Target Name:")) + 5.0); r = fTargetText->Frame(); r.OffsetBy(0,r.Height() + 10.0); BMenu *menu = new BMenu(TR("Target Type")); menu->AddItem(new BMenuItem(TR("Application"),new BMessage(M_SET_TARGET_TYPE))); menu->AddItem(new BMenuItem(TR("Shared Library"),new BMessage(M_SET_TARGET_TYPE))); menu->AddItem(new BMenuItem(TR("Static Library"),new BMessage(M_SET_TARGET_TYPE))); menu->AddItem(new BMenuItem(TR("Device Driver"),new BMessage(M_SET_TARGET_TYPE))); r.right = (bounds.right - 5.0) / 2.0; r.bottom = r.top + 25; fTypeField = new BMenuField(r,"type",TR("Target Type:"),menu); fGeneralView->AddChild(fTypeField); fTypeField->SetDivider(fTypeField->StringWidth(TR("Target Type:")) + 5.0); SetToolTip(fTypeField,TR("The kind of program you want to build")); menu->SetTargetForItems(this); menu->SetLabelFromMarked(true); BMenuItem *item = menu->ItemAt(fProject->TargetType()); if (item) item->SetMarked(true); r.OffsetBy(0,r.Height() + 10.0); BStringView *label = new BStringView(r,"label",TR("Include Paths:")); label->ResizeToPreferred(); fGeneralView->AddChild(label); r = label->Frame(); r.OffsetBy(0,r.Height() + 5.0); // We create a button now so that the list expands to fill the entire window // while leaving space for the two buttons at the bottom. Note that we do not // actually add the button to the window until later to preserve proper // keyboard navigation order BButton *add = new BButton(BRect(0,0,1,1),"addbutton",TR("Add…"), new BMessage(M_SHOW_ADD_PATH), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM); add->ResizeToPreferred(); add->MoveTo(5,fGeneralView->Bounds().bottom - 10.0 - add->Frame().Height()); r.right = bounds.right - 10.0 - B_V_SCROLL_BAR_WIDTH; r.bottom = add->Frame().top - 10.0 - B_H_SCROLL_BAR_HEIGHT; fIncludeList = new IncludeList(r,fProject->GetPath().GetFolder()); BScrollView *scrollView = new BScrollView("scrollview",fIncludeList, B_FOLLOW_ALL,0, true, true); scrollView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); fGeneralView->AddChild(scrollView); float width = 0.0; for (int32 i = 0; i < fProject->CountLocalIncludes(); i++) { BStringItem *item = new BStringItem(fProject->LocalIncludeAt(i).Relative().String()); float strwidth = fIncludeList->StringWidth(item->Text()); width = MAX(width, strwidth); fIncludeList->AddItem(item); } if (width > fIncludeList->Bounds().Width()) { BScrollBar *hbar = scrollView->ScrollBar(B_HORIZONTAL); hbar->SetRange(0.0, width - fIncludeList->Bounds().Width()); } SetToolTip(fIncludeList,TR("The folders you want Paladin to search for header files")); fGeneralView->AddChild(add); BButton *remove = new BButton(BRect(0,0,1,1),"removebutton",TR("Remove"), new BMessage(M_REMOVE_PATH), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM); remove->ResizeToPreferred(); remove->MoveTo(add->Frame().right + 10.0, add->Frame().top); fGeneralView->AddChild(remove); r = bounds; fBuildView = new BView(bounds.OffsetByCopy(5,5),TR("Build"),B_FOLLOW_ALL,B_WILL_DRAW); fBuildView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); fTabView->AddTab(fBuildView); menu = new BMenu(TR("Optimization")); menu->AddItem(new BMenuItem(TR("None"),new BMessage(M_SET_OP_VALUE))); menu->AddItem(new BMenuItem(TR("Some"),new BMessage(M_SET_OP_VALUE))); menu->AddItem(new BMenuItem(TR("More"),new BMessage(M_SET_OP_VALUE))); menu->AddItem(new BMenuItem(TR("Full"),new BMessage(M_SET_OP_VALUE))); r.right = (bounds.right - 5.0) / 2.0; r.bottom = r.top + 25; fOpField = new BMenuField(r,"optimize",TR("Optimize"),menu); fBuildView->AddChild(fOpField); fOpField->SetDivider(fOpField->StringWidth(TR("Optimize")) + 5.0); SetToolTip(fOpField,TR("Compiler optimization level. Disabled when debugging info is checked.")); menu->SetTargetForItems(this); menu->SetLabelFromMarked(true); item = menu->ItemAt(fProject->OpLevel()); if (item) item->SetMarked(true); r.right = bounds.right - 10.0; r.OffsetTo(5, fOpField->Frame().bottom + 5); fOpSizeBox = new BCheckBox(r,"opsizebox",TR("Optimize for size over speed"), new BMessage(M_TOGGLE_OPSIZE)); fOpSizeBox->ResizeToPreferred(); fBuildView->AddChild(fOpSizeBox); r = fOpSizeBox->Frame(); if (fProject->OpForSize()) fOpSizeBox->SetValue(B_CONTROL_ON); if (fProject->Debug()) { fOpField->SetEnabled(false); fOpSizeBox->SetEnabled(false); } r.OffsetBy(0, r.Height() + 10); fDebugBox = new BCheckBox(r,"debugbox",TR("Build debugging information"), new BMessage(M_TOGGLE_DEBUG)); fDebugBox->ResizeToPreferred(); if (fProject->Debug()) fDebugBox->SetValue(B_CONTROL_ON); fBuildView->AddChild(fDebugBox); SetToolTip(fDebugBox,TR("Check this if you want to use your program in a debugger during development." "You'll want to rebuild your project after change this.")); r.OffsetBy(0, r.Height()); fProfileBox = new BCheckBox(r,"profilebox",TR("Build profiling information"), new BMessage(M_TOGGLE_PROFILE)); fProfileBox->ResizeToPreferred(); if (fProject->Profiling()) fProfileBox->SetValue(B_CONTROL_ON); fBuildView->AddChild(fProfileBox); SetToolTip(fProfileBox,TR("Check this if you want to use your program " "with gprof or bprof for profiling.")); r.OffsetBy(0, r.Height() + 10.0); r.right = bounds.right - 10.0; fCompileText = new AutoTextControl(r,"extracc","Extra Compiler Options:", fProject->ExtraCompilerOptions(), new BMessage(M_CCOPTS_CHANGED), B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP); fBuildView->AddChild(fCompileText); fCompileText->SetDivider(fCompileText->StringWidth(fCompileText->Label()) + 5.0); SetToolTip(fCompileText,TR("Extra GCC flags you wish included when each file is compiled.")); r = fCompileText->Frame(); r.OffsetBy(0,r.Height() + 10); fLinkText = new AutoTextControl(r,"extrald",TR("Extra Linker Options:"), fProject->ExtraLinkerOptions(), new BMessage(M_LDOPTS_CHANGED), B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP); fBuildView->AddChild(fLinkText); fLinkText->SetDivider(fCompileText->Divider()); SetToolTip(fLinkText,TR("Extra GCC linker flags you wish included when your project is linked.")); fTabView->Select(0L); fBuildView->ResizeTo(fGeneralView->Bounds().Width(),fGeneralView->Bounds().Height()); fTargetText->MakeFocus(true); }