LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Table control bug?

Hello

I use table control in my application. Table is in auto edit mode. It has couple of columns which are string type. If I set "Max Entry Length" attribute for the column, then the auto edit feature does not work correctly. I need to press F2 button before table lets me edit the cell value. Is this a bug in table control?


Best regards,
Mikko



0 Kudos
Message 1 of 5
(3,395 Views)
Hello Mikko,
 
which version of CVI are you using? I'm using CVI8.5.0, but I'm unable to reproduce the problem...
0 Kudos
Message 2 of 5
(3,380 Views)

Hello again,

A possible work-around for your problem is faking the F2 keypress when a table cell is left clicked. To do so, you have to insert some code in the callback function of the table:

int CVICALLBACK TableCallback (int panel, int control, int event, void *callbackData, int eventData1, int eventData2) {
 Point tablecellPt;
 
 switch (event) {
  case EVENT_LEFT_CLICK_UP:
   
   // Check if a table cell is left clicked.
   GetTableCellFromPoint (pnlHandle, PNL_TABLE, MakePoint (eventData2, eventData1), &tablecellPt);
   if (PointEqual (tablecellPt, MakePoint (0, 0))) return 0;
   
   // Simulate F2 keypress.
   FakeKeystroke (VAL_F2_VKEY);
    
   break;
 }
 return 0;
}

Take a look at the example I wrote in the attachment.

I hope this helps you out.


 

Message 3 of 5
(3,378 Views)
I'm usin CVI 8.5.0. Problem occurs when you write enough characters to reach "Max Entry Length". In your example "Max Entry Length" is 10. When you write 10 characters to a cell, and then try to modify it again, you will see the problem. But your workaround seems to solve this problem. Thanks Wim.


Best regards,
Mikko



0 Kudos
Message 4 of 5
(3,354 Views)
Hello Mikko,
 
Thanks for the clarification. Like Wim, I hadn't been able to reproduce this initially, but with your latest description, I definitely see a problem. It's not that it refuses to edit the cell -- the editing session starts, but then it doesn't accept any input.
 
In any case, this is definitely a bug in CVI, and we'll look into it soon (Bug ID: 4HD8TZW). I'm assuming that with the workaround that Wim sent you, this is no longer an urgent issue for you. But if it becomes one, please do post an update here.
 
Thanks,
Luis
0 Kudos
Message 5 of 5
(3,328 Views)