//============================================================================== void DrawableImage::refreshFromValueTree (const ValueTree& tree, ComponentBuilder& builder) { const ValueTreeWrapper controller (tree); setComponentID (controller.getID()); const float newOpacity = controller.getOpacity(); const Colour newOverlayColour (controller.getOverlayColour()); Image newImage; const var imageIdentifier (controller.getImageIdentifier()); jassert (builder.getImageProvider() != 0 || imageIdentifier.isVoid()); // if you're using images, you need to provide something that can load and save them! if (builder.getImageProvider() != nullptr) newImage = builder.getImageProvider()->getImageForIdentifier (imageIdentifier); const RelativeParallelogram newBounds (controller.getBoundingBox()); if (bounds != newBounds || newOpacity != opacity || overlayColour != newOverlayColour || image != newImage) { repaint(); opacity = newOpacity; overlayColour = newOverlayColour; if (image != newImage) setImage (newImage); setBoundingBox (newBounds); } }
//============================================================================== MainComponent::MainComponent (void *o) : JojoComponent (o) { addAndMakeVisible (slider = new Slider ("new slider")); slider->setRange (0, 100, 0); slider->setSliderStyle (Slider::LinearBar); slider->setTextBoxStyle (Slider::TextBoxLeft, true, 80, 20); slider->setColour (Slider::backgroundColourId, Colour (0x20ffffff)); slider->setColour (Slider::thumbColourId, Colour (0xff6a6a6a)); slider->setColour (Slider::textBoxTextColourId, Colours::white); slider->addListener (this); //[UserPreSize] //[/UserPreSize] setSize (250, 250); //[Constructor] You can add your own custom stuff here.. setComponentID ("myComponent"); slider->setComponentID ("mySlider"); //[/Constructor] }
//============================================================================== void DrawableText::refreshFromValueTree (const ValueTree& tree, ComponentBuilder&) { ValueTreeWrapper v (tree); setComponentID (v.getID()); const RelativeParallelogram newBounds (v.getBoundingBox()); const RelativeCoordinate newFontHeight (v.getFontHeight()); const RelativeCoordinate newFontHScale (v.getFontHorizontalScale()); const Colour newColour (v.getColour()); const Justification newJustification (v.getJustification()); const String newText (v.getText()); const Font newFont (v.getFont()); if (text != newText || font != newFont || justification != newJustification || colour != newColour || bounds != newBounds || newFontHeight != fontHeight || newFontHScale != fontHScale) { setBoundingBox (newBounds); setFontHeight (newFontHeight); setFontHorizontalScale (newFontHScale); setColour (newColour); setFont (newFont, false); setJustification (newJustification); setText (newText); } }
Drawable::Drawable (const Drawable& other) : Component (other.getName()) { setInterceptsMouseClicks (false, false); setPaintingIsUnclipped (true); setComponentID (other.getComponentID()); setTransform (other.getTransform()); }
//============================================================================== void DrawableRectangle::refreshFromValueTree (const ValueTree& tree, ComponentBuilder& builder) { ValueTreeWrapper v (tree); setComponentID (v.getID()); refreshFillTypes (v, builder.getImageProvider()); setStrokeType (v.getStrokeType()); setRectangle (v.getRectangle()); setCornerSize (v.getCornerSize()); }
//============================================================================== void DrawableComposite::refreshFromValueTree (const ValueTree& tree, ComponentBuilder& builder) { const ValueTreeWrapper wrapper (tree); setComponentID (wrapper.getID()); wrapper.getMarkerList (true).applyTo (markersX); wrapper.getMarkerList (false).applyTo (markersY); setBoundingBox (wrapper.getBoundingBox()); builder.updateChildComponents (*this, wrapper.getChildList()); }
Drawable::Drawable (const Drawable& other) : Component (other.getName()) { setInterceptsMouseClicks (false, false); setPaintingIsUnclipped (true); setComponentID (other.getComponentID()); setTransform (other.getTransform()); if (auto* clipPath = other.drawableClipPath.get()) setClipPath (clipPath->createCopy()); }
juced_ImageComponent::juced_ImageComponent() : ImageComponent () { setName("ImageComponent"); setProperty(Attributes::objectType, Modules::ImageComponent.toString()); setProperty(Attributes::height, getHeight()); setProperty(Attributes::width, getWidth()); setProperty(Attributes::name, getName()); ++_numObjects; setProperty(Attributes::varName, getName() + String(_numObjects)); setProperty(Attributes::image, ""); setProperty(Attributes::className, "ImageComponent"); setProperty(Attributes::toolName, "juced_ImageComponent"); setProperty(Attributes::declareExtended, false); setComponentID(Uuid().toString()); setProperty(Attributes::ID, getComponentID()); }
juced_ComboBox::juced_ComboBox() : ComboBox () { setText("Combo Box", false); setName("Box"); setProperty(Attributes::objectType, Modules::ComboBox.toString()); setProperty(Attributes::text, getText()); //setProperty(Attributes::font, getFont().toString()); setProperty(Attributes::backgroundColour, findColour(backgroundColourId).toDisplayString(true)); setProperty(Attributes::textColour, findColour(textColourId).toDisplayString(true)); setProperty(Attributes::height, getHeight()); setProperty(Attributes::width, getWidth()); setProperty(Attributes::itemList, ""); setProperty(Attributes::name, getName()); ++_numObjects; setProperty(Attributes::varName, getName() + String(_numObjects)); setProperty(Attributes::className, "ComboBox"); setProperty(Attributes::toolName, "juced_ComboBox"); setProperty(Attributes::declareExtended, false); setComponentID(Uuid().toString()); setProperty(Attributes::ID, getComponentID()); }
juced_BubbleMessageComponent::juced_BubbleMessageComponent() : BubbleMessageComponent () { //setText("Text label", false); //setName("Label"); setProperty(Attributes::objectType, Modules::BubbleComponent.toString()); //setProperty(Attributes::text, getText()); //setProperty(Attributes::font, getFont().toString()); setProperty(Attributes::backgroundColour, findColour(backgroundColourId).toDisplayString(true)); //setProperty(Attributes::textColour, findColour(textColourId).toDisplayString(true)); //setProperty(Attributes::showEditor, false); //setProperty(Attributes::editable, false); setProperty(Attributes::height, getHeight()); setProperty(Attributes::width, getWidth()); setProperty(Attributes::name, getName()); ++_numObjects; setProperty(Attributes::varName, getName() + String(_numObjects)); setProperty(Attributes::className, "BubbleMessageComponent"); setProperty(Attributes::toolName, "juced_BubbleMessageComponent"); setProperty(Attributes::declareExtended, false); setComponentID(Uuid().toString()); setProperty(Attributes::ID, getComponentID()); }
Drawable::Drawable (const Drawable& other) : Component (other.getName()) { setComponentID (other.getComponentID()); }