Setting the default condition in a dialog panel
hegedus
I am trying to create a warning dialog box that would prompt the user if he really wants to continue. Basically:
Prompt String: Do really want to reset the zero point? with "Yes" and "No". When the dialog box is displayed the "Yes" button has the focus and would be executed with a return key. Is there a way to make the "No" button have the focus and be executed with a return key.
I think it is a best practice it this way.
Andy
print V_flag
//V_flag = 1: Yes clicked.
// 2: No clicked.
// 3: Cancel clicked.
Please note that you can use keyboard shortcuts to select these buttons. On a Mac you can press Cmd-Y for yes, Cmd-N for no.
If you really, really want to do exactly what you said you could create your own panel with a couple of button, and use
pauseforuser
, but I don't think that's immediately addressable with the keyboard, I think you may have to use a mouse to click the button.Andrew
August 5, 2009 at 07:14 pm - Permalink
Actually, you don't need the Cmd key at all. Just Y or N.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
August 6, 2009 at 03:43 pm - Permalink