LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

odd numeric indicator control behavior

I have several questions regarding numeric indicator control behavior in labwindows. I am running cvi v7 on win xp, but noted similar behavior on cvi v6 on win 2000.

1. Is it possible to lock out controls from being selected if they are just indicators? By this I mean that with the application running, a user can point and click on an indicator, and even though nothing may happen, a hashed line indicating "selected" will show up around the control. Is this preventable?

2. I included .uir and .c code demonstrating this. Several things are happening here. I am using a numeric indicator as a button to bring up a settings popup, which when "OK" is hit, returns the value to the original indicator.
2a. After the value is returned to the original indicator with the callback function's return, I noticed that the cursor is still in the indicator field. Is there any way to remove the cursor from this control programmatically?
2b. I also noted that if the mouse is moved around, the value within the indicator field may highlight. Can this highlight be prevented?
2c. With the cursor still in the indicator field, if the user wanted to set the value again, it sometimes takes 1,2,or 3 mouse clicks on the indicator to get the "event_left_click" callback to occur. Should I be using a different event, or is there some problem with the cursor still in the indicator? Sometimes the first click selects the indicator title, the second click highlights the value, and the third click brings up the popup panel.
2d. I saw an odd ctrl-v paste functionality on numeric controls. I noted that if one indicator was highlighted, ctrl-c was pressed, then the other numeric control selected and ctrl-v pressed that a constant string went momentarily into the other control, until the control was deselected and its double value went back. I since realized that this string was coming from the clipboard. Can this ctrl-v paste function be turned off for controls programmatically?

3. Different line of questioning. When using the predefined popup panels I noted that a small labwindows icon shows up on the top left of the title bar. Can this icon be removed? The icon also shows up when using a custom panel if it is loaded with "Installpopup()."

Thanks for any answers to the above questions.
Download All
0 Kudos
Message 1 of 2
(2,897 Views)
Hi Phil,

I think I have some information that can clarify some of these questions:
Short Answer: To have an indicator have no interaction at all with the user you can swallow the event (just return any number other than 1 in the callback) and the control will never know of any user interaction.

To disable the Ctrl+V functionality in a control you would need to catch the Windows message (not extremely easy) act based on that notification.

Long answer:

  1. There are 2 ways around this: catch the EVENT_GOT_FOCUS in the control's callback and use SetActiveCtrl()to pass the focus to another control. The second option is to swallow the event and the control will never know that the user assigned focus to it(more on this later).

  2. The answer to most of the questions here is to swallow the event. I'll investigate further on 2a looks like this could be reported as a bug, however swallowing the event would fix this problem. 2c is caused by 2a, since the cursor is still in the text field of the numeric indicator so you need to click outside of the text area to get another event. 2d is a hole different thing, the control needs a focus change to know that the value has changed since the Ctrl+V is a OS message that does not causes the control to check fo the validity of the control. Ti disable this it would probably require to handle the Windows message, there is an example that ships with CVI that could help you get started.
  3. Under Build>>Target Settings.. you can change the application's icon; consisting a large (32x32) and a small (16x16) icon contained in the same file. Once you are ready do deploy the application you can change the default icon and your custom icon will show to launch the exe and in the popup panels.


When the user interacts with the CVI controls you callback is the first code to be excuted, by returning any value other than zero you stop the event from getting to the actual control, the end result is that the actual control never knows that the event happened; you can swallow a specific event or all of them depending on your needs.

I hope this helps.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 2 of 2
(2,897 Views)