CtrlLib: FileSel improvements

git-svn-id: svn://ultimatepp.org/upp/trunk@13515 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2019-07-30 11:41:26 +00:00
parent 85cbb3ea2c
commit 1dddceb8e3
2 changed files with 16 additions and 0 deletions

View file

@ -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; }

View file

@ -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