PatchView::PatchView(BRect rect) : BView(rect, "PatchView", B_FOLLOW_ALL, B_WILL_DRAW), fUnknownDeviceIcon(NULL) { SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); BRect iconRect(0, 0, LARGE_ICON_SIZE - 1, LARGE_ICON_SIZE - 1); fUnknownDeviceIcon = new BBitmap(iconRect, B_RGBA32); if (BIconUtils::GetVectorIcon( UnknownDevice::kVectorIcon, sizeof(UnknownDevice::kVectorIcon), fUnknownDeviceIcon) == B_OK) return; delete fUnknownDeviceIcon; }
BrowseView::BrowseView(BRect r,Tasks *t) : BView(r,NULL,B_FOLLOW_ALL,B_WILL_DRAW) { tasks = t; SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); mainList = NULL; linksList = NULL; horizontalMover = NULL; nextButton = NULL; searchTextView = NULL; containsView = NULL; infoText = NULL; m_DontUpdateURL = false; }
/*------------------------------------------------------------------------------*\ () - \*------------------------------------------------------------------------------*/ BmFilterView::BmFilterView( int32 width, int32 height) : inherited( BRect(0,0,float(width-1),float(height-1)), "Beam_FilterView", B_SINGLE_SELECTION_LIST, false, true) { int32 flags = 0; SetViewColor( B_TRANSPARENT_COLOR); if (ThePrefs->GetBool("StripedListView")) SetStripedBackground( true); AddColumn( new CLVColumn( "Name", 200.0, flags|CLV_SORT_KEYABLE, 50.0)); AddColumn( new CLVColumn( "State", 80.0, flags, 50.0)); SetSortFunction( CLVEasyItem::CompareItems); SetSortKey( COL_KEY); }
NamesView::NamesView(BRect frame) : BListView( frame, "namesList", B_MULTIPLE_SELECTION_LIST, B_FOLLOW_ALL), fActiveTheme (vision_app->ActiveTheme()) { fActiveTheme->ReadLock(); SetFont (&fActiveTheme->FontAt (F_NAMES)); SetViewColor (fActiveTheme->ForegroundAt (C_NAMES_BACKGROUND)); fActiveTheme->ReadUnlock(); fTracking = false; }
KlondikeView::KlondikeView() : BView(BRect(0, 0, STARTING_WINDOW_WIDTH + 10, STARTING_WINDOW_HEIGHT + 10), "KlondikeView", B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_PULSE_NEEDED | B_FULL_UPDATE_ON_RESIZE) { SetViewColor(0, 85, 0); windowWidth = STARTING_WINDOW_WIDTH; windowHeight = STARTING_WINDOW_HEIGHT; _LoadBitmaps(); for (short i = 0; i < CARDS_IN_PLAY; i++) fAllCards[i] = NULL; }
/*=============================================================================================*\ | ShrinkView | +-----------------------------------------------------------------------------------------------+ | Effet: Appelle le constructeur de BView et initialise les valeurs de bases. | | Entre: | | BRect frame: Rectagle de la View lorsqu'elle est agrandit. | | char * pzLabel: Etiquette de la view. | | bool bShrink: True si la view doit etre initialiment reduite, false sinon. | \*=============================================================================================*/ ShrinkView::ShrinkView(BRect frame, const char * pzLabel, bool bShrink, BBitmap * pBmp) : BView::BView(frame, "ShrinkView", B_FOLLOW_NONE, B_WILL_DRAW) { rgb_color color = {192, 192, 192, 0}; SetViewColor(color); m_fFullHeight = frame.Height(); m_bShrink = bShrink; m_bMouseOver = false; strcpy(m_pzLabel, pzLabel); if(m_bShrink) { ResizeTo(Bounds().Width(), 16); } m_pBmp = pBmp; }//End of ShrinkView.
void BListView::_InitObject(list_view_type type) { fListType = type; fFirstSelected = -1; fLastSelected = -1; fAnchorIndex = -1; fSelectMessage = NULL; fScrollView = NULL; fTrack = new track_data; fTrack->try_drag = false; fTrack->item_index = -1; SetViewColor(ui_color(B_LIST_BACKGROUND_COLOR)); SetLowColor(ui_color(B_LIST_BACKGROUND_COLOR)); }
BIconButton::BIconButton(const char* name, const char* label, BMessage* message, BHandler* target, bool customBackground) : BControl(name, label, message, B_WILL_DRAW), fButtonState(0), fNormalBitmap(NULL), fDisabledBitmap(NULL), fClickedBitmap(NULL), fDisabledClickedBitmap(NULL), fTargetCache(target), fCustomBackground(customBackground) { SetTarget(target); SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetViewColor(B_TRANSPARENT_32_BIT); }
void BMenuField::AttachedToWindow() { CALLED(); BView* parent = Parent(); if (parent != NULL) { // inherit the color from parent rgb_color color = parent->ViewColor(); if (color == B_TRANSPARENT_COLOR) color = ui_color(B_PANEL_BACKGROUND_COLOR); SetViewColor(color); SetLowColor(color); } }
AgentDockHeader::AgentDockHeader (BRect frame, const char *name, uint32 resize) : BView ( frame, "AgentDockHeader", resize, B_WILL_DRAW) { SetViewColor (ui_color (B_MENU_BACKGROUND_COLOR)); BRect stringRect (frame); stringRect.left = stringRect.left + 3; stringRect.right = stringRect.right - 24; fHeaderView = new AgentDockHeaderString (stringRect, name); AddChild (fHeaderView); }
CounterView (BRect FrameSize) : BView (FrameSize, "CounterView", B_FOLLOW_ALL_SIDES, B_WILL_DRAW | B_FRAME_EVENTS | B_FULL_UPDATE_ON_RESIZE | B_PULSE_NEEDED), m_MovingDotPoint (10, 20), m_BackingView (FrameSize, "BackingView", B_FOLLOW_ALL_SIDES, B_FULL_UPDATE_ON_RESIZE) { m_CurrentCount = 0; m_StringResizeNeededCount = 10; m_BackingBitmap = NULL; SetViewColor (B_TRANSPARENT_COLOR); FrameResized (FrameSize.right, FrameSize.bottom); // Set m_TextStartPoint. ViewPulseThreadID = spawn_thread (ViewPulserCode, "CounterViewPulser", 80 /* Priority */, this); // Creates but doesn't start. m_InputDeviceMousePntr = find_input_device ("VNC Fake Mouse"); m_InputDeviceKeyboardPntr = find_input_device ("VNC Fake Keyboard"); m_EventTriggerCounter = 0; };
ConfigView::ConfigView(uint32 flags) : BView("EXRTranslator Settings", flags) { SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); BStringView *fTitle = new BStringView("title", B_TRANSLATE("EXR image translator")); fTitle->SetFont(be_bold_font); char version[256]; sprintf(version, B_TRANSLATE("Version %d.%d.%d, %s"), int(B_TRANSLATION_MAJOR_VERSION(EXR_TRANSLATOR_VERSION)), int(B_TRANSLATION_MINOR_VERSION(EXR_TRANSLATOR_VERSION)), int(B_TRANSLATION_REVISION_VERSION(EXR_TRANSLATOR_VERSION)), __DATE__); BStringView *fVersion = new BStringView("version", version); BStringView *fCopyright = new BStringView("copyright", B_UTF8_COPYRIGHT "2008 Haiku Inc."); BStringView *fCopyright2 = new BStringView("copyright2", B_TRANSLATE("Based on OpenEXR (http://www.openexr.com)")); BStringView *fCopyright3 = new BStringView("copyright3", B_UTF8_COPYRIGHT "2006, Industrial Light & Magic,"); BStringView *fCopyright4 = new BStringView("copyright4", B_TRANSLATE("a division of Lucasfilm Entertainment Company Ltd")); // Build the layout BLayoutBuilder::Group<>(this, B_VERTICAL, 7) .SetInsets(5) .Add(fTitle) .Add(fVersion) .AddGlue() .Add(fCopyright) .Add(fCopyright2) .AddGlue() .Add(fCopyright3) .Add(fCopyright4) .AddGlue(); BFont font; GetFont(&font); SetExplicitPreferredSize(BSize(font.Size() * 400 / 12, font.Size() * 200 / 12)); }
ConfigView::ConfigView(BRect frame, Gravity* parent) : BView(frame, B_EMPTY_STRING, B_FOLLOW_ALL_SIDES, B_WILL_DRAW), fParent(parent), fTitleString(new BStringView(B_EMPTY_STRING, "OpenGL Gravity Effect")), fAuthorString(new BStringView(B_EMPTY_STRING, "by Tri-Edge AI")), fCountSlider(new BSlider(B_EMPTY_STRING, "Particle Count: ", new BMessage(kMsgSize), 0, 4, B_HORIZONTAL, B_BLOCK_THUMB, B_NAVIGABLE | B_WILL_DRAW)), fShadeString(new BStringView(B_EMPTY_STRING, "Shade: ")), fShadeList(new BListView(B_EMPTY_STRING, B_SINGLE_SELECTION_LIST, B_WILL_DRAW | B_NAVIGABLE)) { SetLayout(new BGroupLayout(B_HORIZONTAL)); SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); fShadeList->SetSelectionMessage(new BMessage(kMsgShade)); fShadeList->AddItem(new BStringItem("Red")); fShadeList->AddItem(new BStringItem("Green")); fShadeList->AddItem(new BStringItem("Blue")); fShadeList->AddItem(new BStringItem("Orange")); fShadeList->AddItem(new BStringItem("Purple")); fShadeList->AddItem(new BStringItem("White")); fShadeList->AddItem(new BStringItem("Rainbow")); fShadeList->Select(parent->Config.ShadeID); fShadeScroll = new BScrollView(B_EMPTY_STRING, fShadeList, B_WILL_DRAW | B_FRAME_EVENTS, false, true); fCountSlider->SetHashMarks(B_HASH_MARKS_BOTTOM); fCountSlider->SetHashMarkCount(5); fCountSlider->SetLimitLabels("128", "2048"); fCountSlider->SetModificationMessage(new BMessage(kMsgSize)); fCountSlider->SetValue(parent->Config.ParticleCount); AddChild(BLayoutBuilder::Group<>(B_VERTICAL, B_USE_DEFAULT_SPACING) .AddGroup(B_VERTICAL, 0) .Add(fTitleString) .Add(fAuthorString) .End() .Add(fShadeString) .Add(fShadeScroll) .Add(fCountSlider) .SetInsets(B_USE_DEFAULT_SPACING)); }
KnobSwitch::KnobSwitch(BRect frame, const char *name, uint32 resizeMask, uint32 flags) : BControl(frame, name, "", 0, resizeMask, flags), fPressing(false), fCurrState(kUp) { fUpBmap = new BBitmap(BRect(0, 0, kUpBitmapWidth - 1, kUpBitmapHeight - 1), kUpBitmapColorSpace); fMiddleBmap = new BBitmap(BRect(0, 0, kMiddleBitmapWidth - 1, kMiddleBitmapHeight - 1), kMiddleBitmapColorSpace); fDownBmap = new BBitmap(BRect(0, 0, kDownBitmapWidth - 1, kDownBitmapHeight - 1), kDownBitmapColorSpace); fUpBmap->SetBits(kUpBitmapBits, sizeof(kUpBitmapBits), 0, kUpBitmapColorSpace); fMiddleBmap->SetBits(kMiddleBitmapBits, sizeof(kMiddleBitmapBits), 0, kMiddleBitmapColorSpace); fDownBmap->SetBits(kDownBitmapBits, sizeof(kDownBitmapBits), 0, kDownBitmapColorSpace); SetViewColor(B_TRANSPARENT_COLOR); }
void BBox::AttachedToWindow() { BView* parent = Parent(); if (parent != NULL) { // inherit the color from parent rgb_color color = parent->ViewColor(); if (color == B_TRANSPARENT_COLOR) color = ui_color(B_PANEL_BACKGROUND_COLOR); SetViewColor(color); SetLowColor(color); } // The box could have been resized in the mean time fBounds = Bounds(); }
CalcView::CalcView(BRect frame, rgb_color rgbBaseColor, BMessage* settings) : BView(frame, "DeskCalc", B_FOLLOW_ALL_SIDES, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_FRAME_EVENTS), fColumns(5), fRows(4), fBaseColor(rgbBaseColor), fExpressionBGColor((rgb_color){ 0, 0, 0, 255 }), fWidth(1), fHeight(1), fKeypadDescription(strdup(kKeypadDescriptionBasic)), fKeypad(NULL), #ifdef __HAIKU__ fCalcIcon(new BBitmap(BRect(0, 0, 15, 15), 0, B_RGBA32)), #else fCalcIcon(new BBitmap(BRect(0, 0, 15, 15), 0, B_CMAP8)), #endif fPopUpMenu(NULL), fAutoNumlockItem(NULL), fAudioFeedbackItem(NULL), fOptions(new CalcOptions()) { // create expression text view fExpressionTextView = new ExpressionTextView(_ExpressionRect(), this); AddChild(fExpressionTextView); // read data from archive _LoadSettings(settings); // tell the app server not to erase our b/g SetViewColor(B_TRANSPARENT_32_BIT); // parse calculator description _ParseCalcDesc(fKeypadDescription); // colorize based on base color. _Colorize(); // Fetch the calc icon for compact view _FetchAppIcon(fCalcIcon); }
EmptyView(BRect frame, const char *name) : BView(frame, name, B_FOLLOW_ALL, B_WILL_DRAW) { // cache width and height width = frame.Width(); height = frame.Height(); // set view color SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); // add the string view BRect rect((width/2.0) - 15.0, (height/2.0) - 5.0, (width/2.0) + 15.0, (height/2.0) + 5.0); AddChild(new BStringView(rect, "str", "No UI")); }
CMassView::CMassView(BRect frame, const char *name, struct picture* newBitmaps) // constructor : BGLView(frame, name, B_FOLLOW_ALL, B_FULL_UPDATE_ON_RESIZE, BGL_RGB | BGL_DEPTH | BGL_DOUBLE)// call inherited constructor { CELL_SIZE = 63; theBitmaps = newBitmaps; // save a pointer to the bitmaps acceptClicks = false; // and ignore any clicks inGLMode = false; // start off NOT in GL mode xRot = 0.6; yRot = 0.8; zRot = 0.0; // direction vector for rotation scale = 25.0; offset_x = 0.0; offset_y = 0.0; // allows us to move the object around laterally dragMode = dragBall; // start off in dragBall mode Ball_Init(&ball); // initialize the arcball Ball_Place(&ball, qOne, 0.75); // place the arcball (at 3/4 of window size) SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); } // end of CMassView constructor
void UInt32Control :: AttachedToWindow( void) { SetDrawingMode(B_OP_OVER); BTextControl::AttachedToWindow(); rgb_color tempRgbColor; myPrefs->GetPreferredUInt32ControlHighColor(&tempRgbColor); SetHighColor(tempRgbColor); myPrefs->GetPreferredUInt32ControlLowColor(&tempRgbColor); SetLowColor(tempRgbColor); myPrefs->GetPreferredUInt32ControlViewColor(&tempRgbColor); SetViewColor(tempRgbColor); if (mbMakeFocus) { MakeFocus(); } }//end
BackupView::BackupView(BRect frame) : BView(frame, "BackupView", B_FOLLOW_ALL_SIDES, B_WILL_DRAW) { SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetLowColor(ViewColor()); SetHighColor(0, 0, 0); SetLayout(new BGroupLayout(B_VERTICAL)); fBackupList = new BListView(BRect(0, 0, 0, 0), "items", B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL_SIDES); for (uint32 i = 0; i < LOCATION_COUNT; i++) { BackupListItem* item = new BackupListItem(i, gLocationMap[i].name, gLocationMap[i].description); fBackupList->AddItem(item); } // Add total size BStringView* backupSize = new BStringView("total size", "Total size:"); fBackupSizeText = new BStringView("backup size", ""); fBackupSizeText->SetAlignment(B_ALIGN_RIGHT); BButton* button = new BButton(BRect(0, 0, 10, 10), "backup", "Backup!", new BMessage(kMsgDoBackup)); button->MakeDefault(true); BGroupLayout* totalGroup = BLayoutBuilder::Group<>(B_VERTICAL, 0.0) .AddGrid() .Add(backupSize, 0, 0) .Add(fBackupSizeText, 1, 0) .End() .SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING) ; // Attach all of the LayoutGroups to the view AddChild(BLayoutBuilder::Group<>(B_VERTICAL, 0.0) .Add(new BScrollView("backup item list", fBackupList, B_FOLLOW_LEFT | B_FOLLOW_TOP, 0, false, true)) .Add(totalGroup) .Add(button) ); // Refresh the sizes of each item RefreshSizes(); Show(); }
void ViewBuffer::Clear(uint8 attr) { if (LockLooper()) { SetLowColor(GetPaletteEntry(BackgroundColor(attr))); SetViewColor(LowColor()); FillRect(Frame(), B_SOLID_LOW); Sync(); UnlockLooper(); } fCursorX = -1; fCursorY = -1; if (fGlyphGrid) memset(fGlyphGrid, 0, fRows * fColumns * sizeof(uint16)); }
MimeTypeEditor::MimeTypeEditor(BRect rect, DataEditor& editor) : TypeEditorView(rect, B_TRANSLATE("MIME type editor"), B_FOLLOW_LEFT_RIGHT, 0, editor) { SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); fTextControl = new BTextControl(rect.InsetByCopy(5, 5), B_EMPTY_STRING, B_TRANSLATE("MIME type:"), NULL, new BMessage(kMsgValueChanged), B_FOLLOW_ALL); fTextControl->SetDivider(StringWidth(fTextControl->Label()) + 8); float width, height; fTextControl->GetPreferredSize(&width, &height); fTextControl->ResizeTo(rect.Width() - 10, height); ResizeTo(rect.Width(), height + 10); AddChild(fTextControl); }
void TBarView::AttachedToWindow() { BView::AttachedToWindow(); SetViewColor(ui_color(B_MENU_BACKGROUND_COLOR)); SetFont(be_plain_font); fMouseFilter = new BarViewMessageFilter(this); Window()->AddCommonFilter(fMouseFilter); UpdatePlacement(); fTrackingHookData.fTrackingHook = MenuTrackingHook; fTrackingHookData.fTarget = BMessenger(this); fTrackingHookData.fDragMessage = new BMessage(B_REFS_RECEIVED); }
// AttachedToWindow void ColorSlider::AttachedToWindow() { BControl::AttachedToWindow(); SetViewColor(B_TRANSPARENT_32_BIT); if (fBgBitmap && fBgBitmap->Lock()) { fBgView->SetHighColor(ui_color(B_PANEL_BACKGROUND_COLOR)); fBgView->FillRect(Bounds()); fBgBitmap->Unlock(); } else { SetHighColor(ui_color(B_PANEL_BACKGROUND_COLOR)); } Update(2); }
LeftList::LeftList(BRect size) : BListView(size, "LeftList", B_MULTIPLE_SELECTION_LIST, B_FOLLOW_NONE, B_WILL_DRAW) { SetViewColor(255, 255, 255, 0); fVRCDBitmap = BTranslationUtils::GetBitmap('PNG ', "vrcd.png"); fISOBitmap = BTranslationUtils::GetBitmap('PNG ', "iso_16.png"); fAudioBitmap = BTranslationUtils::GetBitmap('PNG ', "audio.png"); fTrackPopUpMenu = new BPopUpMenu("Tracks Popup"); fTrackPopUpMenu->SetRadioMode(false); fTrackPopUpMenu->AddItem(new BMenuItem("Move Up", new BMessage('mvup'))); fTrackPopUpMenu->AddItem(new BMenuItem("Remove", new BMessage('remt'))); fTrackPopUpMenu->AddItem(new BMenuItem("Move Down", new BMessage('mvdn'))); fTrackPopUpMenu->AddItem(new BMenuItem("Play", new BMessage('play'))); }
BComboBox::ChoiceListView::ChoiceListView(BRect frame, BComboBox *parent) : BView(frame, "_choice_list_view_", B_FOLLOW_ALL_SIDES, B_WILL_DRAW | B_NAVIGABLE), fClickLoc(-100, -100) { fParent = parent; GetFontHeight(&fFontHeight); menu_info mi; get_menu_info(&mi); fForeCol = create_color(0, 0, 0); fBackCol = mi.background_color; fSelCol = create_color(144, 144, 144); SetViewColor(B_TRANSPARENT_COLOR); SetHighColor(fForeCol); fTrackingMouseDown = false; fClickTime = 0; }
ProjectStatus::ProjectStatus(BRect frame, const char *txt) : BView(frame, "status", B_FOLLOW_BOTTOM | B_FOLLOW_LEFT, B_WILL_DRAW) { SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)); BFont font(be_plain_font); font.SetSize(10); SetFont(&font); font_height fh; font.GetHeight(&fh); fBaseline = fh.descent + fh.ascent - 3; fOffset = 0; fMsg = txt; }
void BStatusBar::AttachedToWindow() { // resize so that the height fits float width, height; GetPreferredSize(&width, &height); ResizeTo(Bounds().Width(), height); SetViewColor(B_TRANSPARENT_COLOR); AdoptParentColors(); fTextDivider = Bounds().Width(); if ((fInternalFlags & kCustomBarColor) == 0) fBarColor = ui_color(B_STATUS_BAR_COLOR); }
bool OpenWithPoseView::HandleMessageDropped(BMessage* DEBUG_ONLY(message)) { #if DEBUG // in debug mode allow tweaking the colors const rgb_color* color; int32 size; // handle roColour-style color drops if (message->FindData("RGBColor", 'RGBC', (const void**)&color, &size) == B_OK) { SetViewColor(*color); SetLowColor(*color); Invalidate(); return true; } #endif return false; }
NotifyList::NotifyList (BRect _frame) : BListView (_frame, "NotifyList", B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL ), fActiveTheme (vision_app->ActiveTheme()), fLastButton (0), fClickCount (0), fLastClick (0,0), fLastClickTime (0), fMyPopUp (NULL) { fActiveTheme->ReadLock(); SetFont (&fActiveTheme->FontAt (F_WINLIST)); SetViewColor (fActiveTheme->ForegroundAt (C_NOTIFYLIST_BACKGROUND)); fActiveTheme->ReadUnlock(); }