On Sep 10, 2004, at 9:57 AM, Daryl Fox wrote:
> Okay, here's something that a little funny...
>
> You have spend five minutes or so tweaking a component in the
> resourceEditor. You aligned it perfectly, changed the text, labelled
> it
> nicely, etc. Then you accidentally hit the delete key. Gah! The
> delete
> confirmation dialog doesn't have a NO/CANCEL option! :)
>
> Any change of changing line 1116 of resourceEditor.py to:
> result = dialog.messageDialog(self, msg, 'Delete Component',
> wx.ICON_INFORMATION | wx.YES_NO | wx.NO_DEFAULT)
>
> It looks like the code is built to support this as it already checks
> for
> result.accepted.
>
> -Daryl
>
Sorry about that. When I switched over to using the wx/lib/dialogs.py
function wrappers for the system dialogs one of the changes was that
the icon and button args got combined. The default style for the
messageDialog is wx.OK | wx.CANCEL | wx.CENTRE, but if a style arg is
supplied then that obviously isn't used. Consequently, where I was
supplying an icon arg I forgot to add the button ids back in.
So as you figured out above, the on_componentDelete_command method
should be changed to:
result = dialog.messageDialog(self, msg, 'Delete Component',
wx.ICON_INFORMATION | wx.YES_NO | wx.NO_DEFAULT)
The on_menuEditCut_select method needs a similar fix:
result = dialog.messageDialog(self, msg, 'Cut Component',
wx.ICON_INFORMATION | wx.YES_NO | wx.NO_DEFAULT)
I've checked these changes into cvs. I'll have to look at the other
places messageDialog is used to make sure there aren't similar problems
with the other tools or samples.
ka
|