11-08-2013 09:12 AM
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:
What else do I need to set in a programmatic table to make commits respond?
Solved! Go to Solution.
11-08-2013 09:39 AM
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.
11-08-2013 09:56 AM - edited 11-08-2013 09:56 AM
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?
11-08-2013 11:46 AM
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);