I like the PredefinedButton idea; it makes creating DialogBoxes really easy and powerful. But I don't see an easy way to handle clicks on them. The Dialog example uses a "HideHandler", then just spits out the text of the button, which isn't a real practical example. It would be nice if there was something similar to the "getHideButton" function that returned the PredefinedButton enum (I'm used to GetDialogResult() in WinForms). Obviously that won't work if I add my own buttons, but if you're going to give us handy built-ins, it should be dead easy to use them.
Is there a way to use them that I'm just missing? And if so, could you add it to the Dialog example?
Right now, I'm just comparing the text against "Yes" or "OK", etc, which is terrible from an i18n perspective.
Thanks for the feedback - the PredefinedButton enum is new in 3, and combined with the change from the event structure used in 2.x, this piece got lost in the shuffle. I'm moving this thread to the bugs forum, and filing an issue, we'll update this when we have made a change.
There is some room to work around this though - you've already remarked that getHideButton() yields the button pressed, but there are some other places you might hook into this:
Dialog.onButtonPressed might be overridden, to let you know that a button has been selected, and you can then check using getText(PredefinedButton) what the text of the button is, for the current locale. This allows you to decide based on the button (and perhaps other criteria) whether or not to cause the popup to be dismissed.
Window.hide(TextButton) is another option - the same getText(PredefinedButton) method could be used to get the text, and just calling super.hide would let it continue with hiding the dialog.