LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable softkey F2 & F3 in table

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

0 Kudos
Message 1 of 9
(4,489 Views)

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

0 Kudos
Message 2 of 9
(4,472 Views)

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

0 Kudos
Message 3 of 9
(4,457 Views)

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;

 



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 4 of 9
(4,447 Views)

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.

0 Kudos
Message 5 of 9
(4,421 Views)
Unfortunately HideBuiltInCtrlMenuItemoperates on menu items included in the context menu shown when right-clicking on the table, not on panel shown when pressing F3. The context menu can be completely disabled by calling SetCtrlAttribute with ATTR_ENABLE_POPUP_MENU attribute.


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 6 of 9
(4,418 Views)

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

0 Kudos
Message 7 of 9
(4,413 Views)

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! Smiley Surprised

Thanks for the tip Smiley Happy



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 8 of 9
(4,410 Views)

You could also clear the shortcut key....

 

SetCtrlMenuAttribute (panelHandle, PANEL_TABLE, VAL_FIND_NEXT, ATTR_SHORTCUT_KEY, 0);

0 Kudos
Message 9 of 9
(4,386 Views)