JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | List of all members
juce::KeyMappingEditorComponent::TopLevelItem Class Referencefinal
Inheritance diagram for juce::KeyMappingEditorComponent::TopLevelItem:
juce::TreeViewItem juce::ChangeListener

Public Member Functions

 TopLevelItem (KeyMappingEditorComponent &kec)
 
bool mightContainSubItems () override
 Tells the tree whether this item can potentially be opened.
 
String getUniqueName () const override
 Returns a string to uniquely identify this item.
 
void changeListenerCallback (ChangeBroadcaster *) override
 Your subclass should implement this method to receive the callback.
 
- Public Member Functions inherited from juce::TreeViewItem
 TreeViewItem ()
 Constructor.
 
virtual ~TreeViewItem ()
 Destructor.
 
int getNumSubItems () const noexcept
 Returns the number of sub-items that have been added to this item.
 
TreeViewItemgetSubItem (int index) const noexcept
 Returns one of the item's sub-items.
 
void clearSubItems ()
 Removes any sub-items.
 
void addSubItem (TreeViewItem *newItem, int insertPosition=-1)
 Adds a sub-item.
 
template<class ElementComparator >
void addSubItemSorted (ElementComparator &comparator, TreeViewItem *newItem)
 Adds a sub-item with a sort-comparator, assuming that the existing items are already sorted.
 
void removeSubItem (int index, bool deleteItem=true)
 Removes one of the sub-items.
 
template<class ElementComparator >
void sortSubItems (ElementComparator &comparator)
 Sorts the list of sub-items using a standard array comparator.
 
TreeViewgetOwnerView () const noexcept
 Returns the TreeView to which this item belongs.
 
TreeViewItemgetParentItem () const noexcept
 Returns the item within which this item is contained.
 
bool isOpen () const noexcept
 True if this item is currently open in the TreeView.
 
void setOpen (bool shouldBeOpen)
 Opens or closes the item.
 
Openness getOpenness () const noexcept
 Returns the openness state of this item.
 
void setOpenness (Openness newOpenness)
 Opens or closes the item.
 
bool isSelected () const noexcept
 True if this item is currently selected.
 
void setSelected (bool shouldBeSelected, bool deselectOtherItemsFirst, NotificationType shouldNotify=sendNotification)
 Selects or deselects the item.
 
Rectangle< intgetItemPosition (bool relativeToTreeViewTopLeft) const noexcept
 Returns the rectangle that this item occupies.
 
void treeHasChanged () const noexcept
 Sends a signal to the TreeView to make it refresh itself.
 
void repaintItem () const
 Sends a repaint message to redraw just this item.
 
int getRowNumberInTree () const noexcept
 Returns the row number of this item in the tree.
 
bool areAllParentsOpen () const noexcept
 Returns true if all the item's parent nodes are open.
 
void setLinesDrawnForSubItems (bool shouldDrawLines) noexcept
 Changes whether lines are drawn to connect any sub-items to this item.
 
virtual void itemOpennessChanged (bool isNowOpen)
 Called when an item is opened or closed.
 
virtual int getItemWidth () const
 Must return the width required by this item.
 
virtual int getItemHeight () const
 Must return the height required by this item.
 
virtual bool canBeSelected () const
 You can override this method to return false if you don't want to allow the user to select this item.
 
virtual std::unique_ptr< ComponentcreateItemComponent ()
 Creates a component that will be used to represent this item.
 
virtual void paintItem (Graphics &g, int width, int height)
 Draws the item's contents.
 
virtual void paintOpenCloseButton (Graphics &, const Rectangle< float > &area, Colour backgroundColour, bool isMouseOver)
 Draws the item's open/close button.
 
virtual void paintHorizontalConnectingLine (Graphics &, const Line< float > &line)
 Draws the line that connects this item to the vertical line extending below its parent.
 
virtual void paintVerticalConnectingLine (Graphics &, const Line< float > &line)
 Draws the line that extends vertically up towards one of its parents, or down to one of its children.
 
virtual bool customComponentUsesTreeViewMouseHandler () const
 This should return true if you want to use a custom component, and also use the TreeView's built-in mouse handling support, enabling drag-and-drop, itemClicked() and itemDoubleClicked(); return false if the component should consume all mouse clicks.
 
