LMMS
Loading...
Searching...
No Matches
juce::ParamControlItem Struct Reference
Inheritance diagram for juce::ParamControlItem:
juce::TreeViewItem

Public Member Functions

 ParamControlItem (AudioProcessorEditor &editorIn, AudioProcessorParameter &paramIn)
bool mightContainSubItems () override
std::unique_ptr< ComponentcreateItemComponent () override
int getItemHeight () const override
Public Member Functions inherited from juce::TreeViewItem
 TreeViewItem ()
virtual ~TreeViewItem ()
int getNumSubItems () const noexcept
TreeViewItemgetSubItem (int index) const noexcept
void clearSubItems ()
void addSubItem (TreeViewItem *newItem, int insertPosition=-1)
template<class ElementComparator>
void addSubItemSorted (ElementComparator &comparator, TreeViewItem *newItem)
void removeSubItem (int index, bool deleteItem=true)
template<class ElementComparator>
void sortSubItems (ElementComparator &comparator)
TreeViewgetOwnerView () const noexcept
TreeViewItemgetParentItem () const noexcept
bool isOpen () const noexcept
void setOpen (bool shouldBeOpen)
Openness getOpenness () const noexcept
void setOpenness (Openness newOpenness)
bool isSelected () const noexcept
void setSelected (bool shouldBeSelected, bool deselectOtherItemsFirst, NotificationType shouldNotify=sendNotification)
Rectangle< intgetItemPosition (bool relativeToTreeViewTopLeft) const noexcept
void treeHasChanged () const noexcept
void repaintItem () const
int getRowNumberInTree () const noexcept
bool areAllParentsOpen () const noexcept
void setLinesDrawnForSubItems (bool shouldDrawLines) noexcept
virtual String getUniqueName () const
virtual void itemOpennessChanged (bool isNowOpen)
virtual int getItemWidth () const
virtual bool canBeSelected () const
virtual void paintItem (Graphics &g, int width, int height)
virtual void paintOpenCloseButton (Graphics &, const Rectangle< float > &area, Colour backgroundColour, bool isMouseOver)
virtual void paintHorizontalConnectingLine (Graphics &, const Line< float > &line)
virtual void paintVerticalConnectingLine (Graphics &, const Line< float > &line)
virtual bool customComponentUsesTreeViewMouseHandler () const
virtual void itemClicked (const MouseEvent &)
virtual void itemDoubleClicked (const MouseEvent &)
virtual void itemSelectionChanged (bool isNowSelected)
virtual void ownerViewChanged (TreeView *newOwner)
virtual String getTooltip ()
virtual String getAccessibilityName ()
virtual var getDragSourceDescription ()
virtual bool isInterestedInFileDrag (const StringArray &files)
virtual void filesDropped (const StringArray &files, int insertIndex)
virtual bool isInterestedInDragSource (const DragAndDropTarget::SourceDetails &dragSourceDetails)
virtual void itemDropped (const DragAndDropTarget::SourceDetails &dragSourceDetails, int insertIndex)
void setDrawsInLeftMargin (bool canDrawInLeftMargin) noexcept
void setDrawsInRightMargin (bool canDrawInRightMargin) noexcept
std::unique_ptr< XmlElementgetOpennessState () const
void restoreOpennessState (const XmlElement &xml)
int getIndexInParent () const noexcept
bool isLastOfSiblings () const noexcept
String getItemIdentifierString () const

Public Attributes

AudioProcessorEditoreditor
AudioProcessorParameterparam

Additional Inherited Members

Public Types inherited from juce::TreeViewItem
enum class  Openness { opennessDefault , opennessClosed , opennessOpen }

Constructor & Destructor Documentation

◆ ParamControlItem()

juce::ParamControlItem::ParamControlItem ( AudioProcessorEditor & editorIn,
AudioProcessorParameter & paramIn )
inline

Member Function Documentation

◆ createItemComponent()

std::unique_ptr< Component > juce::ParamControlItem::createItemComponent ( )
inlineoverridevirtual

Creates a component that will be used to represent this item.

You don't have to implement this method - if it returns nullptr then no component will be used for the item, and you can just draw it using the paintItem() callback. But if you do return a component, it will be positioned in the TreeView so that it can be used to represent this item.

The component returned will be managed by the TreeView and will be deleted later when it goes off the screen or is no longer needed. Its position and size will be completely managed by the tree, so don't attempt to move it around.

Something you may want to do with your component is to give it a pointer to the TreeView that created it. This is perfectly safe, and there's no danger of it becoming a dangling pointer because the TreeView will always delete the component before it is itself deleted.

As long as you stick to these rules you can return whatever kind of component you like. It's most useful if you're doing things like drag-and-drop of items, or want to use a Label component to edit item names, etc.

Reimplemented from juce::TreeViewItem.

◆ getItemHeight()

int juce::ParamControlItem::getItemHeight ( ) const
inlineoverridevirtual

Must return the height required by this item.

This is the height in pixels that the item will take up. Items in the tree can be different heights, but if they change height, you should call treeHasChanged() to update the tree.

Reimplemented from juce::TreeViewItem.

◆ mightContainSubItems()

bool juce::ParamControlItem::mightContainSubItems ( )
inlineoverridevirtual

Tells the tree whether this item can potentially be opened.

If your item could contain sub-items, this should return true; if it returns false then the tree will not try to open the item. This determines whether or not the item will be drawn with a 'plus' button next to it.

Implements juce::TreeViewItem.

Member Data Documentation

◆ editor

AudioProcessorEditor& juce::ParamControlItem::editor

◆ param

AudioProcessorParameter& juce::ParamControlItem::param

The documentation for this struct was generated from the following file: