Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] RE:Adding listener to MBS enumerated option

> 1) 	I tried setting 'applicabilityCalculator' for my option.
> Function 'IOptionApplicability.isOptionEnabled()' is called many times.
> While debugging it seems that it is called twice when I click on that
> option and twice more when I change its value. So if I have a message
> box in that code it will get call four times. So how do I check that my
> message box gets called only once and that too after value gets change.

The idea behind the 'IOptionApplicability.isOptionEnabled()' method is
to allow an option to be disabled(or enabled) based on the value(s) of
other options, and it is called everytime any option within the same
property page is changed (including the option itselve).

This means the 'IOption option' parameter you get passed in 'isEnabled()'
does not specify that that option has changed, but only that some option on
the same page has changed. So the trick and difficulty is to detect that
your specific enum option has changed value and only then popup the
message.

As it seems Mikhails 'valueHandler' solution might be more appropriate to
tackle your problem.


Back to the top