paulohpbh Posted May 1, 2010 Report Posted May 1, 2010 I'd like to put multiple lines with different patterns in the LabView File Dialog such as the picture below... How I do this? Are there any way to "All Files" not appear? Thanks Quote
Yair Posted May 1, 2010 Report Posted May 1, 2010 Cross post. It's considered polite to link to the other thread if you're cross posting to save people time. Quote
MikaelH Posted May 3, 2010 Report Posted May 3, 2010 Cross post. It's considered polite to link to the other thread if you're cross posting to save people time. This is how I do it: Click on the image to view it better. Cheers, Mikael Quote
asbo Posted May 3, 2010 Report Posted May 3, 2010 Just a sidenote, even if you remove the "All Files" selector, a user can still display all files by typing "*.*" into the field and pressing Enter (on Windows, anyway). Quote
MikaelH Posted May 3, 2010 Report Posted May 3, 2010 (edited) Let's see if this image looks better: How it works better... The \00 is the NULL chracter, you have to switch to '\' Coded Display, to get it working. This is the string you can use to tweak the File Dialog bevaviour. *.txt;*.doc;*.html)\00*.txt;*.doc;*.html;\00Image\sfiles\s(*.png;*.jpg)\00*.png;*.jpg\00\00 I'm not sure why it works, and if it always will be supported but it's quite good feature. //Mikael Edited May 3, 2010 by MikaelH 1 Quote
asbo Posted May 4, 2010 Report Posted May 4, 2010 *.txt;*.doc;*.html)\00*.txt;*.doc;*.html;\00Image\sfiles\s(*.png;*.jpg)\00*.png;*.jpg\00\00 I'm not sure why it works, and if it always will be supported but it's quite good feature. That's the format of a string which can be passed right into Windows API for a common Open/Close/Save dialog (anyone who's used Visual Basic or CMNDLG32.DLL should recognize it), so it won't be changing anytime soon. I only presume that NI works some magic in the background to ensure cross-platform compatibility, but I have no particular experience myself. Quote
Norm Kirchner Posted May 5, 2010 Report Posted May 5, 2010 I know it still says *.* all files, but how does this fit your bill <a href="http://content.screencast.com/users/NJKirchner/folders/Jing/media/d00d39d8-7634-4949-bef6-fdbbbce48a26/2010-05-05_1210.png"><img'>http://content.screencast.com/users/NJKirchner/folders/Jing/media/d00d39d8-7634-4949-bef6-fdbbbce48a26/2010-05-05_1210.png"><img class="embeddedObject" src="http://content.screencast.com/users/NJKirchner/folders/Jing/media/d00d39d8-7634-4949-bef6-fdbbbce48a26/2010-05-05_1210.png" width="509" height="312" border="0" /></a> <a href="http://content.screencast.com/users/NJKirchner/folders/Jing/media/164a2592-2d5a-4740-8401-7014f8b58bbf/2010-05-05_1210.png"><img'>http://content.screencast.com/users/NJKirchner/folders/Jing/media/164a2592-2d5a-4740-8401-7014f8b58bbf/2010-05-05_1210.png"><img class="embeddedObject" src="http://content.screencast.com/users/NJKirchner/folders/Jing/media/164a2592-2d5a-4740-8401-7014f8b58bbf/2010-05-05_1210.png" width="733" height="296" border="0" /></a> Tool - File Dialog_Multi Patern.vi Quote
Rolf Kalbermatter Posted May 7, 2010 Report Posted May 7, 2010 That's the format of a string which can be passed right into Windows API for a common Open/Close/Save dialog (anyone who's used Visual Basic or CMNDLG32.DLL should recognize it), so it won't be changing anytime soon. I only presume that NI works some magic in the background to ensure cross-platform compatibility, but I have no particular experience myself. I haven't tried this but would strongly guess, that this is really just a Windows feature and by coincidence rather than by design. If it was designed that way they certainly would have made it more user friendly. Quote
asbo Posted May 11, 2010 Report Posted May 11, 2010 ... this is really just a Windows feature and by coincidence ... Agreed. Quote
fabric Posted March 14, 2024 Report Posted March 14, 2024 I've enjoyed this hack for many years, but noticed it is not working in LV2023Q1. See here for problem description: https://forums.ni.com/t5/LabVIEW/Darren-s-Weekly-Nugget-05-10-2010/m-p/4360614/highlight/true#M1280554 Quote
ShaunR Posted March 14, 2024 Report Posted March 14, 2024 8 hours ago, fabric said: I've enjoyed this hack for many years, but noticed it is not working in LV2023Q1. See here for problem description: https://forums.ni.com/t5/LabVIEW/Darren-s-Weekly-Nugget-05-10-2010/m-p/4360614/highlight/true#M1280554 They have fixed a bug, is my guess. Concatenating by using null char is a huge security smell. Multiple file types are [supposed to be] defined by using the semicolon separator. Does "*csv;*txt" not work? Quote
X___ Posted March 14, 2024 Report Posted March 14, 2024 LabVIEW's motto: Move slowly and break things! Quote
Rolf Kalbermatter Posted March 14, 2024 Report Posted March 14, 2024 (edited) 27 minutes ago, X___ said: LabVIEW's motto: Move slowly and break things! Not really. And this is a very clear case of using an undocumented and unintended side effect of the implementation. It only worked on Windows and not any other platform and only because the person who implemented the file dialog functionality took a shortcut by passing the LabVIEW string directly to the Windows API without trying to sanitize it. Microsoft discourages the use of the GetOpenFileName and GetSaveName APIs which originate from Windows 3.0 times starting with Windows Vista, and recommends to use the Common Item Dialog instead. My guess is that someone did recently listen to that recommendation and changed the file dialog implementation accordingly. Making sure it works the same way as documented for the old function is already hard enough, trying to also implement undocumented functionality and potential security bugs which this API had, is a bit to much asked. Edited March 14, 2024 by Rolf Kalbermatter Quote
Darren Posted March 14, 2024 Report Posted March 14, 2024 The multiple patterns nugget was broken in LabVIEW 2023 Q1, but it works in LabVIEW 2023 Q3 and later. 1 Quote
Rolf Kalbermatter Posted March 15, 2024 Report Posted March 15, 2024 On 3/14/2024 at 8:25 PM, Darren said: The multiple patterns nugget was broken in LabVIEW 2023 Q1, but it works in LabVIEW 2023 Q3 and later. I would actually suggest to implement it properly by extending the File Dialog Node. A double NULL terminated string array that is simply passed to a Windows API function is hardly a safe and proper LabVIEW datatype! 😁 And of course you saw it already coming, add support for that on Linux too 😁 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.