Tab control - right click menu
#1
Posted 14 August 2012 - 01:27 PM
Thanks.
#2
Posted 14 August 2012 - 02:37 PM
You could alternatively place transparent controls above each tab to replace and expand the in-built behaviour, or hide the tabs and just use buttons shaped to look like tabs. Not as elegant as getting the info from the tab control itself, but off the top of my head that's the options I can think of.
Edited by Mads, 14 August 2012 - 02:40 PM.
#3
Posted 14 August 2012 - 02:47 PM
need to set the tab-page to fixed:
If you cannot live with the tabpages of fixed length, you could detect the width-algorithm that LabVIEW is using by debugging. Using the string-picture VIs you could get some info.
Ton
#4
Posted 15 August 2012 - 08:03 AM
If you cannot live with the tabpages of fixed length, you could detect the width-algorithm that LabVIEW is using by debugging. Using the string-picture VIs you could get some info.
That's only a feasable option if you have full control over the font used. If you plan to distribute the app to other computers, even if you are able to control their configuration completely up to what fonts get installed and what fonts LabVIEW defaults to, it's definitely a lot more hassle than you care to ever have.
Rolf Kalbermatter
CIT Engineering Netherlands
A division of Test & Measurement Solutions
#5
Posted 16 August 2012 - 01:50 AM
Here is an example on how i can work out the right click is on the tab1 label or not.
Attached Files
#6
Posted 16 August 2012 - 06:34 AM
#7
Posted 17 August 2012 - 06:16 PM
Thanks.
Ton,
Could you post your vi so I can test it?
Thanks!
#8
Posted 17 August 2012 - 06:20 PM
It's a VI snippet. Save it to your computer and drag it into LabVIEW.Ton,
Could you post your vi so I can test it?
Thanks!
#9
Posted 17 August 2012 - 06:31 PM
It finally worked, I had to right click and save target. Although I've been using Labview for a long time, I didn't really use snippets before. Thanks.
#10
Posted 17 August 2012 - 06:57 PM
Thanks again to everyone.
#11
Posted 17 August 2012 - 08:16 PM
For some reason the VI snippet is showing up as an image.
It finally worked, I had to right click and save target. Although I've been using Labview for a long time, I didn't really use snippets before. Thanks.
I believe in LAVA the image in a forum post is a thumbnail and you can either 'save target' like you did, or click on the image and then 'save image'.
Lead Software Engineer
Certified LabVIEW Developer
#12
Posted 20 August 2012 - 09:03 AM
This doesn't work when you have a page selector, I need that since the user is dynamically adding pages up to 25 windows. However, I am going to use this method to only allow a right click when the user right clicks the selected page.
Thanks again to everyone.
If the right-click is only supposed to work if it is on the selected page, do you really need to detect which *tab* was clicked? You can just assume that if the tab control as a whole was right-clicked then that is a right-click on the current page. No need to fiddle with finding out if the user for some reason hit another tab just to not react to it. Any right-click will lead to an action related to the current page. That is probably easier for the user to comprehend than if the right-click in some cases just does not give any response.
Again - this would also be consistent with other GUIs - which do not react to right-clicks on tabs, but might have a menu associated with the tab page or control as a whole.
#13
Posted 20 August 2012 - 06:10 PM
Opera reacts differently for the right mouse button per tab-indicator.Again - this would also be consistent with other GUIs - which do not react to right-clicks on tabs, but might have a menu associated with the tab page or control as a whole.
Ton
#14
Posted 21 August 2012 - 05:40 AM
Opera reacts differently for the right mouse button per tab-indicator.
Ton
Regardless, there is an established behavior that would make this approach, well, approachable.
Lead Software Engineer
Certified LabVIEW Developer
#15
Posted 21 August 2012 - 07:13 AM
Regardless, there is an established behavior that would make this approach, well, approachable.
Personally I would say it's not established enough to be intuitive to the user. But hey, if the users of this particular app expect it to work that way, then that's great.
The general rule though should be that if it is possible to implement in a more established way then do that. You can always add a non-standard way as a second option for people to use if they prefer it, but not as the only option. A lot of people have the habit of trying to change GUI behaviour to something "better" - ignoring the fact that the cost of forcing people to change their behaviour from what they know and expect is huge - and seldom worth paying. That's why I asked the question of what the goal with the right-click menu is in this case. If the goal should turn out to be achievable in a more standard way then that should be prioritized over the perhaps "cooler" alternative (Not knowing the use case here the standard way might even turn out to be the coolest).













