openshot-audio
0.1.6
|
#include <juce_gui_basics.h>
Classes | |
struct | PropertyHolderComponent |
struct | SectionComponent |
Additional Inherited Members | |
![]() | |
enum | FocusChangeType { focusChangedByMouseClick, focusChangedByTabKey, focusChangedDirectly } |
![]() | |
static Component *JUCE_CALLTYPE | getCurrentlyFocusedComponent () noexcept |
static void JUCE_CALLTYPE | unfocusAllComponents () |
static void JUCE_CALLTYPE | beginDragAutoRepeat (int millisecondsBetweenCallbacks) |
static bool JUCE_CALLTYPE | isMouseButtonDownAnywhere () noexcept |
static int JUCE_CALLTYPE | getNumCurrentlyModalComponents () noexcept |
static Component *JUCE_CALLTYPE | getCurrentlyModalComponent (int index=0) noexcept |
![]() | |
virtual ComponentPeer * | createNewPeer (int styleFlags, void *nativeWindowToAttachTo) |
A panel that holds a list of PropertyComponent objects.
This panel displays a list of PropertyComponents, and allows them to be organised into collapsible sections.
To use, simply create one of these and add your properties to it with addProperties() or addSection().
PropertyPanel::PropertyPanel | ( | ) |
Creates an empty property panel.
PropertyPanel::~PropertyPanel | ( | ) |
Destructor.
void PropertyPanel::addProperties | ( | const Array< PropertyComponent * > & | newPropertyComponents | ) |
Adds a set of properties to the panel.
The components in the list will be owned by this object and will be automatically deleted later on when no longer needed.
These properties are added without them being inside a named section. If you want them to be kept together in a collapsible section, use addSection() instead.
void PropertyPanel::addSection | ( | const String & | sectionTitle, |
const Array< PropertyComponent * > & | newPropertyComponents, | ||
bool | shouldSectionInitiallyBeOpen = true , |
||
int | indexToInsertAt = -1 |
||
) |
Adds a set of properties to the panel.
These properties are added under a section heading with a plus/minus button that allows it to be opened and closed. If indexToInsertAt is < 0 then it will be added at the end of the list, or before the given index if the index is non-zero.
The components in the list will be owned by this object and will be automatically deleted later on when no longer needed.
To add properies without them being in a section, use addProperties().
void PropertyPanel::clear | ( | ) |
Deletes all property components from the panel.
Returns the message that is displayed when there are no properties.
XmlElement * PropertyPanel::getOpennessState | ( | ) | const |
Saves the current state of open/closed sections so it can be restored later.
The caller is responsible for deleting the object that is returned. To restore this state, use restoreOpennessState().
StringArray PropertyPanel::getSectionNames | ( | ) | const |
Returns a list of all the names of sections in the panel. These are the sections that have been added with addSection().
int PropertyPanel::getTotalContentHeight | ( | ) | const |
Returns the height that the panel needs in order to display all of its content without scrolling.
bool PropertyPanel::isEmpty | ( | ) | const |
Returns true if the panel contains no properties.
bool PropertyPanel::isSectionOpen | ( | int | sectionIndex | ) | const |
Returns true if the section at this index is currently open. The index is from 0 up to the number of items returned by getSectionNames().
|
overridevirtual |
Components can override this method to draw their content.
The paint() method gets called when a region of a component needs redrawing, either because the component's repaint() method has been called, or because something has happened on the screen that means a section of a window needs to be redrawn.
Any child components will draw themselves over whatever this method draws. If you need to paint over the top of your child components, you can also implement the paintOverChildren() method to do this.
If you want to cause a component to redraw itself, this is done asynchronously - calling the repaint() method marks a region of the component as "dirty", and the paint() method will automatically be called sometime later, by the message thread, to paint any bits that need refreshing. In Juce (and almost all modern UI frameworks), you never redraw something synchronously.
You should never need to call this method directly - to take a snapshot of the component you could use createComponentSnapshot() or paintEntireComponent().
g | the graphics context that must be used to do the drawing operations. |
Reimplemented from juce::Component.
void PropertyPanel::refreshAll | ( | ) | const |
Calls the refresh() method of all PropertyComponents in the panel
void PropertyPanel::removeSection | ( | int | sectionIndex | ) |
Remove one of the sections using the section index. The index is from 0 up to the number of items returned by getSectionNames().
|
overridevirtual |
Called when this component's size has been changed.
A component can implement this method to do things such as laying out its child components when its width or height changes.
The method is called synchronously as a result of the setBounds or setSize methods, so repeatedly changing a components size will repeatedly call its resized method (unlike things like repainting, where multiple calls to repaint are coalesced together).
If the component is a top-level window on the desktop, its size could also be changed by operating-system factors beyond the application's control.
Reimplemented from juce::Component.
void PropertyPanel::restoreOpennessState | ( | const XmlElement & | newState | ) |
Restores a previously saved arrangement of open/closed sections.
This will try to restore a snapshot of the panel's state that was created by the getOpennessState() method. If any of the sections named in the original XML aren't present, they will be ignored.
Sets a message to be displayed when there are no properties in the panel. The default message is "nothing selected".
void PropertyPanel::setSectionEnabled | ( | int | sectionIndex, |
bool | shouldBeEnabled | ||
) |
Enables or disables one of the sections. The index is from 0 up to the number of items returned by getSectionNames().
void PropertyPanel::setSectionOpen | ( | int | sectionIndex, |
bool | shouldBeOpen | ||
) |
Opens or closes one of the sections. The index is from 0 up to the number of items returned by getSectionNames().