LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to type into a numeric control

I have a large application with many panels. Some of them can get into a strange state where a control can be highligted by double clicking on it, but then I can't type a number in, though the up/down arrows do increment/decrement the number.
This state can be "fixed" by clicking in another panel so that the offending panel loses focus and then going back to it. Usually a number can then be typed in.
I have tried simulating this using SetActivePanel(...) and it then works, but only when you step through it in debug mode. When the breakpoint is removed it goes back to the previous behaviour.
 
When a panel is in this strange state, there are other symptoms:-
1. More than one numeric control can be highlighted at the same time, though none can be typed into.
2. Controls can be highlighted/un-highlighted by single clicks rather than double ones.
All other types of control work correctly. It's almost as though something has disabled the keyboard, but I haven't checked to see if the TAB key works.
 
I'm using cvi 7.1.1
0 Kudos
Message 1 of 14
(5,019 Views)

Hi.

If you are using tab controls in your app, you may find the information in this thread relevant. Otherwise, I'm not sure.

Good luck,
Colin.

 

0 Kudos
Message 2 of 14
(4,994 Views)

Hmm. There are easy-tab panels in the project, but it isn't those that exhibit the odd behaviour, just straightforward uir panels.

I've found that the problem is associated with the display of a "live" image being acquired from a camera and displayed on a canvas in another window of the project. If the camera is stopped by clicking on a button the numeric controls can be typed into, but if it is stopped programmatically they can't. In theory there should be no difference as the same commands are used in both cases.

0 Kudos
Message 3 of 14
(4,983 Views)
Very strange behaviour!
 
A possible workaround is to select a control by either tabbing to it, or clicking on its label (not its contents). This should cause the entire number to be selected, and allow it to be overwritten or edited in the usual fashion.
 
Ideally, of course, the UI should respond as the user expects it to.
 
Thoughts, anyone?
 
0 Kudos
Message 4 of 14
(4,964 Views)

hi,

could you provide more information on what you're trying to do? are you acquiring from the camera then writing to the canvas?

do you see the same behaviour if you just try to write an image file?

if you post your code I'll have a look at it, although could you provide as much information as possible regarding it's operation etc?

sarahb

AE | NIIUK

Sarah

Applications Engineer | National Instruments | UK & Ireland
0 Kudos
Message 5 of 14
(4,963 Views)
I'll try the tabbing trick next time I have access to the system.
 
I can't really send the code. It's a huge microscopy project which includes third party SDKs to operate the camera, xyz stage etc.- the camera/image viewer alone has nearly 100 component files. However, a code snippet is included below.
 
One repeatable sequence of events occurs during objective calibration:-
 
1. Display a live image and focus on a graticule
2. Draw a line on the image using the mouse
3. The length of the line is displayed in pixels
4. At this point it is expected that the user enters the length of the line in microns, but it can't be done until he/she has clicked on some other panel first.
 
If live image display is stopped by the user clicking on the "Snap" button between points 3 and 4 all is well, but this is not intuitive and shouldn't be necessary. I can write code that simulates this and the camera exits live mode, but the number of microns still can't be typed in:-
 
static void onImageWindowProfile(GCIWindow *window, const Point p1, const Point p2, void *callback_data)
{
 unsigned int pixel_len;
 
 //Display the length of the line in pixels
 pixel_len = floor(sqrt(pow(abs(p1.x - p2.x), 2.0) + pow(abs(p1.y - p2.y), 2.0)) + 0.5);
 SetCtrlVal(calibration_panel, CAL_PANEL_PIXEL_NUMERIC, pixel_len);
 
 //All this code is an attempt to work round a cvi user interface bug
 //which means that we can't type the microns value in

 gci_camera_set_snap_mode(camera);    //exit live mode
 gci_camera_snap_image(camera);
 
 GCI_ImagingDisplayPanel();    //set focus to a different panel
 SetCtrlAttribute (calibration_panel, CAL_PANEL_UM_NUMERIC, ATTR_NO_EDIT_TEXT, 0);
 SetActivePanel(calibration_panel);
 SetActiveCtrl (calibration_panel, CAL_PANEL_UM_NUMERIC);
 SetPanelAttribute (calibration_panel, ATTR_ACTIVATE_WHEN_CLICKED_ON, 1);
 SetPanelAttribute (calibration_panel, ATTR_FLOATING, 1);
}
0 Kudos
Message 6 of 14
(4,949 Views)
This does sound like strange behaviour.
 
I haven't been able to find a reference to similar behaviour in our internal resources so I'm going to escalate this issue to our corporate office for them to look into further.
Sarah

Applications Engineer | National Instruments | UK & Ireland
0 Kudos
Message 7 of 14
(4,924 Views)

Hi

Have you tried removing the easy tab control to see if that resolves the problem?

We can't really do anything to try and correct this behavior yet, because we can't reproduce it or really isolate when it happens. Are you able to create a test example that demonstrates the behavior?  If you are able to create a small VI that shows the behavior, that would be more helpful because, as you mentioned, this behavior has not been seen before in the UIR set up you are using.

You could try downloading the latest CVI runtime engine, but that is a shot in the dark, and if your is not using Windows XP or 2000, you should not do so.

Best of luck

SarahB

NI | UK

Sarah

Applications Engineer | National Instruments | UK & Ireland
0 Kudos
Message 8 of 14
(4,899 Views)
Hello,
 
I am also having this problem in my user interface. Suddenly the program doesn't receive any keyboard input. I can only control the User Interface using the mouse. The behavior goes away when I open notepad, type something and then go back to my User Interface...
I am using CVI 8.0. I'm not using EasyTab, but the CVI8.0 Tab Control.
I haven't been able to filter out the problem yet. I also have a pretty large GUI and I'm using third party SDKs (Minolta).
 
Wim

Message Edited by Wim S on 04-03-2006 10:02 PM

0 Kudos
Message 9 of 14
(4,883 Views)

Hi,

Have either of you been able to reproduce this error on a smaller application?

Sarahb

Sarah

Applications Engineer | National Instruments | UK & Ireland
0 Kudos
Message 10 of 14
(4,856 Views)