ZenTextEditor::ZenTextEditor(const String& componentName, const ImageBorderType& imageBorderType, const String& labelText, int componentWidth, int componentHeight)
	:TextEditor(componentName)
{
	Component::setSize(componentWidth, componentHeight);
	setText(labelText);
	if (imageBorderType == LargeBorder)
	{
		leftEndImage = ImageCache::getFromMemory(ZenBinaryData::textFieldLargeBorderLeftEnd_png, ZenBinaryData::textFieldLargeBorderLeftEnd_pngSize);
		rightEndImage = ImageCache::getFromMemory(ZenBinaryData::textFieldLargeBorderRightEnd_png, ZenBinaryData::textFieldLargeBorderRightEnd_pngSize);
		centerImage = ImageCache::getFromMemory(ZenBinaryData::textFieldLargeBorderCenter_png, ZenBinaryData::textFieldLargeBorderCenter_pngSize);
		fullImage = ImageCache::getFromMemory(ZenBinaryData::textFieldLargeBorderFull_png, ZenBinaryData::textFieldLargeBorderFull_pngSize);
	} else
	{
		leftEndImage = ImageCache::getFromMemory(ZenBinaryData::textFieldSmallBorderLeftEnd_png, ZenBinaryData::textFieldSmallBorderLeftEnd_pngSize);
		rightEndImage = ImageCache::getFromMemory(ZenBinaryData::textFieldSmallBorderRightEnd_png, ZenBinaryData::textFieldSmallBorderRightEnd_pngSize);
		centerImage = ImageCache::getFromMemory(ZenBinaryData::textFieldSmallBorderCenter_png, ZenBinaryData::textFieldSmallBorderCenter_pngSize);
		fullImage = ImageCache::getFromMemory(ZenBinaryData::textFieldSmallBorderFull_png, ZenBinaryData::textFieldSmallBorderFull_pngSize);
	}
	this->setColour(textColourId, Colours::antiquewhite);
	this->setColour(backgroundColourId, Colour(0.0f));  //transparent background since we're drawing image
	this->setColour(highlightColourId, Colours::white);
	this->setColour(CaretComponent::caretColourId, Colour(0xffc3c3c3));
	
	Typeface::Ptr tface = Typeface::createSystemTypefaceFor(ZenBinaryData::futurabook_ttf, ZenBinaryData::futurabook_ttfSize);
	Font textFont(tface);
	
	textFont.setHeight(14.0f);
	this->setFont(textFont);
	addComponentListener(this);
	
	setBorder(BorderSize<int>(1, 5, 1, 5 ));	
}
Esempio n. 2
0
void AudioProcessorEditor::initialise()
{
    /*
      ==========================================================================
       In accordance with the terms of the JUCE 5 End-Use License Agreement, the
       JUCE Code in SECTION A cannot be removed, changed or otherwise rendered
       ineffective unless you have a JUCE Indie or Pro license, or are using
       JUCE under the GPL v3 license.

       End User License Agreement: www.juce.com/juce-5-licence
      ==========================================================================
    */

    // BEGIN SECTION A

    splashScreen = new JUCESplashScreen (*this);

    // END SECTION A

    resizable = false;

    attachConstrainer (&defaultConstrainer);
    resizeListener.reset (new AudioProcessorEditorListener (*this));
    addComponentListener (resizeListener.get());
}