void _BMCMenuBar_::AttachedToWindow() { fMenuField = static_cast<BMenuField*>(Parent()); // Don't cause the KeyMenuBar to change by being attached BMenuBar* menuBar = Window()->KeyMenuBar(); BMenuBar::AttachedToWindow(); Window()->SetKeyMenuBar(menuBar); if (fFixedSize && (Flags() & B_SUPPORTS_LAYOUT) == 0) SetResizingMode(B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP); if (Parent() != NULL) { color_which which = Parent()->LowUIColor(); if (which == B_NO_COLOR) SetLowColor(Parent()->LowColor()); else SetLowUIColor(which); } else SetLowUIColor(B_MENU_BACKGROUND_COLOR); fPreviousWidth = Bounds().Width(); }
BTitleView::BTitleView(BPoseView* view) : BView("BTitleView", B_WILL_DRAW), fPoseView(view), fTitleList(10, true), fHorizontalResizeCursor(B_CURSOR_ID_RESIZE_EAST_WEST), fPreviouslyClickedColumnTitle(0), fPreviousLeftClickTime(0), fTrackingState(NULL) { SetHighUIColor(B_PANEL_BACKGROUND_COLOR); SetLowUIColor(B_PANEL_BACKGROUND_COLOR); #if APP_SERVER_CLEARS_BACKGROUND SetViewUIColor(B_PANEL_BACKGROUND_COLOR); #else SetViewColor(B_TRANSPARENT_COLOR); #endif BFont font(be_plain_font); font.SetSize(floorf(be_plain_font->Size() * 0.75f)); SetFont(&font); font_height height; GetFontHeight(&height); fPreferredHeight = ceilf(height.ascent + height.descent) + 2; Reset(); }
void PowerStatusView::AttachedToWindow() { BView::AttachedToWindow(); AdoptParentColors(); float tint = B_NO_TINT; color_which which = ViewUIColor(&tint); if (which == B_NO_COLOR) SetLowUIColor(B_PANEL_BACKGROUND_COLOR); else SetLowUIColor(which, tint); Update(); }
TabButtonContainer() : BGroupView(B_HORIZONTAL, 0.0) { SetFlags(Flags() | B_WILL_DRAW); SetViewColor(B_TRANSPARENT_COLOR); SetLowUIColor(B_PANEL_BACKGROUND_COLOR); GroupLayout()->SetInsets(0, 6, 0, 0); }
RatingView::RatingView(const char* name) : BView(name, B_WILL_DRAW), fStarBlueBitmap(RSRC_STAR_BLUE), fStarGrayBitmap(RSRC_STAR_GREY), fRating(RATING_MISSING) { SetViewUIColor(B_PANEL_BACKGROUND_COLOR); SetLowUIColor(ViewUIColor()); }
void DataView::AttachedToWindow() { fEditor.StartWatching(this); MakeFocus(true); // this seems to be necessary - if we don't do this here, // the view is sometimes focus, but IsFocus() returns false... SetViewUIColor(B_DOCUMENT_BACKGROUND_COLOR); SetLowUIColor(ViewUIColor()); SetHighUIColor(B_DOCUMENT_TEXT_COLOR); }
/*------------------------------------------------------------------------------*\ ( ) - \*------------------------------------------------------------------------------*/ BmCaption::BmCaption( BRect frame, const char* text) : inherited( frame, NULL, B_FOLLOW_NONE, B_WILL_DRAW) , mText(text) , mHighlight(false) { SetViewColor( B_TRANSPARENT_COLOR); SetLowUIColor( B_PANEL_BACKGROUND_COLOR); BFont captionFont( *be_plain_font); float captionFontSize = be_plain_font->Size(); if (captionFontSize > 12) captionFontSize = 12; captionFont.SetSize( captionFontSize); SetFont( &captionFont); }
void NetPulseView::AttachedToWindow() { BView::AttachedToWindow(); fMessageRunner = new BMessageRunner(BMessenger(this), new BMessage(kMsgUpdate), fUpdateInterval); fModemDownBitmap = new BBitmap( BRect(0, 0, C_MODEM_ICON_WIDTH - 1, C_MODEM_ICON_HEIGHT - 1), B_COLOR_8_BIT); if (fModemDownBitmap != NULL) { fModemDownBitmap->SetBits(kModemDownIconBits, sizeof(kModemDownIconBits), 0, B_COLOR_8_BIT); } fModemUpBitmap = new BBitmap( BRect(0, 0, C_MODEM_ICON_WIDTH - 1, C_MODEM_ICON_HEIGHT - 1), B_COLOR_8_BIT); if (fModemUpBitmap != NULL) { fModemUpBitmap->SetBits(kModemUpIconBits, sizeof(kModemUpIconBits), 0, B_COLOR_8_BIT); } AdoptParentColors(); float tint = B_NO_TINT; color_which which = ViewUIColor(&tint); if (which == B_NO_COLOR) SetLowUIColor(B_PANEL_BACKGROUND_COLOR); else SetLowUIColor(which, tint); UpdateColorTable(); Update(); }
ActivityView::ActivityView(const char* name, const BMessage* settings) #ifdef __HAIKU__ : BView(name, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_FRAME_EVENTS), #else : BView(BRect(0, 0, 300, 200), name, B_FOLLOW_NONE, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_FRAME_EVENTS), #endif fSourcesLock("data sources") { SetLowUIColor(B_PANEL_BACKGROUND_COLOR); _Init(settings); BRect rect(Bounds()); rect.top = rect.bottom - kDraggerSize; rect.left = rect.right - kDraggerSize; BDragger* dragger = new BDragger(rect, this, B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM); AddChild(dragger); }
WrappingTextView::WrappingTextView(BRect a_frame,const char* a_name,int32 a_resize_mode,int32 a_flags) : BTextView(a_frame, a_name, BRect(4.0f,4.0f,a_frame.right-a_frame.left-4.0f,a_frame.bottom-a_frame.top-4.0f), a_resize_mode,a_flags) { m_vertical_offset = 0; m_modified = false; m_modified_disabled = false; m_fixed_width = 0; m_modification_msg = NULL; m_curr_undo_index = 0; m_max_undo_index = 0; m_in_undo_redo = false; m_undo_context = NULL; m_last_key_was_del = false; m_separator_chars = " "; // just a default, will be overridden by Beam-Prefs ResetTextRect(); SetViewUIColor(B_DOCUMENT_BACKGROUND_COLOR); SetLowUIColor(B_DOCUMENT_BACKGROUND_COLOR); SetHighUIColor(B_DOCUMENT_TEXT_COLOR); }
void BListView::_InitObject(list_view_type type) { fListType = type; fFirstSelected = -1; fLastSelected = -1; fAnchorIndex = -1; fSelectMessage = NULL; fScrollView = NULL; fTrack = new track_data; fTrack->drag_start = B_ORIGIN; fTrack->item_index = -1; fTrack->was_selected = false; fTrack->try_drag = false; fTrack->is_dragging = false; fTrack->last_click_time = 0; SetViewUIColor(B_LIST_BACKGROUND_COLOR); SetLowUIColor(B_LIST_BACKGROUND_COLOR); }
void NetworkStatusView::AttachedToWindow() { BView::AttachedToWindow(); if (Parent() != NULL) { if ((Parent()->Flags() & B_DRAW_ON_CHILDREN) != 0) SetViewColor(B_TRANSPARENT_COLOR); else AdoptParentColors(); } else SetViewUIColor(B_PANEL_BACKGROUND_COLOR); if (ViewUIColor() != B_NO_COLOR) SetLowUIColor(ViewUIColor()); else SetLowColor(ViewColor()); start_watching_network( B_WATCH_NETWORK_INTERFACE_CHANGES | B_WATCH_NETWORK_LINK_CHANGES, this); _Update(); }