07-31-2012 03:54 AM
Hi all,
I'm looking to design the coolest and smartest way to add help functionnality to an application.
What I would like : the user push on F1, and click on any control//indicator on my application and this open a web page depending on where he clicked.
=> The problem is that it requires an event "application: mouse down", which doesn't exists.
Coding events for each control//indicator would be too long, and not clean in my code !
Any idea ?
P.S : It could be a great idea to forbid the word "help" in message object such as "I need Help" or "Help to do..."
07-31-2012 04:57 AM
@ramses64 wrote:
.....The problem is that it requires an event "application: mouse down", which doesn't exists....
The Mouse Down Event does exist! For almost all Frontpanel Elements.
Christian
07-31-2012 05:59 AM
You can make a combined event case for all your controls on Mouse Enter, which basically just remembers which control you're hovering over (e.g. store the control Label). When pressing F1, a helpfile about this Label is shown.
/Y
07-31-2012 06:31 AM - edited 07-31-2012 06:32 AM
Hi,
For an application with cluster of clusters of arrays of bools//int//datetime... etc, it's verry borring to create a mouse enter for each control//indicator.
And this solution is only for a vi, not for an application (with several user interface VIs)...
Christian : I don't search "mouse down event" for each element, i search "APPLICATION: mouse down"...
07-31-2012 07:39 AM - edited 07-31-2012 07:39 AM
@ramses64 wrote:
Christian : I don't search "mouse down event" for each element, i search "APPLICATION: mouse down"...
Applications don't receive mouse down events. Windows do. Thus, a MouseDown event would be tied to a GUI element, such as a control/indicator, or the window's pane.
07-31-2012 08:06 AM
So what could be the better way to implement a html help for my application ?
07-31-2012 08:16 AM
I never implied your method was bad. You said you were looking for the Application:MouseDown event and said it didn't exist, and I explained why. If you want to implement using your method I would suggest registering the MouseDown event for all your controls/indicators. You do not need to do this one-by-one, and you only need one event case. Look at the shipping example that deals with dynamically registering for events. That example shows how to register the mouse down event for all front panel controls/indicators.
07-31-2012 08:19 AM
@ramses64 wrote:
Hi,
For an application with cluster of clusters of arrays of bools//int//datetime... etc, it's verry borring to create a mouse enter for each control//indicator.
And this solution is only for a vi, not for an application (with several user interface VIs)...
Christian : I don't search "mouse down event" for each element, i search "APPLICATION: mouse down"...
You do know you can have 1 event for several items?
Attached is a simple and sloppy example, it'd be easy to complement with a AE to keep the label and also clear it on mouse leave event.
/Y
07-31-2012 08:23 AM
Hi smercurio,
I tried to register a dynamically event :
but this doesn't work : it only works for 1rst level controls (if a cluster is in a tab control, the cluster doesn't appears in references).
I should do a reccursive method to list all controls, but I think this wouldn't work : when you click on a cluster, this will give the reference of the cluster, and not of the control included in the cluster...
Thanks for your help !
07-31-2012 08:34 AM - edited 07-31-2012 08:34 AM
Hi Yamaeda,
your exemple well works, BUT (there is always a but ! :-))
- this is for a VI (I have to implement this in all my user interfaces)
- this is for simple controls, not for clusters of clusters of arrays of clusters...etc...
- for a large application, I will have to list items one by one on the event structure...
Best Regards,