quote:
Originally posted by whiz
quote:
Originally posted by mynetx
Use a system dialog for opening and saving files. This allows easy selection of files without having to know their names. You can find more information about Common Dialogs at MSDN.
jscript code:
cd = new ActiveXObject("MSComDlg.CommonDialog"); // create the object
cd.Filter = "All Files(*.*)|*.*|JScript Files(*.js)|*.js"; // set file filter
cd.FilterIndex = 2;
cd.MaxFileSize = 128; // must set MaxFileSize. otherwise you will get an error
cd.ShowOpen(); // show it to user
file = cd.FileName; // retrieve file + path
if (!file) { // If the user does enter file exit
MsgPlus.DisplayToast("", "You must enter a file name");
}
else {
MsgPlus.DisplayToast("", "The user selected:\n" + file );
}
I've just tested that, but it doesn't seem to work on initialization:
code:
From the Script Debugger
Script is starting
Error: unknown (code: -2147221230)
File: FnInitialization.js. Line: 1.
Script has failed to start
Something wrong with the ActiveX object?
Yes, you do not have the proper design license.
I strongly suggest not to use that ActiveX, but instead use the proper Windows API.
See:
CookieRevised's reply to UserAccounts.CommonDialog alternative for Vista
and "cd = " should be "var cd ="
Also (@mynetx):
quote:
cd.MaxFileSize = 128; // must set MaxFileSize. otherwise you will get an error
128 is waaaaaaaay to low. The MaxFileSize is the maximum path length, this should at least be 260, like it is defined in Windows (=MAXPATH). So, a value like 2048 should be given on current systems.
quote:
Originally posted by whiz
quote:
Originally posted by mynetx
- Remove the help tooltip from the ListView listing all Controls/elements. The tooltip is needed for hovering ellipsed items in the grid.
Removed. But what do you mean by "ellipsed items"? Do you mean a tooltip for each window/control/element with extra details?
Ellipsed items are items which are too long to be displayed on one line. As such, the are cropped and "..." (an ellipsis) is added to the end. With default Windows behaviour, when you hover over such items a tooltip will pop up showing the complete line.
However, that does not mean you should not display a tooltip when items do fit in the available space. Common practice is to always show a tooltip when hovering over items (too long or not), when at least one item is too long to be displayed.