Esempio n. 1
0
//------------------------------------------------------------------------
bool CCheckBox::sizeToFit ()
{
	if (title == 0)
		return false;
	IFontPainter* painter = font ? font->getFontPainter () : 0;
	if (painter)
	{
		CRect fitSize (getViewSize ());
		if (getDrawBackground ())
		{
			fitSize.setWidth (getDrawBackground ()->getWidth ());
			fitSize.setHeight (getDrawBackground ()->getHeight () / 6);
		}
		else
		{
			fitSize.setWidth (fitSize.getHeight ());
		}
		fitSize.right += kCheckBoxTitleMargin;
		fitSize.right += painter->getStringWidth (0, title, true);
		setViewSize (fitSize);
		setMouseableArea (fitSize);
		return true;
	}
	return false;
}
Esempio n. 2
0
//-----------------------------------------------------------------------------------------------
bool CMovieBitmap::sizeToFit ()
{
    if (getDrawBackground ())
    {
        CRect vs (getViewSize ());
        vs.setWidth (getDrawBackground ()->getWidth ());
        vs.setHeight (getHeightOfOneImage ());
        setViewSize (vs);
        setMouseableArea (vs);
        return true;
    }
    return false;
}
Esempio n. 3
0
//------------------------------------------------------------------------
bool CSlider::sizeToFit ()
{
	if (getDrawBackground ())
	{
		CRect vs (getViewSize ());
		vs.setWidth (getDrawBackground ()->getWidth ());
		vs.setHeight (getDrawBackground ()->getHeight ());
		setViewSize (vs, true);
		setMouseableArea (vs);
		return true;
	}
	return false;
}
Esempio n. 4
0
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;
}
Esempio n. 5
0
//------------------------------------------------------------------------
bool CKickButton::sizeToFit ()
{
	if (getDrawBackground ())
	{
		CRect vs (getViewSize ());
		vs.setHeight (heightOfOneImage);
		vs.setWidth (getDrawBackground ()->getWidth ());
		setViewSize (vs, true);
		setMouseableArea (vs);
		return true;
	}
	return false;
}
Esempio n. 6
0
//------------------------------------------------------------------------
bool CTextLabel::sizeToFit ()
{
	if (fontID == 0 || fontID->getPlatformFont () == 0 || fontID->getPlatformFont ()->getPainter () == 0)
		return false;
	CCoord width = fontID->getPlatformFont ()->getPainter ()->getStringWidth (0, text, true);
	if (width > 0)
	{
		width += (getTextInset ().x * 2.);
		CRect newSize = getViewSize ();
		newSize.setWidth (width);
		setViewSize (newSize);
		setMouseableArea (newSize);
		return true;
	}
	return false;
}
Esempio n. 7
0
//------------------------------------------------------------------------
bool CTextButton::sizeToFit ()
{
	if (title.empty ())
		return false;
	IFontPainter* painter = font ? font->getFontPainter () : 0;
	if (painter)
	{
		CRect fitSize (getViewSize ());
		fitSize.right = fitSize.left + (roundRadius + 1.) * 4.;
		fitSize.right += painter->getStringWidth (0, title.c_str (), true);
		setViewSize (fitSize);
		setMouseableArea (fitSize);
		return true;
	}
	return false;
}
Esempio n. 8
0
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
}
Esempio n. 9
0
//------------------------------------------------------------------------
bool CAnimationSplashScreen::sizeToFit ()
{
	if (modalView && modalView->getBackground ())
	{
		CRect r = modalView->getViewSize ();
		r.setWidth (modalView->getBackground ()->getWidth ());
		r.setHeight (modalView->getBackground ()->getHeight ());
		if (getFrame ())
		{
			r.centerInside (getFrame ()->getViewSize ());
		}
		modalView->setViewSize (r);
		modalView->setMouseableArea (r);
	}
	if (getBackground ())
	{
		CRect r = getViewSize ();
		r.setWidth (getBackground ()->getWidth ());
		r.setHeight (getBackground ()->getHeight ());
		setViewSize (r);
		setMouseableArea (r);
	}
	return true;
}