class

Opal::UI::FileDialog

Inherits Opal::UI::Control < Opal::UI::InputHookable < Opal::UI::Element < Opal::UI::Themable < Reference < Object

Interactive file and directory picker with directory traversal, file type filters, save file mode, new file/folder creation, theme compliance, and full mouse hit detection.

Constructors

new(initial_path : String = ".", mode : Symbol = :open_file, show_hidden : Bool = false, filters : Array(String) = [] of String, filter_presets : Array(Tuple(String, Array(String))) = [] of ::Tuple(String, Array(String)), preview_fn : Proc(String, String) | Nil = nil)
Source

Instance methods

active_filter_idx
Source
active_filter_idx=(active_filter_idx : Int32)
Source
append_char(ch : Char) : Nil
Source
backspace
Source
canceled?
Source
change_directory(new_path : String) : Nil
Source
confirm_folder(folder_path : String = @current_path) : Bool
Source
confirmed?
Source
current_filter_extensions

Returns active file extensions allowed by the current filter preset or filter list

Source
current_path
Source
cursor
Source
cursor=(cursor : Int32)
Source
cursor_down
Source
cursor_up
Source
cycle_filter
Source
entries
Source
filename_input

Filename input for save / new file modes

Source
filename_input=(filename_input : String)

Filename input for save / new file modes

Source
filter_presets
Source
filter_presets=(filter_presets : Array(Tuple(String, Array(String))))
Source
filter_query
Source
filter_query=(filter_query : String)
Source
filtered_entries
Source
filters

File type filters (e.g. [".cr", ".json"])

Source
filters=(filters : Array(String))

File type filters (e.g. [".cr", ".json"])

Source
go_up
Source
handle_key(key : Terminal::KeyEvent) : Bool

Default key event handler. Override in subclasses if not using @default_input_proc.

Source
handle_mouse(event : Terminal::MouseEvent) : Bool

Default mouse event handler. Override in subclasses if not using @default_input_proc.

Source
load_entries(dir_path : String = @current_path) : Nil
Source
mode
Source
mode=(mode : Symbol)
Source
open_selected
Source
overwrite_warning=(overwrite_warning : Bool)
Source
overwrite_warning?
Source
page_down(lines : Int32 = 10) : Nil
Source
page_up(lines : Int32 = 10) : Nil
Source
preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32)
Source
preview_fn
Source
preview_fn=(preview_fn : Proc(String, String) | Nil)
Source
render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
Source
selected_entry
Source
selected_path
Source
show_hidden?
Source
toggle_hidden
Source
validation_error
Source
validation_error=(validation_error : String | Nil)
Source