LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

In CVI How do I make a panel act like a prompt popup, Ive tried the Installpopup fucntion without the desired result.

In LabwindowsCVI version 7.0. I have created a keyboard panel designed to be used with a mouse to allow alpha numeric data entry without a touch screen or keyboard. I would like to have this panel act as a propmt popup panel. Where the panel is displayed and the callback function displaying the panel waits until the panel is not visable before continuing. I have tried using the InstallPopup function, but the caling calback function contiues to exicute after displaying the panel. The InstallPopup description sounds like it shoudl do what I whant but it does not seem to be working.
0 Kudos
Message 1 of 4
(3,208 Views)
See the answers to the question previously asked here

--
Martin
--
Martin
Certified CVI Developer
0 Kudos
Message 2 of 4
(3,208 Views)
InstallPopup doesn't cause your code to wait: it just installs and displays a modal dialog box. I typically use InstallPopup in conjunction with GetUserEvent and RemovePopup.
GetUserEvent with Wait Mode set to wait will wait until an EVENT_COMMIT is generated. GetUserEvent then returns the panel and control that generated the EVENT_COMMIT.
If your keyboard panel popup has buttons like OK or ENTER or CANCEL, you need to put GetUserEvent in a loop: you'll get EVENT_COMMIT's on letters or numbers clicked as well as on OK (etc.). In your loop, if the control that generated EVENT_COMMIT is not OK, ENTER, or CANCEL, it must be a letter or number: use it to build your string. If the EVENT_COMMIT is from OK or ENTER, return to your calling routine and RemovePopup(0). If EVE
NT_COMMIT is from CANCEL, clear the string (e.g. sMyString[0] = '\0';) before returning.
You may want to set the Shortcut Key for OK or ENTER to Enter, and the Shortcut Key for CANCEL to Esc.
0 Kudos
Message 3 of 4
(3,208 Views)
In your loop building the string based on buttons pressed, you could call GetCtrlAttribute() to get ATTR_LABEL_TEXT rather than having a case for each button. E.g. the ATTR_LABEL_TEXT for the A key will be "A". You may need a few special cases for Backspace, Delete, Spacebar, etc.
0 Kudos
Message 4 of 4
(3,208 Views)