Hi, I have noticed the SEL_REPLACED event, in an FXTable, is fired even is the cell value is replaced with the same value. I''d like to avoid that, and I wonder if there is anything in the Fox library I can use to compare the new cell value to the old one, without having to code some kind of "cell memory" externally. Regards, Philippe Lang
On Jul 6, 2007, at 12:50 AM, Philippe Lang wrote:> I have noticed the SEL_REPLACED event, in an FXTable, is fired even is > the cell value is replaced with the same value. I''d like to avoid > that, > and I wonder if there is anything in the Fox library I can use to > compare the new cell value to the old one, without having to code some > kind of "cell memory" externally.Looking at the FOX source code, I don''t see a way to do that. I think you''d need to save a copy of the cell''s content when they first click into it, and then compare the value after SEL_REPLACED to that.
On Friday 06 July 2007 00:50, Philippe Lang wrote:> Hi, > > I have noticed the SEL_REPLACED event, in an FXTable, is fired even is > the cell value is replaced with the same value. I''d like to avoid that, > and I wonder if there is anything in the Fox library I can use to > compare the new cell value to the old one, without having to code some > kind of "cell memory" externally.That is correct. It allows the handler for that event to squirrel away the old data for the purposes of e.g. an Undo system. I have in mind to change this a bit, however. In the next release of FOX, we''ll likely send TWO messages. One on behalf of the undo system, before the data changes, and one after. The current workaround would be to grab the new value after the message returns; perhaps by setting a chore to generate a second message after the SEL_REPLACED returns. Hope this explains, - Jeroen
fxruby-users-bounces at rubyforge.org wrote:> On Jul 6, 2007, at 12:50 AM, Philippe Lang wrote: > >> I have noticed the SEL_REPLACED event, in an FXTable, is fired even >> is the cell value is replaced with the same value. I''d like to avoid >> that, and I wonder if there is anything in the Fox library I can use >> to compare the new cell value to the old one, without having to code >> some kind of "cell memory" externally. > > Looking at the FOX source code, I don''t see a way to do that. I think > you''d need to save a copy of the cell''s content when they first click > into it, and then compare the value after SEL_REPLACED to that.Hi Lyle, hi Jeroen, Thanks for the ideas. I simply had to save the current cell text at each click and keystroke, and compare this value with the current cell value in the SEL_REPLACED message handler, as Lyle suggested. If values are identical, this is no update at all... Regards, Philippe