void ArpIntControl::DrawOn(BRect updateRect, BView* view) { BRect cb = ControlBounds(); float textY = cb.top + Prefs().GetInt32(ARP_FULLFONT_Y); if (mDivider > 0) { view->SetHighColor(mViewColor); view->FillRect( BRect(0, cb.top, cb.left, cb.bottom) ); if (mLabel.Length() > 0) { if ( IsFocus() ) view->SetHighColor( Prefs().GetColor(ARP_INT_FGF_C)); else if ( !IsEnabled() ) view->SetHighColor( tint_color(Prefs().GetColor(ARP_INT_FG_C), B_LIGHTEN_1_TINT) ); else view->SetHighColor( Prefs().GetColor(ARP_INT_FG_C) ); view->SetLowColor(mViewColor); view->DrawString( mLabel.String(), BPoint(0, textY) ); } } DrawControlBackgroundOn(cb, view); BPoint drawPt(cb.left + 3, textY); if (IsEnabled() == false) { drawPt.x++; drawPt.y++; } BString16 str; GetValueLabel(Value(), str); SetValueColor(view); view->DrawString( str.String(), drawPt ); }
void ArpIntControl::StartEdit() { // If I've lost the active state while waiting, don't start editing. if ( !Window() || !Window()->IsActive() ) return; StopEdit(false); StopTimer(); BRect b = ControlBounds(); float borderL = b.left; float bottomIndent = 0; float stringIndent = 3; BPoint origin( borderL + 3, b.bottom - bottomIndent - stringIndent ); if (!mTextCtrl) { BFont font; GetFont(&font); mTextCtrl = new ArpInlineTextView(BMessenger(this), "text:edit", &font, origin.x, b.right-2, origin.y); } if (!mTextCtrl) return; SetEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY); mTextCtrl->MoveOver(origin.x, b.right-2, origin.y); mTextCtrl->SetViewColor( Prefs().GetColor(ARP_INT_BGF_C)); mTextCtrl->SetHighColor( Prefs().GetColor(ARP_INT_FGF_C)); BString16 str; GetValueLabel(Value(), str); mTextCtrl->SetText( str.String() ); AddChild(mTextCtrl); }
void CControlSurfaceProbe::GetValueLabel(CString *str) { GetValueLabel(m_eMixerStrip, m_dwStripNum, m_eMixerParam, m_dwParamNum, str); }