キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

programmatically generate EVENT_COMMIT?

For complicated reasons, I want to generate an EVENT_COMMIT programmatically.  I looked into QueueUserEvent, but this function only takes event codes 1000+.  I tried passing EVENT_COMMIT, but then the callback didn't fire for that event code.

 

Here's what I'm doing:

 

I have a library that I made which embeds a checkbox image into a table cell.  Then on LEFT_CLICK events, I simply change to the toggled version of the image in the cell. The library chains this table callback to the table.

 

My host application which uses this library needs to have visibility to the changes to any cell of this table, not just the checkbox cells.  The most straightforward event is the EVENT_COMMIT.  Yet, my library which makes the cell changes doesn't itself make an EVENT_COMMIT.

 

Am I missing something?  Is there some elegant solution?

0 件の賞賛
メッセージ1/5
2,763件の閲覧回数

All events that are not handled by the chained callback should be passed to the original control callback; the same applies to events handled by the callback provided it returns 0. Isn't this happening? Or am I missing something?



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 件の賞賛
メッセージ2/5
2,728件の閲覧回数

Well, because checkbox controls inside table cells aren't natively supported, doing the image trick requires watching for EVENT_LEFT_CLICK and EVENT_KEYPRESS (to support spacebar and enter key), neither of which also generate EVENT_COMMITs.  Upon those two event conditions, my library then toggles the image.

 

What would be handy is to then have the table generate the EVENT_COMMIT for the caller to see when it happened.

0 件の賞賛
メッセージ3/5
2,717件の閲覧回数

Here's what I did so solve.  Inside the lib callback, I now do a:

 

CallCtrlCallback(panel, control, EVENT_COMMIT, row, column, 0);

 

...to force that commit.  It's dangerous but works since my lib callback doesn't itself trap on commits.

0 件の賞賛
メッセージ4/5
2,716件の閲覧回数

Well, you could also directly call the table callback: this avoids a recursive call of the chained callback issued by CallCtrlCallback, and you could pass a specific value into callbackData to warn the function that this is not a "native" event.



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 件の賞賛
メッセージ5/5
2,711件の閲覧回数