Philippe Lang
2007-May-30 05:24 UTC
[fxruby-users] Yield a message handler from another message handler?
Hi, I''m using an FXTable as a database table interface. When clicking on a row header button, I''d like to know if the table content was changed since the last database commit. I''m using the FXTable SEL_REPLACED message for that purpose. Each time this message is fired, I raise a "diry flag" for the table. If the flag is set, the table has to be commited to the database. This works in most situations, except one: when the user is editing a cell of a fresh commited table, and then directly clicks on the row header, the table is still "non-dirty" when the FXHeader SEL_COMMAND message handler is started, and remains in this state until the message handler ends. Only then is the FXTable SEL_REPLACED message fired. But too late! Is there a way to "yield" a message handler from another one? Or is there a workaround for that problem? Thanks! Philippe Lang
Philippe Lang
2007-May-30 06:18 UTC
[fxruby-users] Yield a message handler from another message handler?
fxruby-users-bounces at rubyforge.org wrote:> Hi, > > I''m using an FXTable as a database table interface. > > When clicking on a row header button, I''d like to know if the table > content was changed since the last database commit. > > I''m using the FXTable SEL_REPLACED message for that purpose. Each > time this message is fired, I raise a "diry flag" for the table. If > the flag is set, the table has to be commited to the database. > > This works in most situations, except one: when the user is editing a > cell of a fresh commited table, and then directly clicks on the row > header, the table is still "non-dirty" when the FXHeader SEL_COMMAND > message handler is started, and remains in this state until the > message handler ends. Only then is the FXTable SEL_REPLACED message > fired. But too late! > > Is there a way to "yield" a message handler from another one? Or is > there a workaround for that problem?The best workaround I found is to use the FXTable "SEL_KEYPRESS" and "SEL_DOUBLECLICKED" message for managing the dirty flag of the table. It works, but it is a bit excessive: the table is maked dirty in situations where is should not, like for example when you start editing a cell, an revert it with the ESC key. Philippe