openshot-audio  0.1.5
Public Member Functions | List of all members
juce::KeyMappingEditorComponent::CategoryItem Class Reference
Inheritance diagram for juce::KeyMappingEditorComponent::CategoryItem:
juce::TreeViewItem

Public Member Functions

 CategoryItem (KeyMappingEditorComponent &kec, const String &name)
 
String getUniqueName () const override
 
bool mightContainSubItems () override
 
int getItemHeight () const override
 
void paintItem (Graphics &g, int width, int height) override
 
void itemOpennessChanged (bool isNowOpen) 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)
 
bool isSelected () const noexcept
 
void setSelected (bool shouldBeSelected, bool deselectOtherItemsFirst, NotificationType shouldNotify=sendNotification)
 
Rectangle< int > getItemPosition (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 int getItemWidth () const
 
virtual bool canBeSelected () const
 
virtual ComponentcreateItemComponent ()
 
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 void itemClicked (const MouseEvent &e)
 
virtual void itemDoubleClicked (const MouseEvent &e)
 
virtual void itemSelectionChanged (bool isNowSelected)
 
virtual String getTooltip ()
 
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
 
XmlElementgetOpennessState () const
 
void restoreOpennessState (const XmlElement &xml)
 
int getIndexInParent () const noexcept
 
bool isLastOfSiblings () const noexcept
 
String getItemIdentifierString () const
 

Constructor & Destructor Documentation

◆ CategoryItem()

juce::KeyMappingEditorComponent::CategoryItem::CategoryItem ( KeyMappingEditorComponent kec,
const String name 
)
inline

Member Function Documentation

◆ getItemHeight()

int juce::KeyMappingEditorComponent::CategoryItem::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.

◆ getUniqueName()

String juce::KeyMappingEditorComponent::CategoryItem::getUniqueName ( ) const
inlineoverridevirtual

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.

◆ itemOpennessChanged()

void juce::KeyMappingEditorComponent::CategoryItem::itemOpennessChanged ( bool  isNowOpen)
inlineoverridevirtual

Called when an item is opened or closed.

When setOpen() is called and the item has specified that it might have sub-items with the mightContainSubItems() method, this method is called to let the item create or manage its sub-items.

So when this is called with isNowOpen set to true (i.e. when the item is being opened), a subclass might choose to use clearSubItems() and addSubItem() to refresh its sub-item list.

When this is called with isNowOpen set to false, the subclass might want to use clearSubItems() to save on space, or it might choose to leave them, depending on the nature of the tree.

You could also use this callback as a trigger to start a background process which asynchronously creates sub-items and adds them, if that's more appropriate for the task in hand.

See also
mightContainSubItems

Reimplemented from juce::TreeViewItem.

◆ mightContainSubItems()

bool juce::KeyMappingEditorComponent::CategoryItem::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.

◆ paintItem()

void juce::KeyMappingEditorComponent::CategoryItem::paintItem ( Graphics g,
int  width,
int  height 
)
inlineoverridevirtual

Draws the item's contents.

You can choose to either implement this method and draw each item, or you can use createItemComponent() to create a component that will represent the item.

If all you need in your tree is to be able to draw the items and detect when the user selects or double-clicks one of them, it's probably enough to use paintItem(), itemClicked() and itemDoubleClicked(). If you need more complicated interactions, you may need to use createItemComponent() instead.

Parameters
gthe graphics context to draw into
widththe width of the area available for drawing
heightthe height of the area available for drawing

Reimplemented from juce::TreeViewItem.


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