当前位置: 首页>>代码示例>>C++>>正文


C++ ComponentBuilder类代码示例

本文整理汇总了C++中ComponentBuilder的典型用法代码示例。如果您正苦于以下问题:C++ ComponentBuilder类的具体用法?C++ ComponentBuilder怎么用?C++ ComponentBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ComponentBuilder类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: refreshFromValueTree

//==============================================================================
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);
    }
}
开发者ID:sonic59,项目名称:JuceEditor,代码行数:33,代码来源:juce_DrawableImage.cpp

示例2: registerDrawableTypeHandlers

void Drawable::registerDrawableTypeHandlers (ComponentBuilder& builder)
{
    builder.registerTypeHandler (new DrawableTypeHandler <DrawablePath>());
    builder.registerTypeHandler (new DrawableTypeHandler <DrawableComposite>());
    builder.registerTypeHandler (new DrawableTypeHandler <DrawableRectangle>());
    builder.registerTypeHandler (new DrawableTypeHandler <DrawableImage>());
    builder.registerTypeHandler (new DrawableTypeHandler <DrawableText>());
}
开发者ID:410pfeliciano,项目名称:plugin-GUI,代码行数:8,代码来源:juce_Drawable.cpp

示例3: builder

Drawable* Drawable::createFromValueTree (const ValueTree& tree, ComponentBuilder::ImageProvider* imageProvider)
{
    ComponentBuilder builder (tree);
    builder.setImageProvider (imageProvider);
    registerDrawableTypeHandlers (builder);

    ScopedPointer<Component> comp (builder.createComponent());
    Drawable* const d = dynamic_cast<Drawable*> (static_cast <Component*> (comp));

    if (d != nullptr)
        comp.release();

    return d;
}
开发者ID:410pfeliciano,项目名称:plugin-GUI,代码行数:14,代码来源:juce_Drawable.cpp

示例4: upImageIdentifier

void ImageButton::refreshFromValueTree (const ValueTree& state, ComponentBuilder& builder)
{
    Button::refreshFromValueTree (state, builder);

    const var upImageIdentifier (state [Ids::upImage]),
              overImageIdentifier (state [Ids::overImage]),
              downImageIdentifier (state [Ids::downImage]);

    ComponentBuilder::ImageProvider* const imageProvider = builder.getImageProvider();
    jassert (imageProvider != nullptr || upImageIdentifier.isVoid());

    Image newUpImage, newOverImage, newDownImage;

    if (imageProvider != nullptr)
    {
        newUpImage   = imageProvider->getImageForIdentifier (upImageIdentifier);
        newOverImage = imageProvider->getImageForIdentifier (overImageIdentifier);
        newDownImage = imageProvider->getImageForIdentifier (downImageIdentifier);
    }

    using namespace ImageButtonHelpers;

    setImages (false, true, true,
               newUpImage,   getOpacityFromVar (state[Ids::upOpacity]),   getColourFromVar (state[Ids::upOverlay]),
               newOverImage, getOpacityFromVar (state[Ids::overOpacity]), getColourFromVar (state[Ids::overOverlay]),
               newDownImage, getOpacityFromVar (state[Ids::downOpacity]), getColourFromVar (state[Ids::downOverlay]));
}
开发者ID:Emisense,项目名称:S3Test,代码行数:27,代码来源:juce_ImageButton.cpp

示例5: refreshFromValueTree

//==============================================================================
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());
}
开发者ID:Neknail,项目名称:JUCE,代码行数:11,代码来源:juce_DrawableRectangle.cpp

示例6: updateComponent

    static void updateComponent (ComponentBuilder& builder, const ValueTree& state)
    {
        if (Component* topLevelComp = builder.getManagedComponent())
        {
            ComponentBuilder::TypeHandler* const type = builder.getHandlerForState (state);
            const String uid (getStateId (state));

            if (type == nullptr || uid.isEmpty())
            {
                // ..handle the case where a child of the actual state node has changed.
                if (state.getParent().isValid())
                    updateComponent (builder, state.getParent());
            }
            else
            {
                if (Component* const changedComp = findComponentWithID (*topLevelComp, uid))
                    type->updateComponentFromState (changedComp, state);
            }
        }
    }
开发者ID:Flowersoft,项目名称:MIDI2LR,代码行数:20,代码来源:juce_ComponentBuilder.cpp

示例7: refreshFromValueTree

//==============================================================================
void DrawablePath::refreshFromValueTree (const ValueTree& tree, ComponentBuilder& builder)
{
    ValueTreeWrapper v (tree);
    setComponentID (v.getID());

    refreshFillTypes (v, builder.getImageProvider());
    setStrokeType (v.getStrokeType());

    RelativePointPath newRelativePath;
    v.writeTo (newRelativePath);
    setPath (newRelativePath);
}
开发者ID:randi2kewl,项目名称:ShoutOut,代码行数:13,代码来源:juce_DrawablePath.cpp

示例8: refreshFromValueTree

//==============================================================================
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());
}
开发者ID:pingdynasty,项目名称:BlipZones,代码行数:13,代码来源:juce_DrawableComposite.cpp


注:本文中的ComponentBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。