Neil Pate Posted February 20, 2019 Report Share Posted February 20, 2019 Does anybody know if it is possible to configure the path control so that when a user clicks the browse button the file dialogue that pops up has a custom filename pre-populated? You can do this easily with the dialogue prim, but I cannot figure out how to do this with the path control. I thought perhaps there would be an event that is fired off on browse, but it does not appear so. I suppose I could hide the browse button and replace it with a regular button... Quote Link to comment
Darren Posted February 20, 2019 Report Share Posted February 20, 2019 I don't think there's a way to do it. You'll need to make your own browse button. Quote Link to comment
Neil Pate Posted February 20, 2019 Author Report Share Posted February 20, 2019 Thanks, thats what I ended up doing. It works ok but a Windows bug causes the text to be pushed out of the control, so I had to then applying this fix: http://etchingpathways.blogspot.com/2012/07/labview-simulating-keyboard-events.html Quote Link to comment
Zou Posted February 21, 2019 Report Share Posted February 21, 2019 Can't you use property node=>Path Text=>Scroll Position instead? Quote Link to comment
Neil Pate Posted February 21, 2019 Author Report Share Posted February 21, 2019 The bug I mentioned is not in the LabVIEW control, it manifests in the Windows file explorer dialogue that pops up. Quote Link to comment
paul_cardinale Posted March 14, 2019 Report Share Posted March 14, 2019 Just set the default value of the control. Quote Link to comment
Neil Pate Posted March 14, 2019 Author Report Share Posted March 14, 2019 (edited) Just set the default value of the control. Does this work at runtime in an exe? I never thought to try this, thanks for the suggestion. The problem is I need to set the default value as soon as the browse button is pressed, not before. There is no event exposed that will trigger when the browse button is clicked. Edited March 14, 2019 by Neil Pate Quote Link to comment
Gribo Posted March 14, 2019 Report Share Posted March 14, 2019 (edited) You can try the mouse down event, then set the match pattern and start path. That fires before the browse window appears. Edited March 14, 2019 by Gribo Quote Link to comment
Neil Pate Posted March 14, 2019 Author Report Share Posted March 14, 2019 But mouse down fires off when the user clicks anywhere in the path, I am after just the browse button. I ended up replacing the button with my own one and it all works ok, just a bit of a bodge. Quote Link to comment
Gribo Posted March 14, 2019 Report Share Posted March 14, 2019 The next easiest alternative is to find the browse button's coordinates. Quote Link to comment
Neil Pate Posted March 14, 2019 Author Report Share Posted March 14, 2019 The next easiest alternative is to find the browse button's coordinates. Yup, and now we are way too deep in the rabbit hole. A standard boolean does pretty much exactly what I need it just does not have an icon on it. As soon a NI open sources LabVIEW we will be able to fix things like this 🙂 Quote Link to comment
Gribo Posted March 14, 2019 Report Share Posted March 14, 2019 I didn't know hell froze.. Quote Link to comment
paul_cardinale Posted March 15, 2019 Report Share Posted March 15, 2019 This works, but it uses a private property. Brs Btn Filter.vi 1 Quote Link to comment
ShaunR Posted March 15, 2019 Report Share Posted March 15, 2019 As soon a NI open sources LabVIEW we will be able to fix things like this 🙂 Well. You could make an XControl. 1 1 Quote Link to comment
Popular Post Neil Pate Posted March 15, 2019 Author Popular Post Report Share Posted March 15, 2019 Well. You could make an XControl. And then I have two problems... 1 1 2 Quote Link to comment
Darren Posted March 15, 2019 Report Share Posted March 15, 2019 This works, but it uses a private property. I've added that property to a list I'm maintaining of private properties/methods/events to move to public/scripting in a future LabVIEW release. 1 Quote Link to comment
Neil Pate Posted March 15, 2019 Author Report Share Posted March 15, 2019 This works, but it uses a private property. Brs Btn Filter.vi 7.24 kB · Cool, will try it out. Thank you. Quote Link to comment
ShaunR Posted March 18, 2019 Report Share Posted March 18, 2019 And then I have two problems... If that scares you then I don't give you good odds on "fixing" the LabVIEW source when it's released I've just written two XControls. (First time in about 6 years). They seem to be ok but some of the ways they work can be a bit unintuitive. Quote Link to comment
smithd Posted March 18, 2019 Report Share Posted March 18, 2019 (edited) I've just written two XControls. (First time in about 6 years). They seem to be ok but some of the ways they work can be a bit unintuitive. Coincidentally I just wrote a couple as well. I agree they seem OK for simple things, but the whole question of when and how they wake up makes them less usable. The main reason I want an Xcontrol is that a lot of things are combined controls+indicators. For example I have an indicator with the current value and the setpoint and some other stuff, and a control for the setpoint -- but you can't bind to user events, so you have to pick a proper 'direction' for the control and use a property for the other way and you end up having to marshal data around anyway. I don't hate them as much as I once did, but I don't like them. I think the q guy had it right, basically just grouping control references together and using standard functions to manipulate the group as one: https://sine.ni.com/nips/cds/view/p/lang/en/nid/214228 Edited March 18, 2019 by smithd Quote Link to comment
ShaunR Posted March 18, 2019 Report Share Posted March 18, 2019 (edited) Coincidentally I just wrote a couple as well. I agree they seem OK for simple things, but the whole question of when and how they wake up makes them less usable. The main reason I want an Xcontrol is that a lot of things are combined controls+indicators. For example I have an indicator with the current value and the setpoint and some other stuff, and a control for the setpoint -- but you can't bind to user events, so you have to pick a proper 'direction' for the control and use a property for the other way and you end up having to marshal data around anyway. I don't hate them as much as I once did, but I don't like them. I think the q guy had it right, basically just grouping control references together and using standard functions to manipulate the group as one: https://sine.ni.com/nips/cds/view/p/lang/en/nid/214228 Yeah mine were a little more obvious that an xcontrol was really the only elegant half-way decent solution. One was a string control with markup and the other was a tab control that works like the native one should. So it was really about encapsulation. Edited March 18, 2019 by ShaunR 1 Quote Link to comment
Neil Pate Posted March 18, 2019 Author Report Share Posted March 18, 2019 If that scares you then I don't give you good odds on "fixing" the LabVIEW source when it's released . Wow, glad I have my fireproof jacket on this morning! 🤣 Quote Link to comment
Rolf Kalbermatter Posted March 31, 2019 Report Share Posted March 31, 2019 (edited) On 3/14/2019 at 10:07 PM, Neil Pate said: Yup, and now we are way too deep in the rabbit hole. A standard boolean does pretty much exactly what I need it just does not have an icon on it. As soon a NI open sources LabVIEW we will be able to fix things like this 🙂 Why would you need an Open Sourced LabVIEW for something like that? This was possible in the Control editor since LabVIEW 3!!! (Discloser: the Browse button in the Path control was not added before somewhere around version 6 to 8 but the principle worked in LabVIEW 3). 1) Place a path control on your front panel 2) Right click on it and select Advanced->Customize => The path control opens in the control editor 3) Right click on the browse button and select Advanced->Customize => The browse boolean control opens in the control editor 4) Save this as your Browse Boolean.ctl file or whatever you want to call it. 5) Use as you wish and enjoy that it automatically adapts to the platform style for the system you run it on Browse.ctl Edited March 31, 2019 by Rolf Kalbermatter 2 Quote Link to comment
Neil Pate Posted March 31, 2019 Author Report Share Posted March 31, 2019 Nice solution Rolf, thanks! Quote Link to comment
ShaunR Posted March 31, 2019 Report Share Posted March 31, 2019 7 hours ago, Rolf Kalbermatter said: Why would you need an Open Sourced LabVIEW for something like that? This was possible in the Control editor since LabVIEW 3!!! (Discloser: the Browse button in the Path control was not added before somewhere around version 6 to 8 but the principle worked in LabVIEW 3). 1) Place a path control on your front panel 2) Right click on it and select Advanced->Customize => The path control opens in the control editor 3) Right click on the browse button and select Advanced->Customize => The browse boolean control opens in the control editor 4) Save this as your Browse Boolean.ctl file or whatever you want to call it. 5) Use as you wish and enjoy that it automatically adapts to the platform style for the system you run it on Browse.ctl 3.95 kB · 3 downloads There must be another step or perhaps an ini-key because customise is greyed out for the browse button on my installations. Quote Link to comment
Rolf Kalbermatter Posted April 1, 2019 Report Share Posted April 1, 2019 (edited) I thought it was not relevant when trying out things as I did various trials to get this working (The Control Editor has "particular" behaviour and controls easily can get in a weird state where for instance some of the parts end up in places where they seem not selecatable anymore in the customize mode, they still are but the position where you need to click to select them doesn't match the position on the front panel where they really appear.) 2) Right click on it and select Advanced->Customize (or double click) => The path control opens in the control editor 2.5) Change to Customize mode (click on the Allen key which then changes to a pincer) 3) Right click on the browse button and select Advanced->Customize Double click on the Browse button => The browse boolean control opens in the control editor For step 2) double click and step 3) you might need to have the option enabled to open the custom control editor on double click, which is one of the first things I always enable when installing a new LabVIEW version, right after disabling auto tool and auto wire routing 🤢. Edited April 1, 2019 by Rolf Kalbermatter Quote Link to comment
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.