public void ShowOkDialog( DisplayString caption, DisplayString message )
{
OverlayElement e;
if ( Dialog != null )
{
Dialog.Caption = caption;
Dialog.Text = message;
if ( mOk != null )
return;
else
{
if ( mYes != null )
mYes.Cleanup();
if ( mNo != null )
mNo.Cleanup();
mYes = null;
mNo = null;
}
}
else
{
// give widgets a chance to reset in case they're in the middle of something
for ( int i = 0; i < 10; i++ )
{
for ( int j = 0; j < mWidgets[ i ].Count; j++ )
{
mWidgets[ i ][ j ].OnLostFocus();
}
}
mDialogShade.Show();
Dialog = new TextBox( mName + "/DialogBox", caption, 300, 208 );
Dialog.Text = message;
e = Dialog.OverlayElement;
mDialogShade.AddChild( e );
e.VerticalAlignment = VerticalAlignment.Center;
e.Left = -( e.Width / 2 );
e.Top = -( e.Height / 2 );
CursorWasVisible = IsCursorVisible;
ShowCursor();
}
mOk = new Button( mName + "/OkButton", "OK", 60 );
mOk.AssignedTrayListener = this;
e = mOk.OverlayElement;
mDialogShade.AddChild( e );
e.VerticalAlignment = VerticalAlignment.Center;
e.Left = -( e.Width / 2 );
e.Top = Dialog.OverlayElement.Top + Dialog.OverlayElement.Height + 5;
}