Source language: Translate to:

Multiple file mask options w/ FileSaveBox & FileOpenBox

NeoBook tips, tricks, code samples and more...

Moderator: Neosoft Support

Multiple file mask options w/ FileSaveBox & FileOpenBox

Postby smokinbanger » Thu Aug 30, 2012 2:46 pm

The Help file has some basic information about the FileSaveBox & FileOpenBox commands but doesn't really indicate any multiple file mask options. When file masks are implemented according to the help file, the drop down box on the File Open and file Save dialogs will only have one (1) file extension type listed. However there may be times you wish to allow the user to select from one of multiple file types/extensions, i.e. image file extentions .jpg, .png, or .bmp. So after doing a little trial and error here is what I came up with; you can mask the selection to multiple extension by seperating the extensions with a semicolon ( ; ). Also to add additional selection options to the drop down box at the bottom of the File open and Save dialog boxes, use a another pipe charactor (|) and enter another selection option following it. Here are a few examples, try them out:

Code: Select all
FileSaveBox "Select Desktop Background File" "Image File (*.bmp, *.gif, *.jpg, *.png, *.tif)|*.bmp;*.gif;*.jpg;*.png;*.tif|PNG File (*.png)|*.png|Jpeg File (*jpg)|*.jpg|Text File (*.txt, *.rtf)|*.txt;*.rtf|Any File|*.*" "" "[filesave]"
Code: Select all
FileOpenBox "Select Desktop Background File" "Image File (*.bmp, *.gif, *.jpg, *.png, *.tif)|*.bmp;*.gif;*.jpg;*.png;*.tif|PNG File (*.png)|*.png|Jpeg File (*jpg)|*.jpg|Text File (*.txt, *.rtf)|*.txt;*.rtf|Any File|*.*" "" "[fileopen]" ""

Good luck!
smokinbanger
 
Posts: 198
Joined: Mon Jan 16, 2012 9:53 am
Location: United States

Postby dec » Thu Aug 30, 2012 3:42 pm

Hello,

In fact you found the standard Windows way to define the standard open and save file dialogs "Filter" property, as you can read, for example, in this documentation. If you wanted other options, like specify the "filter index" and others, take a look at the npOpenFileDialog action from my npUtil plugin. ;)
.
Enhance your NeoBook applications!
.
57 plugins, 1113 actions and 230 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Postby smokinbanger » Thu Aug 30, 2012 4:27 pm

dec wrote:Hello,

In fact you found the standard Windows way to define the standard open and save file dialogs "Filter" property, as you can read, for example, in this documentation.
Leave it to me to figure it out the hard way :roll:
dec wrote:If you wanted other options, like specify the "filter index" and others, take a look at the npOpenFileDialog action from my npUtil plugin. ;)
Reordering the filter mask will set the order shown in the dialog, the first will be default, however it won't return the filter index.
smokinbanger
 
Posts: 198
Joined: Mon Jan 16, 2012 9:53 am
Location: United States

Postby dec » Thu Aug 30, 2012 4:50 pm

Hello,

smokinbanger wrote:Leave it to me to figure it out the hard way :roll:


I can remember my hard way days on this too. Because this I write on this post. ;)
.
Enhance your NeoBook applications!
.
57 plugins, 1113 actions and 230 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Postby David de Argentina » Thu Aug 30, 2012 8:05 pm

User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby smokinbanger » Thu Aug 30, 2012 8:51 pm

David de Argentina wrote:http://www.neosoftware.com/forum/viewtopic.php?t=16386

search link is impressive !!! ;-)

Like I said:
smokinbanger wrote:Leave it to me to figure it out the hard way :roll:

I think it would be a good idea to have an online version of the help documentaion that could be updated with these small tips occasionally. It would be very simple. Even a wiki version. 8) I could also see a cool little app that could automatically update the local version on your PC from the official online version :idea: I could see how this would be very useful as I can think of a couple dozen tips n tricks native to Neobook that are not mentioned in the help doc. Then the only trick would be to get people like me to actually READ it! :lol:
smokinbanger
 
Posts: 198
Joined: Mon Jan 16, 2012 9:53 am
Location: United States

Postby dec » Thu Aug 30, 2012 10:08 pm

smokinbanger wrote:Then the only trick would be to get people like me to actually READ it! :lol:


:D
.
Enhance your NeoBook applications!
.
57 plugins, 1113 actions and 230 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Postby dpayer » Fri Aug 31, 2012 6:43 am

dec wrote:
smokinbanger wrote:Then the only trick would be to get people like me to actually READ it! :lol:


:D



You know, if I focus elsewhere for a couple months and then try to code something, my brain is like jelly :)

I need to re read the entire helpfile again to get reoriented!

D
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Postby smokinbanger » Fri Aug 31, 2012 2:33 pm

dpayer wrote:You know, if I focus elsewhere for a couple months and then try to code something, my brain is like jelly :)

I need to re read the entire helpfile again to get reoriented!

D

That sounds a bit familiar! :lol:
smokinbanger
 
Posts: 198
Joined: Mon Jan 16, 2012 9:53 am
Location: United States


Return to NeoBook Knowledgebase

Who is online

Users browsing this forum: No registered users and 1 guest