openshot-audio
0.1.7
|
#include <juce_gui_basics.h>
Classes | |
struct | LookAndFeelMethods |
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) |
![]() | |
SettableTooltipClient () | |
Shows a filename as an editable text box, with a 'browse' button and a drop-down list for recently selected files.
A handy component for dialogue boxes where you want the user to be able to select a file or directory.
Attach an FilenameComponentListener using the addListener() method, and it will get called each time the user changes the filename, either by browsing for a file and clicking 'ok', or by typing a new filename into the box and pressing return.
FilenameComponent::FilenameComponent | ( | const String & | name, |
const File & | currentFile, | ||
bool | canEditFilename, | ||
bool | isDirectory, | ||
bool | isForSaving, | ||
const String & | fileBrowserWildcard, | ||
const String & | enforcedSuffix, | ||
const String & | textWhenNothingSelected | ||
) |
Creates a FilenameComponent.
name | the name for this component. |
currentFile | the file to initially show in the box |
canEditFilename | if true, the user can manually edit the filename; if false, they can only change it by browsing for a new file |
isDirectory | if true, the file will be treated as a directory, and an appropriate directory browser used |
isForSaving | if true, the file browser will allow non-existent files to be picked, as the file is assumed to be used for saving rather than loading |
fileBrowserWildcard | a wildcard pattern to use in the file browser - e.g. "*.txt;*.foo". If an empty string is passed in, then the pattern is assumed to be "*" |
enforcedSuffix | if this is non-empty, it is treated as a suffix that will be added to any filenames that are entered or chosen |
textWhenNothingSelected | the message to display in the box before any filename is entered. (This will only appear if the initial file isn't valid) |
FilenameComponent::~FilenameComponent | ( | ) |
Destructor.
void FilenameComponent::addListener | ( | FilenameComponentListener * | listener | ) |
Adds a listener that will be called when the selected file is changed.
Adds an entry to the recently-used files dropdown list.
If the file is already in the list, it will be moved to the top. A limit is also placed on the number of items that are kept in the list.
|
overridevirtual |
Creates a KeyboardFocusTraverser object to use to determine the logic by which focus should be passed from this component.
The default implementation of this method will return a default KeyboardFocusTraverser if this component is a focus container (as determined by the setFocusContainer() method). If the component isn't a focus container, then it will recursively ask its parents for a KeyboardFocusTraverser.
If you overrride this to return a custom KeyboardFocusTraverser, then this component and all its sub-components will use the new object to make their focusing decisions.
The method should return a new object, which the caller is required to delete when no longer needed.
Reimplemented from juce::Component.
|
overridevirtual |
Callback to indicate that some files are being dragged over this component.
This gets called when the user moves the mouse into this component while dragging.
Use this callback as a trigger to make your component repaint itself to give the user feedback about whether the files can be dropped here or not.
files | the set of (absolute) pathnames of the files that the user is dragging |
x | the mouse x position, relative to this component |
y | the mouse y position, relative to this component |
Reimplemented from juce::FileDragAndDropTarget.
|
overridevirtual |
Callback to indicate that the mouse has moved away from this component.
This gets called when the user moves the mouse out of this component while dragging the files.
If you've used fileDragEnter() to repaint your component and give feedback, use this as a signal to repaint it in its normal state.
files | the set of (absolute) pathnames of the files that the user is dragging |
Reimplemented from juce::FileDragAndDropTarget.
|
overridevirtual |
Callback to indicate that the user has dropped the files onto this component.
When the user drops the files, this get called, and you can use the files in whatever way is appropriate.
Note that after this is called, the fileDragExit method may not be called, so you should clean up in here if there's anything you need to do when the drag finishes.
files | the set of (absolute) pathnames of the files that the user is dragging |
x | the mouse x position, relative to this component |
y | the mouse y position, relative to this component |
Implements juce::FileDragAndDropTarget.
File FilenameComponent::getCurrentFile | ( | ) | const |
Returns the currently displayed filename.
String FilenameComponent::getCurrentFileText | ( | ) | const |
Returns the raw text that the user has entered.
|
virtual |
This can be overridden to return a custom location that you want the dialog box to show when the browse button is pushed. The default implementation of this method will return either the current file (if one has been chosen) or the location that was set by setDefaultBrowseTarget().
StringArray FilenameComponent::getRecentlyUsedFilenames | ( | ) | const |
Returns all the entries on the recent files list.
This can be used in conjunction with setRecentlyUsedFilenames() for saving the state of this list.
|
overridevirtual |
Callback to check whether this target is interested in the set of files being offered.
Note that this will be called repeatedly when the user is dragging the mouse around over your component, so don't do anything time-consuming in here, like opening the files to have a look inside them!
files | the set of (absolute) pathnames of the files that the user is dragging |
Implements juce::FileDragAndDropTarget.
|
overridevirtual |
Called to let the component react to a change in the look-and-feel setting.
When the look-and-feel is changed for a component, this will be called in all its child components, recursively.
It can also be triggered manually by the sendLookAndFeelChange() method, in case an application uses a LookAndFeel class that might have changed internally.
Reimplemented from juce::Component.
|
overridevirtual |
Components can override this method to draw over the top of their children.
For most drawing operations, it's better to use the normal paint() method, but if you need to overlay something on top of the children, this can be used.
Reimplemented from juce::Component.
void FilenameComponent::removeListener | ( | FilenameComponentListener * | listener | ) |
Removes a previously-registered listener.
|
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.
Changes the text shown on the 'browse' button.
By default this button just says "..." but you can change it. The button itself can be changed using the look-and-feel classes, so it might not actually have any text on it.
void FilenameComponent::setCurrentFile | ( | File | newFile, |
bool | addToRecentlyUsedList, | ||
NotificationType | notification = sendNotificationAsync |
||
) |
Changes the current filename.
newFile | the new filename to use |
addToRecentlyUsedList | if true, the filename will also be added to the drop-down list of recent files. |
notification | whether to send a notification of the change to listeners |
Sets a file or directory to be the default starting point for the browser to show.
This is only used if the current file hasn't been set.
void FilenameComponent::setFilenameIsEditable | ( | bool | shouldBeEditable | ) |
Changes whether the use can type into the filename box.
void FilenameComponent::setMaxNumberOfRecentFiles | ( | int | newMaximum | ) |
Changes the limit for the number of files that will be stored in the recent-file list.
void FilenameComponent::setRecentlyUsedFilenames | ( | const StringArray & | filenames | ) |
Sets all the entries on the recent files list.
This can be used in conjunction with getRecentlyUsedFilenames() for saving the state of this list.
Gives the component a tooltip.
Reimplemented from juce::SettableTooltipClient.