PDA

View Full Version : Use of OK, Apply and Cancel in plugin settings



gbumgard
April 12th, 2006, 01:51 AM
In my plugin implementation, I apply configuration changes when Apply is pressed and duOnApply message is sent.

Should I also apply changes if OK is pressed? OK produces a duOnClose message, but does not produce a duOnApply message.

If I should save on OK, how can I tell if OK or Cancel was pressed? Both produce an duOnClose event.

-g.b.

gbumgard
April 12th, 2006, 01:57 AM
After Apply is pressed, I save the new settings. After Apply is pressed, the plugin settings dialog is still open, and the user can make additional changes. However, once pressed, the Apply button stays grayed out and cannot be pressed again.

Is there a way to reenable the Apply button (indicate changes have been made)?

gbumgard
April 13th, 2006, 02:00 AM
OK, my mistake. Apply does get renabled if I change a control. Something in my plugin was messing things up. Works OK now.

I'm still not sure if OK is equivalent to Apply. Probably not if the API doesn't recognize it as such.

-g.b.

Ron
April 13th, 2006, 01:14 PM
If you need to force the DUI to be 'Changed' (to enable the apply button) you can call treescript.SetChanged(duiIndex).