예제 #1
0
        ProxyComponent (Component& c)
            : image (c.createComponentSnapshot (c.getLocalBounds()))
        {
            setBounds (c.getBounds());
            setTransform (c.getTransform());
            setAlpha (c.getAlpha());
            setInterceptsMouseClicks (false, false);

            if (Component* const parent = c.getParentComponent())
                parent->addAndMakeVisible (this);
            else if (c.isOnDesktop() && c.getPeer() != nullptr)
                addToDesktop (c.getPeer()->getStyleFlags() | ComponentPeer::windowIgnoresKeyPresses);
            else
                jassertfalse; // seem to be trying to animate a component that's not visible..

            setVisible (true);
            toBehind (&c);
        }
예제 #2
0
        ProxyComponent (Component& component)
            : image (component.createComponentSnapshot (component.getLocalBounds()))
        {
            setBounds (component.getBounds());
            setAlpha (component.getAlpha());
            setInterceptsMouseClicks (false, false);

            Component* const parent = component.getParentComponent();

            if (parent != 0)
                parent->addAndMakeVisible (this);
            else if (component.isOnDesktop() && component.getPeer() != 0)
                addToDesktop (component.getPeer()->getStyleFlags());
            else
                jassertfalse; // seem to be trying to animate a component that's not visible..

            setVisible (true);
            toBehind (&component);
        }
        ProxyComponent (Component& c)
        {
            setWantsKeyboardFocus (false);
            setBounds (c.getBounds());
            setTransform (c.getTransform());
            setAlpha (c.getAlpha());
            setInterceptsMouseClicks (false, false);

            if (Component* const parent = c.getParentComponent())
                parent->addAndMakeVisible (this);
            else if (c.isOnDesktop() && c.getPeer() != nullptr)
                addToDesktop (c.getPeer()->getStyleFlags() | ComponentPeer::windowIgnoresKeyPresses);
            else
                jassertfalse; // seem to be trying to animate a component that's not visible..

            const float scale = (float) Desktop::getInstance().getDisplays()
                                            .getDisplayContaining (getScreenBounds().getCentre()).scale;

            image = c.createComponentSnapshot (c.getLocalBounds(), false, scale);

            setVisible (true);
            toBehind (&c);
        }