Book a Demo

Author Topic: Difference between 'Ok' and 'Apply'  (Read 3220 times)

piotrek84

  • EA Novice
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Difference between 'Ok' and 'Apply'
« on: November 26, 2009, 04:01:56 am »
Dear All,
Is there any way for detecting if the user clicked 'Ok' or 'Apply' on an element properties window (the one that appears when you double click the element)? I'm using EA_OnNotifyContextItemModified event to detect when element has changed but it responds in the same way both to 'Apply' and 'Ok'.
Effectively what happends is that when I first apply the changes my add-in is run and then it is run again after cliking 'Ok' even though no changes were made between clicking 'Apply' and 'Ok'.
Any ideas?

Thanks in advance
Peter

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Difference between 'OK' and 'Apply'
« Reply #1 on: November 26, 2009, 09:21:33 am »
Quote
[size=18]...[/size]
Effectively what happens is that when I first apply the changes my add-in is run and then it is run again after clicking 'OK' even though no changes were made between clicking 'Apply' and 'OK'.
[size=18]...[/size]
Hi Peter,

If there were NO changes between clicking Apply and OK, then the event should NOT trigger.  The Context Item was not modified.

If you open the item and then immediately click OK, does the event trigger?  Again, it shouldn't.

I've observed, in general, EA sometimes has difficulty figuring out if things are dirty and whether other things should be updated as a consequence.  This might just be another manifestation of the more general problem.

I'd formally report it.

HTH,
Paolo
« Last Edit: November 26, 2009, 09:22:53 am by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

piotrek84

  • EA Novice
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
Re: Difference between 'Ok' and 'Apply'
« Reply #2 on: November 26, 2009, 10:04:59 pm »
Solved the problem using both EA_OnContextItemDoubleClicked, EA_OnNotifyContextItemModified events and a static variable for holding the 'Modified' value.
Still I think the behaviour of EA_OnNotifyContextItemModified is not exactly what it says in the manual...

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Difference between 'Ok' and 'Apply'
« Reply #3 on: November 26, 2009, 10:08:48 pm »
Quote
[size=18]...[/size]
Still I think the behaviour of EA_OnNotifyContextItemModified is not exactly what it says in the manual...
That's why you need to report it...

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!