virtual void itemClicked (const MouseEvent &)
 Called when the user clicks on this item.
 
virtual void itemDoubleClicked (const MouseEvent &)
 Called when the user double-clicks on this item.
 
virtual void itemSelectionChanged (bool isNowSelected)
 Called when the item is selected or deselected.
 
virtual void ownerViewChanged (TreeView *newOwner)
 Called when the owner view changes.
 
virtual String getTooltip ()
 The item can return a tool tip string here if it wants to.
 
virtual String getAccessibilityName ()
 Use this to set the name for this item that will be read out by accessibility clients.
 
virtual var getDragSourceDescription ()
 To allow items from your TreeView to be dragged-and-dropped, implement this method.
 
virtual bool isInterestedInFileDrag (const StringArray &files)
 If you want your item to be able to have files drag-and-dropped onto it, implement this method and return true.
 
virtual void filesDropped (const StringArray &files, int insertIndex)
 When files are dropped into this item, this callback is invoked.
 
virtual bool isInterestedInDragSource (const DragAndDropTarget::SourceDetails &dragSourceDetails)
 If you want your item to act as a DragAndDropTarget, implement this method and return true.
 
virtual void itemDropped (const DragAndDropTarget::SourceDetails &dragSourceDetails, int insertIndex)
 When a things are dropped into this item, this callback is invoked.
 
void setDrawsInLeftMargin (bool canDrawInLeftMargin) noexcept
 Sets a flag to indicate that the item wants to be allowed to draw all the way across to the left edge of the TreeView.
 
void setDrawsInRightMargin (bool canDrawInRightMargin) noexcept
 Sets a flag to indicate that the item wants to be allowed to draw all the way across to the right edge of the TreeView.
 
std::unique_ptr< XmlElementgetOpennessState () const
 Saves the current state of open/closed nodes so it can be restored later.
 
void restoreOpennessState (const XmlElement &xml)
 Restores the openness of this item and all its sub-items from a saved state.
 
int getIndexInParent () const noexcept
 Returns the index of this item in its parent's sub-items.
 
bool isLastOfSiblings () const noexcept
 Returns true if this item is the last of its parent's sub-items.
 
String getItemIdentifierString () const
 Creates a string that can be used to uniquely retrieve this item in the tree.
 

Additional Inherited Members

- Public Types inherited from juce::TreeViewItem
enum class  Openness { opennessDefault , opennessClosed , opennessOpen }
 An enum of states to describe the explicit or implicit openness of an item. More...
 

Detailed Description

Definition at line 344 of file juce_KeyMappingEditorComponent.cpp.

Constructor & Destructor Documentation

◆ TopLevelItem()

juce::KeyMappingEditorComponent::TopLevelItem::TopLevelItem ( KeyMappingEditorComponent kec)

Definition at line 348 of file juce_KeyMappingEditorComponent.cpp.

◆ ~TopLevelItem()

juce::KeyMappingEditorComponent::TopLevelItem::~TopLevelItem ( )
override

Definition at line 354 of file juce_KeyMappingEditorComponent.cpp.

Member Function Documentation

◆ changeListenerCallback()

void juce::KeyMappingEditorComponent::TopLevelItem::changeListenerCallback ( ChangeBroadcaster source)
overridevirtual

Your subclass should implement this method to receive the callback.

Parameters
sourcethe ChangeBroadcaster that triggered the callback.

Implements juce::ChangeListener.

Definition at line 362 of file juce_KeyMappingEditorComponent.cpp.

◆ getUniqueName()

String juce::KeyMappingEditorComponent::TopLevelItem::getUniqueName ( ) const
overridevirtual

Returns a string to uniquely identify this item.

If you're planning on using the TreeView::getOpennessState() method, then these strings will be used to identify which nodes are open. The string should be unique amongst the item's sibling items, but it's ok for there to be duplicates at other levels of the tree.

If you're not going to store the state, then it's ok not to bother implementing this method.

Reimplemented from juce::TreeViewItem.

Definition at line 360 of file juce_KeyMappingEditorComponent.cpp.

◆ mightContainSubItems()

bool juce::KeyMappingEditorComponent::TopLevelItem::mightContainSubItems ( )
overridevirtual

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.

Definition at line 359 of file juce_KeyMappingEditorComponent.cpp.


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