예제 #1
0
void CtrlrHyperlink::valueTreePropertyChanged (ValueTree &treeWhosePropertyHasChanged, const Identifier &property)
{
    if (property == Ids::uiButtonContent)
	{
		buttonContentChanged();
	}
	else if (property == Ids::uiHyperlinkColour)
	{
		hyperlinkButton->setColour (HyperlinkButton::textColourId, VAR2COLOUR(getProperty(property)));
	}
	else if (property == Ids::uiHyperlinkOpensUrl)
    {
        hyperlinkButton->setURL (getProperty(property) ? URL(getProperty(property)) : URL(String::empty));
    }
	else if (property == Ids::uiHyperlinkFont
		|| property == Ids::uiHyperlinkFitTextToSize
		|| property == Ids::uiHyperlinkTextJustification)
	{
		hyperlinkButton->setFont (STR2FONT(getProperty(Ids::uiHyperlinkFont)), getProperty(Ids::uiHyperlinkFitTextToSize), justificationFromProperty(getProperty(Ids::uiHyperlinkTextJustification)));
	}
	else
	{
		CtrlrComponent::valueTreePropertyChanged(treeWhosePropertyHasChanged, property);
	}

	if (restoreStateInProgress == false)
	{
		resized();
	}
}
예제 #2
0
const Array<Font> CtrlrGroup::getFontList()
{
	Array <Font> ret;
	Font f = STR2FONT(getProperty(Ids::uiGroupTextFont));
	if (f.getTypefaceName() != Font::getDefaultSerifFontName()
		&& f.getTypefaceName() != Font::getDefaultSansSerifFontName()
		&& f.getTypefaceName() != Font::getDefaultMonospacedFontName()
		&& f.getTypefaceName() != "<Sans-Serif>")
	{
		ret.add (f);
	}
	return (ret);
}
예제 #3
0
void CtrlrGroup::valueTreePropertyChanged (ValueTree &treeWhosePropertyHasChanged, const Identifier &property)
{
	if (property == Ids::uiGroupOutlineColour1 || property == Ids::uiGroupOutlineColour2
			|| property == Ids::uiGroupBackgroundColour1 || property == Ids::uiGroupBackgroundColour2
			|| property == Ids::uiGroupBackgroundGradientType || property == Ids::uiGroupOutlineGradientType
			|| property == Ids::uiGroupOutlineRoundAngle || property == Ids::uiGroupOutlineThickness)
	{
		repaint();
	}
	else if (property == Ids::uiGroupTextColour)
	{
		label->setColour (Label::textColourId, VAR2COLOUR(getProperty(Ids::uiGroupTextColour)));
	}
	else if (property == Ids::uiGroupText)
	{
		label->setText (getProperty(Ids::uiGroupText), dontSendNotification);
	}
	else if (property == Ids::uiGroupTextFont)
	{
		label->setFont (STR2FONT(getProperty(Ids::uiGroupTextFont)));
	}
	else if (property == Ids::uiGroupTextPlacement)
	{
		label->setJustificationType (justificationFromProperty(getProperty(Ids::uiGroupTextPlacement)));
	}
	else if (property == Ids::uiGroupTextMargin)
	{
		textMargin			= getProperty(Ids::uiGroupTextMargin);
	}

	else if (property == Ids::uiGroupBackgroundImage
		|| property == Ids::uiGroupBackgroundImageAlpha
		|| property == Ids::uiGroupBackgroundImageLayout
		)
	{
		setResource();
	}
	else
	{
		CtrlrComponent::valueTreePropertyChanged(treeWhosePropertyHasChanged, property);
	}

	if (restoreStateInProgress == false)
	{
		resized();
	}
}
예제 #4
0
//==============================================================================
void CtrlrXYSurface::paint (Graphics& g)
{
    //[UserPrePaint] Add your own custom painting code here..
    //[/UserPrePaint]

    //[UserPaint] Add your own custom painting code here..
	gradientFromProperty (g, usableRectangle.getSmallestIntegerContainer(), getObjectTree(), Ids::uiXYSurfaceBgGradientType, Ids::uiXYSurfaceBackgroundColour1, Ids::uiXYSurfaceBackgroundColour2);
	g.fillRoundedRectangle ((float)usableRectangle.getTopLeft().getX(), (float)usableRectangle.getTopLeft().getY(), (float)usableRectangle.getWidth(), (float)usableRectangle.getHeight(), getProperty(Ids::uiXYSurfaceCornerSize));

	gradientFromProperty (g, usableRectangle.getSmallestIntegerContainer(), getObjectTree(), Ids::uiXYSurfaceOutlineGradientType, Ids::uiXYSurfaceOutlineColour1, Ids::uiXYSurfaceOutlineColour2);
    g.drawRoundedRectangle ((float)usableRectangle.getX(), (float)usableRectangle.getY(), (float)usableRectangle.getWidth(), (float)usableRectangle.getHeight(), getProperty(Ids::uiXYSurfaceCornerSize), getProperty(Ids::uiXYSurfaceOutlineThickness));

	const int snapSize	= (int)getProperty (Ids::uiXYSurfaceGradientGrain, 8);
	Colour colour		= VAR2COLOUR(getProperty(Ids::uiXYSurfaceGradientColour));

	if (snapSize > 0)
	{
		Image backgroundFill(Image::ARGB, snapSize, snapSize, true);
		Graphics g1(backgroundFill);

		if (snapSize > 2)
		{
			g1.setColour (colour);
			g1.drawRect (0, 0, snapSize + 1, snapSize + 1);
		}

		g.setTiledImageFill (backgroundFill, 0, 0, 1.0f);
		g.fillRoundedRectangle ((float)usableRectangle.getX(), (float)usableRectangle.getY(), (float)usableRectangle.getWidth(), (float)usableRectangle.getHeight(), getProperty(Ids::uiXYSurfaceCornerSize));
	}

	if (backgroundImage.isValid())
	{
		if ((int)getProperty (Ids::uiXYSurfaceBgImageLayout) == 8192)
		{
			g.setTiledImageFill (backgroundImage, 0, 0, (float)getProperty (Ids::uiXYSurfaceBgImageAlpha)/255.0f);
			g.fillRect ((float)usableRectangle.getX(), (float)usableRectangle.getY(), (float)usableRectangle.getWidth(), (float)usableRectangle.getHeight());
		}
		else
		{
			g.setColour (Colours::black.withAlpha ((float)getProperty (Ids::uiXYSurfaceBgImageAlpha)/255.0f));
			g.drawImageWithin (backgroundImage,
								usableRectangle.getX(),
								usableRectangle.getX(),
								usableRectangle.getWidth(),
								usableRectangle.getHeight(),
								RectanglePlacement(getProperty (Ids::uiXYSurfaceBgImageLayout)));
		}
	}

	if (getProperty (Ids::uiXYSurfaceXTrackEnabled))
	{
		const Point<int> c = surfaceModulator->getBounds().getCentre();

		g.setColour (VAR2COLOUR(getProperty(Ids::uiXYSurfaceYTrackColour)));
		g.drawLine ((float)c.getX(), (float)usableRectangle.getY(), (float)c.getX(), (float)usableRectangle.getBottom(), getProperty(Ids::uiXYSurfaceYTrackThickness));

		g.setColour (VAR2COLOUR(getProperty(Ids::uiXYSurfaceXTrackColour)));
		g.drawLine ((float)usableRectangle.getX(), (float)c.getY(), (float)usableRectangle.getWidth(), (float)c.getY(), getProperty(Ids::uiXYSurfaceXTrackThickness));
	}

	if ((bool)getProperty(Ids::uiXYSurfaceInfoLabelVisible))
	{
		// const int xScale = (int)getProperty(Ids::uiXYSurfaceMaxX);
		// const int yScale = (int)getProperty(Ids::uiXYSurfaceMaxY);

		const Point<int> c = surfaceModulator->getBounds().getCentre();
		g.setColour (VAR2COLOUR(getProperty (Ids::uiXYSurfaceInfoLabelColour)));
		g.setFont (STR2FONT(getProperty(Ids::uiXYSurfaceInfoLabelFont)));
		g.drawText ("X="+String(getValueForPosition(c.getX(), true))+" Y="+String(getValueForPosition(c.getY(), false)),
					usableRectangle.getX() + 8,
					usableRectangle.getY() + 8,
					usableRectangle.getWidth()-16,
					usableRectangle.getHeight()-16,
					justificationFromProperty(getProperty (Ids::uiXYSurfaceInfoLabelLocation)),
					true);
	}

    //[/UserPaint]
}