LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

show text when user move mouse over a listbox item

hi iam using LabWindows CVi 7.0
how to display text when user move mouse over a listbox item
 
regds
SKS
0 Kudos
Message 1 of 6
(4,622 Views)
A "static" text can be displayed when the mouse is on a control by using SetCtrlToolTipAttribute (, , CTRL_TOOLTIP_ATTR_ENABLE, );
 
In case you want a "dynamic" text (i.e. some text related to the individual listbox item the mouse is on) you could use the extended mouse events (EnableExtendedMouseEvents command) and trap the position of the mouse from time to time: when the control callback fires on EVENT_MOUSE_MOVE event you can determine mouse position based on eventDataX values and discriminate the line the mouse is on, next display a proper message (or maybe change the tooltip text on the fly so that text is displayed only when the mouse stops for a while).


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 6
(4,615 Views)

hi roberto

it doesnt work..iam working on LabWindows/CVI 7.0

when i search the command SetCtrlToolTipAttribute it was not there

and also when i try to find EnableExtendedMouseEvents it was also not found..

so guide me how to use it in CVI 7.0 and iam using the userinterface in VC++ 6.0 ..

tell me how to set tooltip from VC++ for userinterface which i suppose to develop

in LabWindows/CVI 7.0

waiting for ur reply

regds

SKS

0 Kudos
Message 3 of 6
(4,612 Views)
EnableExtendedMouseEvents is present even in version 6 of CVI: I don't know why you cannot find it in you installation. Regarding tooltips, they were originally distributed as a separate instrument (tooltip.fp), in my 7.1 installation are included in the User Interface library: I don't know when they were integrated in the CVI IDE but you should find them.
 
Unfortunately I cannot help in the interaction with VC++ since I never used this product.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 4 of 6
(4,610 Views)
Just to clarify my last post, given in the hurry of lunch break ( Smiley Wink ), both EnableExtendedMouseEvents and SetCtrlToolTipAttribute are located in the Programmer's Toolbox ( \toolslib\toolbox\toolbox.fp 😞 I suggest you to load this instrument library that is plenty of useful resources that saved me a lot of work during time. I regularly load it in the library menu in every project ( Library\Customize... menu item and browse to the directory), but if you prefer you can load it in the Instrument menu as well.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 6
(4,593 Views)

If you want to display the same text every time the mouse is over any part of the listbox (for example, some help text that explains generally what the list as a whole is comprised of), then you'll want to use SetCtrlToolTipAttribute.

However, if you want to display the text of an individual listbox item (for example, if the text is too long and is cut off by the boundaries of the listbox control) when the mouse is over a particular listbox item, then you should use a tree instead of a listbox. You can configure the tree to look just like a listbox, and one of the extra features in the tree that you don't get with the listbox is this kind of tooltip. Check out this post to see an example of how to configure the tree to look like a listbox. You can use the same API with the tree as you do with the listbox, so you wouldn't have to change much of your code.

http://forums.ni.com/ni/board/message?board.id=180&message.id=13541#M13541

Hope this helps,

- jared

0 Kudos
Message 6 of 6
(4,581 Views)