WYSWYG editor for JUCE GUIs including Visualisers
Loading...
Searching...
No Matches
Container Class Reference

The Container is a GuiItem, that can hold multiple Components. More...

#include <foleys_Container.h>

+ Inheritance diagram for Container:

Public Member Functions

 Container (MagicGUIBuilder &builder, juce::ValueTree node)
 
 ~Container () override
 
void update () override
 Updates the layout fo children.
 
void addChildItem (std::unique_ptr< GuiItem > child)
 Append a child item.
 
std::vector< std::unique_ptr< GuiItem > >::iterator begin ()
 
std::vector< std::unique_ptr< GuiItem > >::iterator end ()
 
void setLayoutMode (LayoutType layout)
 Sets the layout mode of the container.
 
LayoutType getLayoutMode () const
 Returns the current layout mode.
 
void resized () override
 
bool isContainer () const override
 
void createSubComponents () override
 
void updateLayout () override
 This will trigger a recalculation of the children layout regardless of resized.
 
void updateColours () override
 Set colours in the wrapped Component to the value from the stylesheet and palette.
 
void updateContinuousRedraw ()
 
void configureFlexBox (const juce::ValueTree &node)
 
juce::Component * getWrappedComponent () override
 Allows accessing the Component inside that GuiItem.
 
GuiItemfindGuiItemWithId (const juce::String &name) override
 Lookup a Component through the tree.
 
GuiItemfindGuiItem (const juce::ValueTree &node) override
 Seeks recursively for a GuiItem.
 
void setEditMode (bool shouldEdit) override
 This switches this node and all it's descendents in the edit mode, which means, the components don't react, but instead you can move them around.
 
- Public Member Functions inherited from GuiItem
 GuiItem (MagicGUIBuilder &builder, juce::ValueTree node)
 
 ~GuiItem () override
 
virtual std::vector< SettablePropertygetSettableProperties () const
 Override this to return each settable option the designer should be able to configure on your component.
 
void setColourTranslation (std::vector< std::pair< juce::String, int > > mapping)
 For each factory you can register a translation table, which will forward the colours from the Stylesheet to the Components.
 
juce::StringArray getColourNames () const
 Return the names of configurable colours.
 
virtual juce::String getControlledParameterID (juce::Point< int >)
 Returns the parameterID that is controlled from this component.
 
juce::var getProperty (const juce::Identifier &property)
 Look up a value through the DOM and CSS.
 
MagicGUIStategetMagicState ()
 
void updateInternal ()
 Reread properties from the config ValueTree.
 
void paint (juce::Graphics &g) final
 
void resized () override
 
LayoutType getParentsLayoutType () const
 Returns the layout type this item is managed by.
 
void configureFlexBoxItem (const juce::ValueTree &node)
 Parse the values and set it to the FlexBox::Item for layouting.
 
void configurePosition (const juce::ValueTree &node)
 
juce::Rectangle< int > resolvePosition (juce::Rectangle< int > parent)
 Calculates the position according to the parent area.
 
juce::Rectangle< int > getClientBounds () const
 Returns the bounds of the wrapped Component.
 
juce::String getTabCaption (const juce::String &defaultName) const
 
juce::Colour getTabColour () const
 
juce::FlexItem & getFlexItem ()
 
void itemDragEnter (const juce::DragAndDropTarget::SourceDetails &details) override
 
void itemDragExit (const juce::DragAndDropTarget::SourceDetails &details) override
 
void paintOverChildren (juce::Graphics &g) override
 
void setDraggable (bool selected)
 
void mouseDown (const juce::MouseEvent &event) override
 
void mouseDrag (const juce::MouseEvent &event) override
 
void mouseUp (const juce::MouseEvent &event) override
 
bool isInterestedInDragSource (const juce::DragAndDropTarget::SourceDetails &dragSourceDetails) override
 
void itemDropped (const juce::DragAndDropTarget::SourceDetails &dragSourceDetails) override
 

Additional Inherited Members

- Public Attributes inherited from GuiItem
MagicGUIBuildermagicBuilder
 
- Protected Attributes inherited from GuiItem
juce::ValueTree configNode
 
Decorator decorator
 
juce::FlexItem flexItem { juce::FlexItem (*this).withFlex (1.0f) }
 
std::vector< std::pair< juce::String, int > > colourTranslation
 

Detailed Description

The Container is a GuiItem, that can hold multiple Components.

In the editor it is seen as "View". With the setting "display" the layout strategy can be chosen.

Constructor & Destructor Documentation

◆ Container()

Container ( MagicGUIBuilder & builder,
juce::ValueTree node )

◆ ~Container()

~Container ( )
override

Member Function Documentation

◆ update()

◆ addChildItem()

void addChildItem ( std::unique_ptr< GuiItem > child)

Append a child item.

To change the order the flexbox.order is used.

◆ begin()

std::vector< std::unique_ptr< GuiItem > >::iterator begin ( )

◆ end()

std::vector< std::unique_ptr< GuiItem > >::iterator end ( )

◆ setLayoutMode()

void setLayoutMode ( LayoutType layout)

Sets the layout mode of the container.

References foleys::Tabbed, and Container::updateLayout().

Referenced by Container::update().

◆ getLayoutMode()

LayoutType getLayoutMode ( ) const

Returns the current layout mode.

◆ resized()

void resized ( )
override

◆ isContainer()

bool isContainer ( ) const
overridevirtual

Reimplemented from GuiItem.

◆ createSubComponents()

◆ updateLayout()

void updateLayout ( )
overridevirtual

◆ updateColours()

void updateColours ( )
overridevirtual

Set colours in the wrapped Component to the value from the stylesheet and palette.

Reimplemented from GuiItem.

Reimplemented in RootItem.

References GuiItem::configNode, GuiItem::decorator, GuiItem::magicBuilder, and Decorator::updateColours().

◆ updateContinuousRedraw()

void updateContinuousRedraw ( )

◆ configureFlexBox()

void configureFlexBox ( const juce::ValueTree & node)

◆ getWrappedComponent()

juce::Component * getWrappedComponent ( )
overridevirtual

Allows accessing the Component inside that GuiItem.

Don't keep this pointer!

Implements GuiItem.

◆ findGuiItemWithId()

GuiItem * findGuiItemWithId ( const juce::String & name)
overridevirtual

Lookup a Component through the tree.

It will return the first with that id regardless if there is another one. We discourage using that function, because that Component can be deleted and recreated at any time without notice.

Reimplemented from GuiItem.

References GuiItem::configNode.

◆ findGuiItem()

GuiItem * findGuiItem ( const juce::ValueTree & node)
overridevirtual

Seeks recursively for a GuiItem.

Reimplemented from GuiItem.

References GuiItem::configNode.

◆ setEditMode()

void setEditMode ( bool shouldEdit)
overridevirtual

This switches this node and all it's descendents in the edit mode, which means, the components don't react, but instead you can move them around.

Reimplemented from GuiItem.

References GuiItem::setEditMode().


The documentation for this class was generated from the following files: