//------------------------------------------------------------------------ CKickButton::CKickButton (const CKickButton& v) : CControl (v) , offset (v.offset) { setHeightOfOneImage (v.heightOfOneImage); setWantsFocus (true); }
//------------------------------------------------------------------------ CKickButton::CKickButton (const CRect& size, CControlListener* listener, int32_t tag, CCoord heightOfOneImage, CBitmap* background, const CPoint& offset) : CControl (size, listener, tag, background) , offset (offset) { setHeightOfOneImage (heightOfOneImage); setWantsFocus (true); }
//------------------------------------------------------------------------ CMovieButton::CMovieButton (const CMovieButton& v) : CControl (v) , offset (v.offset) , buttonState (v.buttonState) { setHeightOfOneImage (v.heightOfOneImage); setWantsFocus (true); }
//------------------------------------------------------------------------ CTextEdit::CTextEdit (const CTextEdit& v) : CTextLabel (v) , platformControl (0) , textToValue (v.textToValue) , textToValueUserData (v.textToValueUserData) , immediateTextChange (v.immediateTextChange) { setWantsFocus (true); }
//------------------------------------------------------------------------ CTextEdit::CTextEdit (const CRect& size, CControlListener* listener, int32_t tag, UTF8StringPtr txt, CBitmap* background, const int32_t style) : CTextLabel (size, txt, background, style) , platformControl (0) , textToValue (0) , textToValueUserData (0) , immediateTextChange (false) { this->listener = listener; this->tag = tag; setWantsFocus (true); }
cBitmapFontEditable::cBitmapFontEditable(const CRect &size, CControlListener *listener, long tag, CBitmap *background, int spacing, int characters) : cBitmapFont(size, listener, tag, background, spacing, characters) { setWantsFocus(true); #ifdef MAC pluginResID = CurResFile(); #endif setMouseEnabled(true); setMouseableArea(size); memset(m_edit_buffer, 0x0, sizeof(char) * MAX_EDIT_CHARS); m_editing = false; m_edit_index = 0; }
//----------------------------------------------------------------------------- CSegmentButton::CSegmentButton (const CRect& size, IControlListener* listener, int32_t tag) : CControl (size, listener, tag) , textColor (kBlackCColor) , textColorHighlighted (kWhiteCColor) , frameColor (kBlackCColor) , textAlignment (kCenterText) , textMargin (0) , font (kNormalFont) , roundRadius (5) , frameWidth (1) , style (kHorizontal) { setWantsFocus (true); }
//------------------------------------------------------------------------ COptionMenu::COptionMenu () : CParamDisplay (CRect (0, 0, 0, 0)) , currentIndex (-1) , bgWhenClick (0) , lastButton (0) , nbItemsPerColumn (-1) , lastResult (-1) , prefixNumbers (0) , lastMenu (0) , inPopup (false) { menuItems = new CMenuItemList; setWantsFocus (true); }
//------------------------------------------------------------------------ CCheckBox::CCheckBox (const CCheckBox& checkbox) : CControl (checkbox) , title (0) , style (checkbox.style) , font (0) , fontColor (checkbox.fontColor) , hilight (false) { setTitle (checkbox.title); setFont (checkbox.font); setBoxFillColor (checkbox.boxFillColor); setBoxFrameColor (checkbox.boxFrameColor); setCheckMarkColor (checkbox.checkMarkColor); font->remember (); setWantsFocus (true); }
//------------------------------------------------------------------------ COptionMenu::COptionMenu (const COptionMenu& v) : CParamDisplay (v) , currentIndex (-1) , bgWhenClick (v.bgWhenClick) , lastButton (0) , nbItemsPerColumn (v.nbItemsPerColumn) , lastResult (-1) , prefixNumbers (0) , lastMenu (0) , menuItems (new CMenuItemList (*v.menuItems)) , inPopup (false) { if (bgWhenClick) bgWhenClick->remember (); setWantsFocus (true); }
//------------------------------------------------------------------------ //------------------------------------------------------------------------ CCheckBox::CCheckBox (const CRect& size, CControlListener* listener, int32_t tag, UTF8StringPtr title, CBitmap* bitmap, int32_t style) : CControl (size, listener, tag, bitmap) , title (0) , style (style) , font (0) , fontColor (kWhiteCColor) , hilight (false) { setTitle (title); setFont (kSystemFont); setBoxFillColor (kWhiteCColor); setBoxFrameColor (kBlackCColor); setCheckMarkColor (kRedCColor); font->remember (); setWantsFocus (true); if (style & kAutoSizeToFit) sizeToFit (); }
//------------------------------------------------------------------------ CSlider::CSlider (const CRect &rect, IControlListener* listener, int32_t tag, int32_t iMinPos, int32_t iMaxPos, CBitmap* handle, CBitmap* background, const CPoint& offset, const int32_t style) : CControl (rect, listener, tag, background) , offset (offset) , pHandle (handle) , style (style) , minPos (iMinPos) , mode (kFreeClickMode) , drawStyle (0) { setDrawTransparentHandle (true); if (pHandle) { pHandle->remember (); widthOfSlider = pHandle->getWidth (); heightOfSlider = pHandle->getHeight (); } else { widthOfSlider = 1; heightOfSlider = 1; } widthControl = getViewSize ().getWidth (); heightControl = getViewSize ().getHeight (); if (style & kHorizontal) { minPos = iMinPos - getViewSize ().left; rangeHandle = (CCoord)iMaxPos - iMinPos; } else { minPos = iMinPos - getViewSize ().top; rangeHandle = (CCoord)iMaxPos - iMinPos; } CPoint p (0, 0); setOffsetHandle (p); zoomFactor = 10.f; setWantsFocus (true); }
//------------------------------------------------------------------------ COptionMenu::COptionMenu (const CRect& size, IControlListener* listener, int32_t tag, CBitmap* background, CBitmap* bgWhenClick, const int32_t style) : CParamDisplay (size, background, style) , bgWhenClick (bgWhenClick) , nbItemsPerColumn (-1) , prefixNumbers (0) , inPopup (false) { this->listener = listener; this->tag = tag; currentIndex = -1; lastButton = kRButton; lastResult = -1; lastMenu = 0; if (bgWhenClick) bgWhenClick->remember (); menuItems = new CMenuItemList; setWantsFocus (true); }
SystemView::SystemView( const CRect& size, Editor* editor) : CViewContainer( size, editor->getChildFrame(), NULL ), editor_( editor ) { setMouseableArea( size ); setTransparency( false ); setWantsFocus( true ); setAutosizeFlags( kAutosizeAll ); #ifdef _RT_AUDIO CRect rcAudioOutPanel( 77, 66, 477, 270 ); CRect rcMidiInPanel( 487, 66, 687, 270 ); audioOutPanel_ = new AudioOutPanel( rcAudioOutPanel, editor_ ); addView( audioOutPanel_ ); midiInPanel_ = new MidiInPanel( rcMidiInPanel, editor_ ); addView( midiInPanel_ ); setColors(); #endif }
SelectBox::SelectBox( const CRect& rcSize, CControlListener* listener, long tag ) : CControl (rcSize, listener, tag ), scrollbar_( NULL ), state_( 0 ), dropDir_( Dropdown ), font_( kSystemFont ), index_( 0 ), indexSel_( 0 ), indexSaved_( 0 ), maxVisible_( 3 ), scrollOffset_( 0 ) { calcMetrics(); CRect rcScrollbar( size.right-WidthButton, size.bottom, size.right, size.bottom+150 ); scrollbar_ = new CScrollbar( rcScrollbar, this, 0, CScrollbar::kVertical, CRect( 0,0,0,0 )); setWantsFocus( true ); setBackgroundColor( kWhiteCColor ); setFrameColor( kBlackCColor ); setTextColor( kBlackCColor ); setSelectionColor( colOrange ); }
//------------------------------------------------------------------------ //------------------------------------------------------------------------ //------------------------------------------------------------------------ CTextButton::CTextButton (const CRect& size, CControlListener* listener, int32_t tag, UTF8StringPtr title, Style style) : CControl (size, listener, tag, 0) , title (title) , font (0) , _path (0) , frameWidth (1.) , roundRadius (6.) , textMargin (0.) , iconPosition (kLeft) , horiTxtAlign (kCenterText) , style (style) { setFont (kSystemFont); setTextColor (kBlackCColor); setTextColorHighlighted (kWhiteCColor); setGradientStartColor (CColor (220, 220, 220, 255)); setGradientStartColorHighlighted (CColor (180, 180, 180, 255)); setGradientEndColor (CColor (180, 180, 180, 255)); setGradientEndColorHighlighted (CColor (100, 100, 100, 255)); setFrameColor (kBlackCColor); setFrameColorHighlighted (kBlackCColor); setWantsFocus (true); }
MidiInPanel::MidiInPanel( const CRect& rcSize, Editor* editor ) : CViewContainer( rcSize, editor->getChildFrame(), NULL ), editor_( editor ) { setTransparency( true ); setWantsFocus( true ); SoundDevices* devices = editor_->getDevices(); MidiPortMap& inPorts = devices->midiInInfo_; CCoord itemHeight = 18; CCoord boxHeight = min( 6*18+1, inPorts.size()*18+1 ); CRect rcLabelPanel( 5, 0, 150, 15 ); CRect rcBox( 25, 38, 185, 38+boxHeight ); lblCaption_ = new Label( rcLabelPanel, "Midi In" ); lblCaption_->font_ = fontPirulen9; addView( lblCaption_ ); gbPorts_ = new GridBox( rcBox, getFrame(), this ); gbPorts_->setSelectionStyle( GridBox::NoSel ); gbPorts_->setItemHeight( itemHeight ); gbPorts_->addColumn( 86 ); gbPorts_->addColumn( 14 ); for( UINT16 i=0; i<inPorts.size(); i++ ) { string portName = inPorts.getPortName( i ); bool checked = devices->midiInPortIsOpen( portName ); MidiBoxItem* item = new MidiBoxItem( portName, checked ); gbPorts_->addItem( item ); } setColors(); gbPorts_->layout(); addView( gbPorts_ ); }
//------------------------------------------------------------------------ CSlider::CSlider (const CRect &rect, IControlListener* listener, int32_t tag, const CPoint& offsetHandle, int32_t _rangeHandle, CBitmap* handle, CBitmap* background, const CPoint& offset, const int32_t style) : CControl (rect, listener, tag, background) , offset (offset) , pHandle (handle) , style (style) , mode (kFreeClickMode) , minPos (0) , drawStyle (0) { setDrawTransparentHandle (true); if (pHandle) { pHandle->remember (); widthOfSlider = pHandle->getWidth (); heightOfSlider = pHandle->getHeight (); } else { widthOfSlider = 1; heightOfSlider = 1; } widthControl = getViewSize ().getWidth (); heightControl = getViewSize ().getHeight (); if (style & kHorizontal) rangeHandle = _rangeHandle - widthOfSlider; else rangeHandle = _rangeHandle - heightOfSlider; setOffsetHandle (offsetHandle); zoomFactor = 10.f; setWantsFocus (true); }
AudioOutPanel::AudioOutPanel( const CRect& rcSize, Editor* editor ) : CViewContainer( rcSize, editor->getChildFrame(), NULL ), editor_( editor ) { setTransparency( true ); setWantsFocus( true ); CRect rcLabelPanel( 5, 0, 150, 15 ); CRect rcLabelAsio( 302, 38, 340, 52 ); CRect rcEditAsio( 280, 38, 296, 54 ); CRect rcEditDevice( 25, 38, 260, 56 ); CRect rcEditChannel( 25, 70, 260, 88 ); CRect rcEditBuffer( 25, 102, 105, 120 ); CRect rcLabelBuffer( 115, 102, 200, 120 ); CRect rcEditRate( 25, 132, 105, 150 ); CRect rcLabelRate( 115, 132, 200, 150 ); CRect rcEditRun( 25, size.bottom-size.top-18, 43, size.bottom-size.top ); CRect rcLabelRun( 50, size.bottom-size.top-18, 150, size.bottom-size.top ); CRect rcLabelLatency( 230, size.bottom-size.top-18, 330, size.bottom-size.top-1 ); lblCaption_ = new Label( rcLabelPanel, "Audio Out" ); lblCaption_->font_ = fontPirulen9; addView( lblCaption_ ); lblAsio_ = new Label( rcLabelAsio, "Asio" ); lblAsio_->font_ = fontArial9; addView( lblAsio_ ); cbAsio_ = new Checkbox( rcEditAsio, this, CmdAsio, false ); addView( cbAsio_ ); lbLatency_ = new Label( rcLabelLatency, "" ); lbLatency_->font_ = fontArial9; lbLatency_->hAlign_ = kCenterText; addView( lbLatency_ ); cbRun_ = new Checkbox( rcEditRun, this, CmdRun, editor_->getOptions()->audioRun_ ); addView( cbRun_ ); lblRun_ = new Label( rcLabelRun, "Engine Run" ); lblRun_->font_ = fontArial9; addView( lblRun_ ); sbDevice_ = new SelectBox( rcEditDevice, this, CmdDevice ); sbDevice_->setFont( fontArial9 ); sbChannel_ = new SelectBox( rcEditChannel, this, CmdChannel ); sbChannel_->setFont( fontArial9 ); lbBuffer_ = new Label( rcLabelBuffer, "Buffer size" ); lbBuffer_->font_ = fontArial9; addView( lbBuffer_ ); sbBuffer_ = new SelectBox( rcEditBuffer, this, CmdBuffer ); sbBuffer_->setFont( fontArial9 ); lbRate_ = new Label( rcLabelRate, "Sample rate" ); lbRate_->font_ = fontArial9; addView( lbRate_ ); sbRate_ = new SelectBox( rcEditRate, this, CmdRate ); sbRate_->setFont( fontArial9 ); addView( sbRate_ ); addView( sbBuffer_ ); addView( sbChannel_ ); addView( sbDevice_ ); setColors(); }
//------------------------------------------------------------------------ COnOffButton::COnOffButton (const CRect& size, CControlListener* listener, int32_t tag, CBitmap* background, int32_t style) : CControl (size, listener, tag, background) , style (style) { setWantsFocus (true); }
//------------------------------------------------------------------------ COnOffButton::COnOffButton (const COnOffButton& v) : CControl (v) , style (v.style) { setWantsFocus (true); }
//------------------------------------------------------------------------ CMovieButton::CMovieButton (const CRect& size, IControlListener* listener, int32_t tag, CBitmap* background, const CPoint &offset) : CControl (size, listener, tag, background), offset (offset), buttonState (value) { heightOfOneImage = size.getHeight (); setWantsFocus (true); }