From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

programmatic table won't hear commits

Solved!
Go to solution

I have a table control that I'm creating programmatically by NewCtrl.  I set its control mode to VAL_HOT so that it will listen to commit events when I edit the cells.  And yet, the EVENT_COMMIT never happens.

 

As a test, I created a table in my UIR, set it to hot mode, and put a DebugPrintf in the  EVENT_COMMIT case.  Triggers as expected when I edit a cell.

 

Now back to my programmatic table, all my other events are triggering as expected:

  • EVENT_RIGHT_CLICK
  • EVENT_LEFT_CLICK
  • EVENT_LEFT_DOUBLE_CLICK
  • EVENT_GOT_FOCUS
  • EVENT_LOST_FOCUS
  • EVENT_TABLE_ROW_COL_LABEL_CLICK

What else do I need to set in a programmatic table to make commits respond?


 

 

0 Kudos
Message 1 of 4
(3,680 Views)

Remember that individual cells can have a different state with respect to the table as a control.

It may worth a trial calling SetTableCellRangeAttribute (panelHandle, PANEL_TABLE, VAL_TABLE_ENTIRE_RANGE, ATTR_CELL_MODE, VAL_HOT); after creating the table.



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

No change.  This is very odd.  A separate control button inserts rows into this table.  I extended this function for my UIR-based table (thinking that maybe it was the insertion of new rows that were not also being set to HOT mode).  But no such luck, even as I insert new rows on the UIR table, each additional row and cell responds to commits.

 

Another data point: if I change my UIR table from HOT to INDICATOR or NORMAL, only under the Control Settings (see attachment), then my EVENT_COMMIT events never happen, just as I would expect.

 

So the question is, how is CVI making this setting to the table?

0 Kudos
Message 3 of 4
(3,674 Views)
Solution
Accepted by topic author ElectroLund

Ok, I have this solved now.  It was a mixture of issues.  This project is part of my other set of questions here, wherein the first thing that happens during my test is that I switch monitors (with the help of a DiscardPanel and DuplicateCtrl).

 

For whatever reason, the DuplicateCtrl does not seem to duplicate the control mode status.  So after I move monitors and call the DuplicateCtrl, I must reissue a call to change its control mode attribute.  Turns out, just this one is needed:

 

SetCtrlAttribute(mainPanel,tableControl,ATTR_CTRL_MODE,VAL_HOT);

 

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