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

April 12th, 2006, 02: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.


April 12th, 2006, 02: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)?

April 13th, 2006, 03: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.


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