openshot-audio
0.1.2
|
|
inline |
|
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.
|
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.
|
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.
Reimplemented from juce::TreeViewItem.
|
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.
|
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.
g | the graphics context to draw into |
width | the width of the area available for drawing |
height | the height of the area available for drawing |
Reimplemented from juce::TreeViewItem.