2007-08-28 Jonathan Pobst <monkey@jpobst.com>
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / MessageBox.cs
1 // Permission is hereby granted, free of charge, to any person obtaining
2 // a copy of this software and associated documentation files (the
3 // "Software"), to deal in the Software without restriction, including
4 // without limitation the rights to use, copy, modify, merge, publish,
5 // distribute, sublicense, and/or sell copies of the Software, and to
6 // permit persons to whom the Software is furnished to do so, subject to
7 // the following conditions:
8 //
9 // The above copyright notice and this permission notice shall be
10 // included in all copies or substantial portions of the Software.
11 //
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
13 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
18 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 //
20 // Copyright (c) 2004-2006 Novell, Inc.
21 //
22 // Authors:
23 //      Jordi Mas i Hernandez   (jordi@ximian.com)
24 //      Benjamin Dasnois        (benjamin.dasnois@gmail.com)
25 //      Robert Thompson         (rmt@corporatism.org)
26 //      Peter Bartok            (pbartok@novell.com)
27 //
28 // TODO:
29 //      - Add support for MessageBoxOptions and MessageBoxDefaultButton.
30 //
31
32
33 // NOT COMPLETE
34
35 using System;
36 using System.Drawing;
37 using System.Globalization;
38 using System.Resources;
39
40 namespace System.Windows.Forms
41 {
42         public class MessageBox
43         {
44                 #region Private MessageBoxForm class
45                 private class MessageBoxForm : Form
46                 {
47                         #region MessageBoxFrom Local Variables
48                         const int space_border = 10;
49                         const int button_width = 86;
50                         const int button_height = 23;
51                         const int button_space = 5;
52                         const int space_image_text= 10;
53
54                         string                  msgbox_text;
55                         bool                    size_known      = false;
56                         Image                   icon_image;
57                         Point                   textleft_up;
58                         MessageBoxButtons       msgbox_buttons;
59                         MessageBoxDefaultButton msgbox_default;
60                         bool                    buttons_placed  = false;
61                         int                     button_left;
62                         Button[]                buttons = new Button[4];
63                         bool                    show_help;
64                         string help_file_path;
65                         string help_keyword;
66                         HelpNavigator help_navigator;
67                         object help_param;
68                         #endregion      // MessageBoxFrom Local Variables
69                         
70                         #region MessageBoxForm Constructors
71                         public MessageBoxForm (IWin32Window owner, string text, string caption,
72                                                MessageBoxButtons buttons, MessageBoxIcon icon,
73                                                bool displayHelpButton)
74                         {
75                                 show_help = displayHelpButton;
76
77                                 switch (icon) {
78                                         case MessageBoxIcon.None: {
79                                                 icon_image = null;
80                                                 break;
81                                         }
82
83                                         case MessageBoxIcon.Error: {            // Same as MessageBoxIcon.Hand and MessageBoxIcon.Stop
84                                                 icon_image = ThemeEngine.Current.Images(UIIcon.MessageBoxError);
85                                                 break;
86                                         }
87
88                                         case MessageBoxIcon.Question: {
89                                                 icon_image = ThemeEngine.Current.Images(UIIcon.MessageBoxQuestion);
90                                                 break;
91                                         }
92
93                                         case MessageBoxIcon.Asterisk: {         // Same as MessageBoxIcon.Information
94                                                 icon_image = ThemeEngine.Current.Images(UIIcon.MessageBoxInfo);
95                                                 break;
96                                         }
97
98                                         case MessageBoxIcon.Warning: {          // Same as MessageBoxIcon.Exclamation:
99                                                 icon_image = ThemeEngine.Current.Images(UIIcon.MessageBoxWarning);
100                                                 break;
101                                         }
102                                 }
103
104                                 msgbox_text = text;
105                                 msgbox_buttons = buttons;
106                                 msgbox_default = MessageBoxDefaultButton.Button1;
107
108                                 if (owner != null) {
109                                         Owner = Control.FromHandle(owner.Handle).FindForm();
110                                 } else {
111                                         if (Application.MWFThread.Current.Context != null) {
112                                                 Owner = Application.MWFThread.Current.Context.MainForm;
113                                         }
114                                 }
115                                 this.Text = caption;
116                                 this.ControlBox = true;
117                                 this.MinimizeBox = false;
118                                 this.MaximizeBox = false;
119                                 this.ShowInTaskbar = (Owner == null);
120                                 this.FormBorderStyle = FormBorderStyle.FixedDialog;
121                         }
122
123                         public MessageBoxForm (IWin32Window owner, string text, string caption,
124                                         MessageBoxButtons buttons, MessageBoxIcon icon,
125                                         MessageBoxDefaultButton defaultButton, MessageBoxOptions options, bool displayHelpButton)
126                                 : this (owner, text, caption, buttons, icon, displayHelpButton)
127                         {
128                                 msgbox_default = defaultButton;
129                         }
130
131                         public MessageBoxForm (IWin32Window owner, string text, string caption,
132                                                MessageBoxButtons buttons, MessageBoxIcon icon)
133                                 : this (owner, text, caption, buttons, icon, false)
134                         {
135                         }
136                         #endregion      // MessageBoxForm Constructors
137
138                         #region Protected Instance Properties
139                         protected override CreateParams CreateParams {
140                                 get {
141                                         CreateParams cp = base.CreateParams;;
142
143                                         cp.Style |= (int)(WindowStyles.WS_DLGFRAME | WindowStyles.WS_CLIPCHILDREN | WindowStyles.WS_CLIPSIBLINGS | WindowStyles.WS_CAPTION);
144                                         
145                                         if (!is_enabled)
146                                                 cp.Style |= (int)(WindowStyles.WS_DISABLED);
147
148                                         return cp;
149                                 }
150                         }
151                         #endregion      // Protected Instance Properties
152
153                         #region MessageBoxForm Methods
154                         public void SetHelpData (string file_path, string keyword, HelpNavigator navigator, object param)
155                         {
156                                 help_file_path = file_path;
157                                 help_keyword = keyword;
158                                 help_navigator = navigator;
159                                 help_param = param;
160                         }
161                         
162                         internal string HelpFilePath {
163                                 get { return help_file_path; }
164                         }
165                         
166                         internal string HelpKeyword {
167                                 get { return help_keyword; }
168                         }
169                         
170                         internal HelpNavigator HelpNavigator {
171                                 get { return help_navigator; }
172                         }
173                         
174                         internal object HelpParam {
175                                 get { return help_param; }
176                         }
177                         
178                         public DialogResult RunDialog ()
179                         {
180                                 this.StartPosition = FormStartPosition.CenterScreen;
181
182                                 if (size_known == false) {
183                                         InitFormsSize ();
184                                 }
185
186                                 this.ShowDialog ();
187
188                                 return this.DialogResult;
189                         }
190
191                         internal override void OnPaintInternal (PaintEventArgs e)
192                         {
193                                 e.Graphics.DrawString (msgbox_text, this.Font, ThemeEngine.Current.ResPool.GetSolidBrush (Color.Black), textleft_up);
194                                 if (icon_image != null) {
195                                         e.Graphics.DrawImage(icon_image, new Point(space_border, space_border));
196                                 }
197                         }
198
199                         private void InitFormsSize ()
200                         {
201                                 int tb_width = 0;
202                 
203                                 // First we have to know the size of text + image
204                                 Drawing.SizeF tsize = TextRenderer.MeasureString (msgbox_text, this.Font);
205
206                                 if (icon_image != null) {
207                                         tsize.Width += icon_image.Width + 10;
208                                         if(icon_image.Height > tsize.Height) {
209                                                 // Place text middle-right
210                                                 textleft_up = new Point (icon_image.Width + space_image_text + space_border, (int)((icon_image.Height/2)-(tsize.Height/2)) + space_border);
211                                         } else {
212                                                 textleft_up = new Point (icon_image.Width + space_image_text + space_border, 2 + space_border);
213                                         }
214                                         if (tsize.Height < icon_image.Height)
215                                                 tsize.Height = icon_image.Height;
216                                 } else {
217                                         tsize.Width += space_border * 2;
218                                         textleft_up = new Point (space_border + button_space, space_border);
219                                 }
220                                 tsize.Height += space_border * 2;
221
222                                 // Now we want to know the amount of buttons
223                                 int buttoncount;
224                                 switch (msgbox_buttons) {
225                                         case MessageBoxButtons.OK:
226                                                 buttoncount = 1;
227                                                 break;
228
229                                         case MessageBoxButtons.OKCancel:
230                                                 buttoncount = 2;
231                                                 break;
232
233                                         case MessageBoxButtons.AbortRetryIgnore:
234                                                 buttoncount = 3;
235                                                 break;
236
237                                         case MessageBoxButtons.YesNoCancel:
238                                                 buttoncount = 3;
239                                                 break;
240
241                                         case MessageBoxButtons.YesNo:
242                                                 buttoncount = 2;
243                                                 break;
244
245                                         case MessageBoxButtons.RetryCancel:
246                                                 buttoncount = 2;
247                                                 break;
248                                         
249                                         default:
250                                                 buttoncount = 0;
251                                                 break;
252                                 
253                                 }
254                                 if (show_help)
255                                         buttoncount ++;
256                                 
257                                 // Calculate the width based on amount of buttons 
258                                 tb_width = (button_width + button_space) * buttoncount;  
259
260                                 // Now we choose the good size for the form
261                                 if (tsize.ToSize ().Width > tb_width)
262                                         this.ClientSize = new Size(tsize.ToSize().Width + (space_border * 2), Height = tsize.ToSize ().Height + (space_border * 4));
263                                 else
264                                         this.ClientSize = new Size(tb_width + (space_border * 2), Height = tsize.ToSize ().Height + (space_border * 4));
265
266                                 // Now we set the left of the buttons
267                                 button_left = (this.ClientSize.Width / 2) - (tb_width / 2) + 5;
268                                 AddButtons ();
269                                 size_known = true;
270
271                                 // Still needs to implement defaultButton and options
272                                 switch(msgbox_default) {
273                                         case MessageBoxDefaultButton.Button1: {
274                                                 AcceptButton = this.buttons[0];
275                                                 break;
276                                         }
277
278                                         case MessageBoxDefaultButton.Button2: {
279                                                 if (this.buttons[1] != null) {
280                                                         AcceptButton = this.buttons[1];
281                                                 }
282                                                 break;
283                                         }
284
285                                         case MessageBoxDefaultButton.Button3: {
286                                                 if (this.buttons[2] != null) {
287                                                         AcceptButton = this.buttons[2];
288                                                 }
289                                                 break;
290                                         }
291                                 }
292                         }
293
294                         protected override bool ProcessDialogKey(Keys keyData) {
295                                 if (keyData == Keys.Escape) {
296                                         this.CancelClick(this, null);
297                                         return true;
298                                 }
299
300                                 if (((keyData & Keys.Modifiers) == Keys.Control) &&
301                                         (((keyData & Keys.KeyCode) == Keys.C) ||
302                                          ((keyData & Keys.KeyCode) == Keys.Insert))) {  
303                                         Copy();
304                                 }
305
306                                 return base.ProcessDialogKey (keyData);
307                         }
308
309                         private void Copy ()
310                         {
311                                 string separator = "---------------------------" + Environment.NewLine;
312
313                                 System.Text.StringBuilder contents = new System.Text.StringBuilder ();
314
315                                 contents.Append (separator);
316                                 contents.Append (this.Text).Append (Environment.NewLine);
317                                 contents.Append (separator);
318                                 contents.Append (msgbox_text).Append (Environment.NewLine);
319                                 contents.Append (separator);
320
321                                 foreach (Button btn in buttons) {
322                                         if (btn == null)
323                                                 break;
324                                         contents.Append (btn.Text).Append ("   ");;
325                                 }
326
327                                 contents.Append (Environment.NewLine);
328                                 contents.Append (separator);
329
330                                 DataObject obj = new DataObject(DataFormats.Text, contents.ToString());
331                                 Clipboard.SetDataObject (obj);
332                         }
333
334                         #endregion      // MessageBoxForm Methods
335
336                         #region Functions for Adding buttons
337                         private void AddButtons()
338                         {
339                                 if (!buttons_placed) {
340                                         switch (msgbox_buttons) {
341                                                 case MessageBoxButtons.OK: {
342                                                         buttons[0] = AddOkButton (0);
343                                                         break;
344                                                 }
345
346                                                 case MessageBoxButtons.OKCancel: {
347                                                         buttons[0] = AddOkButton (0);
348                                                         buttons[1] = AddCancelButton (1);
349                                                         break;
350                                                 }
351
352                                                 case MessageBoxButtons.AbortRetryIgnore: {
353                                                         buttons[0] = AddAbortButton (0);
354                                                         buttons[1] = AddRetryButton (1);
355                                                         buttons[2] = AddIgnoreButton (2);
356                                                         break;
357                                                 }
358
359                                                 case MessageBoxButtons.YesNoCancel: {
360                                                         buttons[0] = AddYesButton (0);
361                                                         buttons[1] = AddNoButton (1);
362                                                         buttons[2] = AddCancelButton (2);
363                                                         break;
364                                                 }
365
366                                                 case MessageBoxButtons.YesNo: {
367                                                         buttons[0] = AddYesButton (0);
368                                                         buttons[1] = AddNoButton (1);
369                                                         break;
370                                                 }
371
372                                                 case MessageBoxButtons.RetryCancel: {
373                                                         buttons[0] = AddRetryButton (0);
374                                                         buttons[1] = AddCancelButton (1);
375                                                         break;
376                                                 }
377                                         }
378
379 #if NET_2_0
380                                         if (show_help) {
381                                                 for (int i = 0; i <= 3; i++) {
382                                                         if (buttons [i] == null) {
383                                                                 AddHelpButton (i);
384                                                                 break;
385                                                         }
386                                                 }
387                                         }
388 #endif
389                                         buttons_placed = true;
390                                 }
391                         }
392
393                         private Button AddButton (string text, int left, EventHandler click_event)
394                         {
395                                 Button button = new Button ();
396                                 button.Text = Locale.GetText(text);
397                                 button.Width = button_width;
398                                 button.Height = button_height;
399                                 button.Top = this.ClientSize.Height - button.Height - space_border;
400                                 button.Left =  ((button_width + button_space) * left) + button_left;
401                                 
402                                 if (click_event != null)
403                                         button.Click += click_event;
404                                 
405                                 if ((text == "OK") || (text == "Retry") || (text == "Yes")) 
406                                         AcceptButton = button;
407                                 else if ((text == "Cancel") || (text == "Abort") || (text == "No"))
408                                         CancelButton = button;
409                                 
410                                 this.Controls.Add (button);
411
412                                 return button;
413                         }
414
415                         private Button AddOkButton (int left)
416                         {
417                                 return AddButton ("OK", left, new EventHandler (OkClick));
418                         }
419
420                         private Button AddCancelButton (int left)
421                         {
422                                 return AddButton ("Cancel", left, new EventHandler (CancelClick));
423                         }
424
425                         private Button AddAbortButton (int left)
426                         {
427                                 return AddButton ("Abort", left, new EventHandler (AbortClick));
428                         }
429
430                         private Button AddRetryButton(int left)
431                         {
432                                 return AddButton ("Retry", left, new EventHandler (RetryClick));
433                         }
434
435                         private Button AddIgnoreButton (int left)
436                         {
437                                 return AddButton ("Ignore", left, new EventHandler (IgnoreClick));
438                         }
439
440                         private Button AddYesButton (int left)
441                         {
442                                 return AddButton ("Yes", left, new EventHandler (YesClick));
443                         }
444
445                         private Button AddNoButton (int left)
446                         {
447                                 return AddButton ("No", left, new EventHandler (NoClick));
448                         }
449
450 #if NET_2_0
451                         private Button AddHelpButton (int left)
452                         {
453                                 Button button = AddButton ("Help", left, null);
454                                 button.Click += delegate { Owner.RaiseHelpRequested (new HelpEventArgs (Owner.Location)); };
455                                 return button;
456                         }
457 #endif
458                         #endregion
459
460                         #region Button click handlers
461                         private void OkClick (object sender, EventArgs e)
462                         {
463                                 this.DialogResult = DialogResult.OK;
464                                 this.Close ();
465                         }
466
467                         private void CancelClick (object sender, EventArgs e)
468                         {
469                                 this.DialogResult = DialogResult.Cancel;
470                                 this.Close ();
471                         }
472
473                         private void AbortClick (object sender, EventArgs e)
474                         {
475                                 this.DialogResult = DialogResult.Abort;
476                                 this.Close ();
477                         }
478
479                         private void RetryClick (object sender, EventArgs e)
480                         {
481                                 this.DialogResult = DialogResult.Retry;
482                                 this.Close ();
483                         }
484
485                         private void IgnoreClick (object sender, EventArgs e)
486                         {
487                                 this.DialogResult = DialogResult.Ignore;
488                                 this.Close ();
489                         }
490
491                         private void YesClick (object sender, EventArgs e)
492                         {
493                                 this.DialogResult = DialogResult.Yes;
494                                 this.Close ();
495                         }
496
497                         private void NoClick (object sender, EventArgs e)
498                         {
499                                 this.DialogResult = DialogResult.No;
500                                 this.Close ();
501                         }
502                         #endregion
503                 }
504                 #endregion      // Private MessageBoxForm class
505
506
507                 #region Constructors
508                 private MessageBox ()
509                 {
510                 }
511                 #endregion      // Constructors
512
513                 #region Public Static Methods
514                 public static DialogResult Show (string text)
515                 {
516                         MessageBoxForm form = new MessageBoxForm (null, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None);
517
518                         return form.RunDialog ();
519                 }
520
521                 public static DialogResult Show (IWin32Window owner, string text)
522                 {
523                         MessageBoxForm form = new MessageBoxForm (owner, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None);
524                                 
525                         return form.RunDialog ();
526                 }
527
528                 public static DialogResult Show (string text, string caption)
529                 {
530                         MessageBoxForm form = new MessageBoxForm (null, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None);
531
532                         return form.RunDialog ();
533                 }
534
535                 public static DialogResult Show (string text, string caption, MessageBoxButtons buttons)
536                 {
537                         MessageBoxForm form = new MessageBoxForm (null, text, caption, buttons, MessageBoxIcon.None);
538                                 
539                         return form.RunDialog ();
540                 }
541
542                 public static DialogResult Show (IWin32Window owner, string text, string caption,
543                                                  MessageBoxButtons buttons)
544                 {
545                         MessageBoxForm form = new MessageBoxForm (owner, text, caption, buttons, MessageBoxIcon.None);
546                                 
547                         return form.RunDialog ();
548                 }
549
550                 public static DialogResult Show (IWin32Window owner, string text, string caption,
551                                                  MessageBoxButtons buttons, MessageBoxIcon icon)
552                 {
553                         MessageBoxForm form = new MessageBoxForm (owner, text, caption, buttons, icon);
554                                 
555                         return form.RunDialog ();
556                 }
557
558
559                 public static DialogResult Show (IWin32Window owner, string text, string caption)
560                 {
561                         MessageBoxForm form = new MessageBoxForm (owner, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None);
562                                 
563                         return form.RunDialog ();
564                 }
565
566
567                 public static DialogResult Show (string text, string caption, MessageBoxButtons buttons,
568                                 MessageBoxIcon icon)
569                 {
570                         MessageBoxForm form = new MessageBoxForm (null, text, caption, buttons, icon);
571                                 
572                         return form.RunDialog ();
573                 }
574
575                 public static DialogResult Show (string text, string caption, MessageBoxButtons buttons,
576                                                  MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
577                 {
578
579                         MessageBoxForm form = new MessageBoxForm (null, text, caption, buttons,
580                                                                   icon, defaultButton, MessageBoxOptions.DefaultDesktopOnly, false);
581                                 
582                         return form.RunDialog ();
583                 }
584
585                 public static DialogResult Show (IWin32Window owner, string text, string caption,
586                                                  MessageBoxButtons buttons, MessageBoxIcon icon,
587                                                  MessageBoxDefaultButton defaultButton)
588                 {
589                         MessageBoxForm form = new MessageBoxForm (owner, text, caption, buttons,
590                                                                   icon, defaultButton, MessageBoxOptions.DefaultDesktopOnly, false);
591                                 
592                         return form.RunDialog ();
593                 }
594
595                 public static DialogResult Show (string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
596                                                  MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
597                 {
598                         MessageBoxForm form = new MessageBoxForm (null, text, caption, buttons,
599                                                                   icon, defaultButton, options, false);
600                                 
601                         return form.RunDialog ();
602                 }
603
604                 public static DialogResult Show (IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
605                                                  MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
606                 {
607                         MessageBoxForm form = new MessageBoxForm (owner, text, caption, buttons,
608                                                                   icon, defaultButton, options, false);
609                                 
610                         return form.RunDialog ();
611                 }
612                 #endregion      // Public Static Methods
613
614 #if NET_2_0
615                 public static DialogResult Show (string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
616                                                  MessageBoxDefaultButton defaultButton, MessageBoxOptions options,
617                                                  bool displayHelpButton)
618                 {
619                         MessageBoxForm form = new MessageBoxForm (null, text, caption, buttons,
620                                                                   icon, defaultButton, options, displayHelpButton);
621                         return form.RunDialog ();
622                 }
623                 
624                 [MonoTODO ("Help is not implemented")]
625                 public static DialogResult Show (string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
626                                                  MessageBoxDefaultButton defaultButton, MessageBoxOptions options,
627                                                  string helpFilePath)
628                 {
629                         MessageBoxForm form = new MessageBoxForm (null, text, caption, buttons,
630                                                                   icon, defaultButton, options, true);
631                         form.SetHelpData (helpFilePath, null, HelpNavigator.TableOfContents, null);
632                         return form.RunDialog ();
633                 }
634                 
635                 [MonoTODO ("Help is not implemented")]
636                 public static DialogResult Show (string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
637                                                  MessageBoxDefaultButton defaultButton, MessageBoxOptions options,
638                                                  string helpFilePath, string keyword)
639                 {
640                         MessageBoxForm form = new MessageBoxForm (null, text, caption, buttons,
641                                                                   icon, defaultButton, options, true);
642                         form.SetHelpData (helpFilePath, keyword, HelpNavigator.TableOfContents, null);
643                         return form.RunDialog ();
644                 }
645                 
646                 [MonoTODO ("Help is not implemented")]
647                 public static DialogResult Show (string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
648                                                  MessageBoxDefaultButton defaultButton, MessageBoxOptions options,
649                                                  string helpFilePath, HelpNavigator navigator)
650                 {
651                         MessageBoxForm form = new MessageBoxForm (null, text, caption, buttons,
652                                                                   icon, defaultButton, options, true);
653                         form.SetHelpData (helpFilePath, null, navigator, null);
654                         return form.RunDialog ();
655                 }
656                 
657                 [MonoTODO ("Help is not implemented")]
658                 public static DialogResult Show (string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
659                                                  MessageBoxDefaultButton defaultButton, MessageBoxOptions options,
660                                                  string helpFilePath, HelpNavigator navigator, object param)
661                 {
662                         MessageBoxForm form = new MessageBoxForm (null, text, caption, buttons,
663                                                                   icon, defaultButton, options, true);
664                         form.SetHelpData (helpFilePath, null, navigator, param);
665                         return form.RunDialog ();
666                 }
667                 
668                 [MonoTODO ("Help is not implemented")]
669                 public static DialogResult Show (IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
670                                                  MessageBoxDefaultButton defaultButton, MessageBoxOptions options,
671                                                  string helpFilePath)
672                 {
673                         MessageBoxForm form = new MessageBoxForm (owner, text, caption, buttons,
674                                                                   icon, defaultButton, options, true);
675                         form.SetHelpData (helpFilePath, null, HelpNavigator.TableOfContents, null);
676                         return form.RunDialog ();
677                 }
678                 
679                 [MonoTODO ("Help is not implemented")]
680                 public static DialogResult Show (IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
681                                                  MessageBoxDefaultButton defaultButton, MessageBoxOptions options,
682                                                  string helpFilePath, string keyword)
683                 {
684                         MessageBoxForm form = new MessageBoxForm (owner, text, caption, buttons,
685                                                                   icon, defaultButton, options, true);
686                         form.SetHelpData (helpFilePath, keyword, HelpNavigator.TableOfContents, null);
687                         return form.RunDialog ();
688                 }
689                 
690                 [MonoTODO ("Help is not implemented")]
691                 public static DialogResult Show (IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
692                                                  MessageBoxDefaultButton defaultButton, MessageBoxOptions options,
693                                                  string helpFilePath, HelpNavigator navigator)
694                 {
695                         MessageBoxForm form = new MessageBoxForm (owner, text, caption, buttons,
696                                                                   icon, defaultButton, options, true);
697                         form.SetHelpData (helpFilePath, null, navigator, null);
698                         return form.RunDialog ();
699                 }
700                 
701                 [MonoTODO ("Help is not implemented")]
702                 public static DialogResult Show (IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
703                                                  MessageBoxDefaultButton defaultButton, MessageBoxOptions options,
704                                                  string helpFilePath, HelpNavigator navigator, object param)
705                 {
706                         MessageBoxForm form = new MessageBoxForm (owner, text, caption, buttons,
707                                                                   icon, defaultButton, options, true);
708                         form.SetHelpData (helpFilePath, null, navigator, param);
709                         return form.RunDialog ();
710                 }
711 #endif
712         }
713 }
714