Class FilePathBox
- Namespace
- PluginUI
- Assembly
- PluginUI.dll
Path field with a browse button: shows the path with a middle ellipsis, opens the native file/folder dialog and accepts files dropped from Explorer (sample loaders, IR loaders, export folders).
public class FilePathBox : Control
- Inheritance
-
FilePathBox
- Inherited Members
Constructors
FilePathBox()
Creates a path box.
public FilePathBox()
Properties
DefaultExtension
Default extension for SaveFile (without dot).
public string? DefaultExtension { get; set; }
Property Value
DefaultSize
Natural size used when no explicit size is given.
protected override Size DefaultSize { get; }
Property Value
DialogTitle
Title of the file dialog (null = localized FileDialogTitle, "Select").
public string? DialogTitle { get; set; }
Property Value
Filters
File type filters of the dialog.
public IReadOnlyList<FileFilter>? Filters { get; set; }
Property Value
Mode
Selection mode.
public FilePathMode Mode { get; set; }
Property Value
Path
Selected path (null = none).
public string? Path { get; set; }
Property Value
Placeholder
Text shown when no path is selected (null = localized NoFile, "No file").
public string? Placeholder { get; set; }
Property Value
ShowFileNameOnly
Shows only the file name instead of the full path.
public bool ShowFileNameOnly { get; set; }
Property Value
Validate
Validates dropped or chosen paths (default: existing file for files, existing folder for folders, and the extension list of Filters).
[Browsable(false)]
public Func<string, bool>? Validate { get; set; }
Property Value
Methods
Browse()
Opens the dialog for the current mode.
public void Browse()
MiddleEllipsis(string, TextStyle, float)
Shortens text with "…" in the middle so that it fits maxWidth.
protected string MiddleEllipsis(string text, TextStyle style, float maxWidth)
Parameters
Returns
OnCaptureLost()
The mouse capture was lost without a button release.
protected override void OnCaptureLost()
OnFilesDropped(FilesDroppedEventArgs)
Files dropped from the shell (requires AllowFileDrop on this element or an ancestor).
protected override void OnFilesDropped(FilesDroppedEventArgs e)
Parameters
OnKeyDown(KeyEventArgs)
Key pressed while focused (bubbles to parents).
protected override void OnKeyDown(KeyEventArgs e)
Parameters
OnMouseDown(MouseEventArgs)
Mouse button pressed over the element (or captured).
protected override void OnMouseDown(MouseEventArgs e)
Parameters
OnMouseLeave()
The mouse left the element.
protected override void OnMouseLeave()
OnMouseMove(MouseEventArgs)
Mouse moved over the element (or captured).
protected override void OnMouseMove(MouseEventArgs e)
Parameters
OnMouseUp(MouseEventArgs)
Mouse button released.
protected override void OnMouseUp(MouseEventArgs e)
Parameters
RenderVector(DrawingContext, Rect, VectorStyle)
Vector rendering of the widget area.
protected override void RenderVector(DrawingContext dc, Rect widget, VectorStyle style)
Parameters
dcDrawingContextwidgetRectstyleVectorStyle
Events
PathChanged
Raised when the path changes (dialog, drop or code).
public event Action<FilePathBox, string?>? PathChanged