openshot-audio
0.1.4
|
Public Member Functions | |
FileListTreeItem (FileTreeComponent &treeComp, DirectoryContentsList *const parentContents, const int indexInContents, const File &f, TimeSliceThread &t) | |
~FileListTreeItem () | |
bool | mightContainSubItems () override |
String | getUniqueName () const override |
int | getItemHeight () const override |
var | getDragSourceDescription () override |
void | itemOpennessChanged (bool isNowOpen) override |
void | removeSubContentsList () |
void | setSubContentsList (DirectoryContentsList *newList, const bool canDeleteList) |
bool | selectFile (const File &target) |
void | changeListenerCallback (ChangeBroadcaster *) override |
void | rebuildItemsFromContentList () |
void | paintItem (Graphics &g, int width, int height) override |
void | itemClicked (const MouseEvent &e) override |
void | itemDoubleClicked (const MouseEvent &e) override |
void | itemSelectionChanged (bool) override |
int | useTimeSlice () override |
void | handleAsyncUpdate () 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 int | getItemWidth () const |
virtual bool | canBeSelected () const |
virtual Component * | createItemComponent () |
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 String | getTooltip () |
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 |
Public Attributes | |
const File | file |
|
inline |
|
inline |
|
inlineoverridevirtual |
Your subclass should implement this method to receive the callback.
source | the ChangeBroadcaster that triggered the callback. |
Implements ChangeListener.
|
inlineoverridevirtual |
To allow items from your treeview to be dragged-and-dropped, implement this method.
If this returns a non-null variant then when the user drags an item, the treeview will try to find a DragAndDropContainer in its parent hierarchy, and will use it to trigger a drag-and-drop operation, using this string as the source description, with the treeview itself as the source component.
If you need more complex drag-and-drop behaviour, you can use custom components for the items, and use those to trigger the drag.
To accept drag-and-drop in your tree, see isInterestedInDragSource(), isInterestedInFileDrag(), etc.
Reimplemented from 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 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 TreeViewItem.
|
inlineoverridevirtual |
Called back to do whatever your class needs to do.
This method is called by the message thread at the next convenient time after the triggerAsyncUpdate() method has been called.
Implements AsyncUpdater.
|
inlineoverridevirtual |
Called when the user clicks on this item.
If you're using createItemComponent() to create a custom component for the item, the mouse-clicks might not make it through to the treeview, but this is how you find out about clicks when just drawing each item individually.
The associated mouse-event details are passed in, so you can find out about which button, where it was, etc.
Reimplemented from TreeViewItem.
|
inlineoverridevirtual |
Called when the user double-clicks on this item.
If you're using createItemComponent() to create a custom component for the item, the mouse-clicks might not make it through to the treeview, but this is how you find out about clicks when just drawing each item individually.
The associated mouse-event details are passed in, so you can find out about which button, where it was, etc.
If not overridden, the base class method here will open or close the item as if the 'plus' button had been clicked.
Reimplemented from 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 TreeViewItem.
|
inlineoverridevirtual |
Called when the item is selected or deselected.
Use this if you want to do something special when the item's selectedness changes. By default it'll get repainted when this happens.
Reimplemented from 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 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 TreeViewItem.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineoverridevirtual |
Called back by a TimeSliceThread.
When you register this class with it, a TimeSliceThread will repeatedly call this method.
The implementation of this method should use its time-slice to do something that's quick - never block for longer than absolutely necessary.
Implements TimeSliceClient.
const File FileListTreeItem::file |