openshot-audio
0.1.6
|
Public Member Functions | |
MappingItem (KeyMappingEditorComponent &kec, const CommandID command) | |
String | getUniqueName () const override |
bool | mightContainSubItems () override |
int | getItemHeight () const override |
Component * | createItemComponent () override |
![]() | |
TreeViewItem () | |
virtual | ~TreeViewItem () |
int | getNumSubItems () const noexcept |
TreeViewItem * | getSubItem (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) |
TreeView * | getOwnerView () const noexcept |
TreeViewItem * | getParentItem () 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 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 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 |
XmlElement * | getOpennessState () const |
void | restoreOpennessState (const XmlElement &xml) |
int | getIndexInParent () const noexcept |
bool | isLastOfSiblings () const noexcept |
String | getItemIdentifierString () const |
|
inline |
|
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, so always return a new component, and don't keep a reference to it, as the treeview will delete it later when it goes off the screen or is no longer needed. Also bear in mind that if the component keeps a reference to the item that created it, that item could be deleted before the component. 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.
|
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 |
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.