diff --git a/uppsrc/CtrlLib/FileSel.h b/uppsrc/CtrlLib/FileSel.h index 802a55dfb..ffe91ae5b 100644 --- a/uppsrc/CtrlLib/FileSel.h +++ b/uppsrc/CtrlLib/FileSel.h @@ -1,3 +1,5 @@ +#define FILESELVERSION 2 + Image GetDriveImage(char drive_style); Image GetFileIcon(const char *path, bool dir, bool force = false); @@ -316,6 +318,8 @@ public: FileSel& ActiveType(int i); FileSel& PreSelect(const String& path); FileSel& DefaultExt(const char *ext) { defext = ext; return *this; } + FileSel& Sort(int kind) { sortby.SetData(kind); return *this; } + FileSel& Columns(int n) { list.Columns(n); return *this; } FileSel& Multi(bool b = true) { multi = b; return *this; } FileSel& ReadOnlyOption(bool b = true) { rdonly = b; return *this; } FileSel& MkDirOption(bool b = true) { mkdir.Show(b); return *this; } diff --git a/uppsrc/CtrlLib/src.tpp/FileSel_en-us.tpp b/uppsrc/CtrlLib/src.tpp/FileSel_en-us.tpp index a0787719e..1c1e9c811 100644 --- a/uppsrc/CtrlLib/src.tpp/FileSel_en-us.tpp +++ b/uppsrc/CtrlLib/src.tpp/FileSel_en-us.tpp @@ -195,6 +195,18 @@ xt]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 ext])&] is specified.&] [s3; &] [s4; &] +[s5;:Upp`:`:FileSel`:`:Sort`(int`): [_^Upp`:`:FileSel^ FileSel][@(0.0.255) `&]_[* Sort]([@(0.0.255) i +nt]_[*@3 kind])&] +[s2;%% Sets the sorting mode, [%-*@3 kind] can be one of FILELISTSORT`_NAME, +FILELISTSORT`_EXT, FILELISTSORT`_TIME, FILELISTSORT`_SIZE, potentially +combined (with binary or) with flag FILELISTSORT`_DESCENDING.&] +[s3;%% &] +[s4; &] +[s5;:Upp`:`:FileSel`:`:Columns`(int`): [_^Upp`:`:FileSel^ FileSel][@(0.0.255) `&]_[* Column +s]([@(0.0.255) int]_[*@3 n])&] +[s2;%% Sets the number of columns.&] +[s3;%% &] +[s4; &] [s5;:FileSel`:`:Multi`(bool`): [_^FileSel^ FileSel][@(0.0.255) `&]_[* Multi]([@(0.0.255) bool ]_[*@3 b]_`=_[@(0.0.255) true])&] [s2;%% In this mode, more than single file can be selected. Default