FileSel: PreSelect improved (now supports SaveAs, file type now set correctly)

git-svn-id: svn://ultimatepp.org/upp/trunk@13495 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2019-07-15 08:33:43 +00:00
parent 568e93b281
commit 7a6958da7d

View file

@ -1763,6 +1763,14 @@ bool FileSel::Execute(int _mode) {
px += dp;
}
dir.HSizePos(dr.left, px + 4);
if(preselect.GetCount()) {
for(int i = 0; i < mask.GetCount(); i++) {
if(PatternMatchMulti(mask[i], preselect)) {
ActiveType(i);
break;
}
}
}
int q = type.FindValue(activetype);
if(q >= 0)
type <<= q;
@ -1782,12 +1790,15 @@ bool FileSel::Execute(int _mode) {
}
list.SetSbPos(lastsby);
if(preselect.GetCount()) {
for(int i = 0; i < list.GetCount(); i++)
if(list[i].name == preselect) {
list.SetCursor(i);
ActiveFocus(list);
break;
}
if(mode == SAVEAS)
file <<= preselect;
else
for(int i = 0; i < list.GetCount(); i++)
if(list[i].name == preselect) {
list.SetCursor(i);
ActiveFocus(list);
break;
}
preselect.Clear();
}
FileUpdate();