The Container is a GuiItem, that can hold multiple Components. More...
Public Member Functions | |
Container (MagicGUIBuilder &builder, juce::ValueTree node) | |
void | update () override |
Updates the layout fo children. More... | |
void | addChildItem (std::unique_ptr< GuiItem > child) |
Append a child item. More... | |
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. More... | |
LayoutType | getLayoutMode () const |
Returns the current layout mode. More... | |
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. More... | |
void | updateColours () override |
Set colours in the wrapped Component to the value from the stylesheet and palette. More... | |
void | updateContinuousRedraw () |
void | configureFlexBox (const juce::ValueTree &node) |
juce::Component * | getWrappedComponent () override |
Allows accessing the Component inside that GuiItem. More... | |
GuiItem * | findGuiItemWithId (const juce::String &name) override |
Lookup a Component through the tree. More... | |
GuiItem * | findGuiItem (const juce::ValueTree &node) override |
Seeks recursively for a GuiItem. More... | |
Public Member Functions inherited from GuiItem | |
GuiItem (MagicGUIBuilder &builder, juce::ValueTree node) | |
~GuiItem () override | |
virtual std::vector< SettableProperty > | getSettableProperties () const |
Override this to return each settable option the designer should be able to configure on your component. More... | |
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. More... | |
juce::StringArray | getColourNames () const |
Return the names of configurable colours. More... | |
virtual juce::String | getControlledParameterID (juce::Point< int >) |
Returns the parameterID that is controlled from this component. More... | |
juce::var | getProperty (const juce::Identifier &property) |
Look up a value through the DOM and CSS. More... | |
MagicGUIState & | getMagicState () |
void | updateInternal () |
Reread properties from the config ValueTree. More... | |
void | paint (juce::Graphics &g) final |
void | resized () override |
LayoutType | getParentsLayoutType () const |
Returns the layout type this item is managed by. More... | |
void | configureFlexBoxItem (const juce::ValueTree &node) |
Parse the values and set it to the FlexBox::Item for layouting. More... | |
void | configurePosition (const juce::ValueTree &node) |
juce::Rectangle< int > | resolvePosition (juce::Rectangle< int > parent) |
Calculates the position according to the parent area. More... | |
juce::Rectangle< int > | getClientBounds () const |
Returns the bounds of the wrapped Component. More... | |
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 |
bool | isInterestedInDragSource (const juce::DragAndDropTarget::SourceDetails &dragSourceDetails) override |
void | itemDropped (const juce::DragAndDropTarget::SourceDetails &dragSourceDetails) override |
Additional Inherited Members | |
Public Attributes inherited from GuiItem | |
MagicGUIBuilder & | magicBuilder |
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 |
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.
Container | ( | MagicGUIBuilder & | builder, |
juce::ValueTree | node | ||
) |
|
overridevirtual |
Updates the layout fo children.
Implements GuiItem.
References GuiItem::configNode, Container::configureFlexBox(), MagicGUIBuilder::getStyleProperty(), and GuiItem::magicBuilder.
void addChildItem | ( | std::unique_ptr< GuiItem > | child | ) |
Append a child item.
To change the order the flexbox.order is used.
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.
References foleys::Tabbed, and Container::updateLayout().
LayoutType getLayoutMode | ( | ) | const |
Returns the current layout mode.
|
override |
References Container::updateLayout().
|
overridevirtual |
Reimplemented from GuiItem.
|
overridevirtual |
Reimplemented from GuiItem.
References GuiItem::configNode, MagicGUIBuilder::createGuiItem(), GuiItem::magicBuilder, Container::updateContinuousRedraw(), and Container::updateLayout().
|
overridevirtual |
This will trigger a recalculation of the children layout regardless of resized.
Reimplemented from GuiItem.
References GuiItem::decorator, foleys::FlexBox, Decorator::getBackgroundColour(), GuiItem::getClientBounds(), foleys::NoScroll, foleys::ScrollBoth, foleys::ScrollHorizontal, foleys::ScrollVertical, and foleys::Tabbed.
Referenced by Container::createSubComponents(), Container::resized(), and Container::setLayoutMode().
|
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().
void updateContinuousRedraw | ( | ) |
Referenced by Container::createSubComponents().
void configureFlexBox | ( | const juce::ValueTree & | node | ) |
References MagicGUIBuilder::getStyleProperty(), and GuiItem::magicBuilder.
Referenced by Container::update().
|
overridevirtual |
|
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.
|
overridevirtual |