09-30-2008 08:28 AM
Hello,
we have an application written in LabWindows 6.0. There is an panel with a table control. On the panel also are function softkeys F1-F10. With softkey F2 or F3 i switch to another panel. There are no Problems.
Now we use LabWindows 8.5.1 with the same application. When i use the softkey F3 on the panel with the table control, it will open a popup "Find in Table Cells". But i will switch to another panel. With softkey F2 the table cell switch to edit mode, but i will also switch to another panel.
How can i disable this functions in the table control. I can't use other softkeys to switch the panel.
Greetz Be-Mo
09-30-2008 02:18 PM
Hello Greetz,
When you catch the EVENT_KEYPRESS event for those keys in either the panel or control callbacks, you need to return 1 from the callback function, instead of 0. Returning 1 ensures that the CVI user interface will not continue processing the event.
Luis
10-01-2008 01:39 AM
Hello Luis,
i know this. But the problem is, you don't become any event from this key.
When you press F3 in a table control, you don't become a event on the callback from F3. It will be open a popup "Find in Table Cells". When you press F2 in a table, then the cellsswitch to edit mode and when you press F2 again, then you become a event on the callback. But on F3 you never become an event.
I have search for an attribute or function to disable this popup in the table, but i don't found anything.
Greets Be-Mo
10-01-2008 05:02 AM
Hi Be-Mo,
while it's true that "Find in table cells" panel is displayed before the table callback receives the keypress event (so it's not possible to disable F3 facility this way), you can actually disable the edit mode switch by swallowing F2 key event by adding these lines to the table callback:
case EVENT_KEYPRESS:
virtualKey = eventData1 & VAL_VKEY_MASK;
modifierKey = eventData1 & VAL_MODIFIER_KEY_MASK;
if (virtualKey == VAL_F2_VKEY) return 1;
break;
10-02-2008 01:52 AM
Hi Be-Mo,
i have only CVI7.1.1, so i cannot test this solution.
But maybe you can try HideBuiltInCtrlMenuItem to disable search function.
10-02-2008 02:00 AM
10-02-2008 02:07 AM
Hello OVR_CZ and Roberto B...
with HideBuiltInCtrlMenuItem(panel control, VAL_FIND) you can disable the popup "Find in Table Cells" when pressing F3.
Also SetCtrlAttribute with ATTR_ENABLE_POPUP_MENU disable this popup.
Thanks a lot.
Greetz Be-Mo
10-02-2008 02:28 AM
Be-Mo wrote:Hello OVR_CZ and Roberto B...
with HideBuiltInCtrlMenuItem(panel control, VAL_FIND) you can disable the popup "Find in Table Cells" when pressing F3.
Also SetCtrlAttribute with ATTR_ENABLE_POPUP_MENU disable this popup.
Thanks a lot.
Greetz Be-Mo
Ok, seems you never stop learning something new! ![]()
Thanks for the tip
10-02-2008 02:42 PM
You could also clear the shortcut key....
SetCtrlMenuAttribute (panelHandle, PANEL_TABLE, VAL_FIND_NEXT, ATTR_SHORTCUT_KEY, 0);