LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

problem of table control withCVI 7.1

Hello,
In my application, there is a table control on the UIR. I find a strange problem to the control, when the control has lost the focus, there is still a box frame stay on the cell, could you advise me how to get off the box frame? Thanks.
 
Rocio
0 Kudos
Message 1 of 4
(3,159 Views)

Try: SetCtrlAttribute (panel, control_ID, ATTR_HILITE_CURRENT_ITEM, 0);

JR

0 Kudos
Message 2 of 4
(3,152 Views)
Unfortunately, ATTR_HILITE_CURRENT_ITEM is not a valid attribute for tables, it works only for list controls. As far as I know there is not a valid equivalent of this attribute for tables, maybe there will be in future releases / patches.
 
At present, the only possibility I know to "hide" cell marking is to set the active cell outside the region of table actually displayed on screen. In the attached example table 1 is a standard table and holds cell marking, while table 2 has a supplementary column (not displayed) to which the active cell is placed in EVENT_LOST_FOCUS event. In EVENT_GOT_FOCUS the active cell is restored in the oroginal position based on a static variable that olds active cell position. As you can see, no cell marking is present while the table is not the active control.Smiley Happy
 
The only disadvantage of this approach is that you cannot prevent the user to run to the "hidden" supplementary column while navigating in the table with keyboard and mouse, unless you trap EVENT_KEYPRESS and limit user action, but the number of conditions under which a particular cell can be reached is wide and is hard to get all of them...Smiley Sad


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 3 of 4
(3,146 Views)

Rocio,

See the following thread for some more detail:

http://forums.ni.com/ni/board/message?board.id=180&message.id=12455#M12455

The bottom line is that if the table is not an indicator, then you can try to implement the first workaround, and if it is an indicator, then you can try to implement the second workaround (which is also the same solution offered by Roberto, except that if the table is an indicator you won't have the problem of users "finding" your hidden row).

Finally, in the case where the table is an indicator, we are changing this behavior in CVI 8.0, so that the cell outline will not show up.

Luis
NI

0 Kudos
Message 4 of 4
(3,123 Views)