2 // System.Windows.Forms.MessageBox.cs
5 // stubbed out by Paul Osman (paul.osman@sympatico.ca)
6 // Dennis Hayes (dennish@Raytek.com)
7 // WINELib implementation started by John Sohn (jsohn@columbus.rr.com)
9 // (C) 2002/3 Ximian, Inc
13 // Permission is hereby granted, free of charge, to any person obtaining
14 // a copy of this software and associated documentation files (the
15 // "Software"), to deal in the Software without restriction, including
16 // without limitation the rights to use, copy, modify, merge, publish,
17 // distribute, sublicense, and/or sell copies of the Software, and to
18 // permit persons to whom the Software is furnished to do so, subject to
19 // the following conditions:
21 // The above copyright notice and this permission notice shall be
22 // included in all copies or substantial portions of the Software.
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 using System
.Reflection
;
35 using System
.Globalization
;
36 //using System.Windows.Forms.AccessibleObject.IAccessible;
39 namespace System
.Windows
.Forms
{
42 /// Most items complete
44 public class MessageBox
{
46 private MessageBox(){//For signiture compatablity. Prevents the auto creation of public constructor
54 public static DialogResult
Show(string text
)
57 Win32
.MessageBoxA ((IntPtr
) 0, text
, "", (uint)(WB_MessageBox_Types
.MB_OK
| WB_MessageBox_Types
.MB_TASKMODAL
));
60 public static DialogResult
Show (IWin32Window owner
, string text
)
63 Win32
.MessageBoxA (owner
.Handle
, text
, "", (uint)WB_MessageBox_Types
.MB_OK
);
67 public static DialogResult
Show (string text
, string caption
)
70 Win32
.MessageBoxA ((IntPtr
) 0, text
, caption
, (uint)WB_MessageBox_Types
.MB_OK
);
73 public static DialogResult
Show (IWin32Window owner
, string text
, string caption
)
76 Win32
.MessageBoxA (owner
.Handle
, text
, caption
, (uint)WB_MessageBox_Types
.MB_OK
);
79 public static DialogResult
Show (string text
, string caption
,
80 MessageBoxButtons buttons
)
83 Win32
.MessageBoxA ((IntPtr
) 0, text
, caption
, (uint) buttons
);
86 public static DialogResult
Show (
87 IWin32Window owner
, string text
,
88 string caption
, MessageBoxButtons buttons
)
91 Win32
.MessageBoxA (owner
.Handle
, text
, caption
, (uint) buttons
);
94 public static DialogResult
Show (
95 string text
, string caption
, MessageBoxButtons buttons
,
99 Win32
.MessageBoxA ((IntPtr
) 0, text
, caption
,
100 (uint) ((uint)buttons
| (uint)icon
) );
103 public static DialogResult
Show (
104 IWin32Window owner
, string text
, string caption
,
105 MessageBoxButtons buttons
, MessageBoxIcon icon
)
107 return (DialogResult
)
108 Win32
.MessageBoxA (owner
.Handle
, text
, caption
,
109 (uint) ((uint)buttons
|(uint) icon
) );
113 public static DialogResult
Show (
114 string text
, string caption
, MessageBoxButtons buttons
,
115 MessageBoxIcon icon
, MessageBoxDefaultButton defaultButton
)
117 return (DialogResult
)
118 Win32
.MessageBoxA ((IntPtr
) 0, text
, caption
,
119 (uint) ((uint)buttons
| (uint)icon
| (uint)defaultButton
) );
123 public static DialogResult
Show (
124 IWin32Window owner
, string text
, string caption
,
125 MessageBoxButtons buttons
, MessageBoxIcon icon
,
126 MessageBoxDefaultButton defaultButton
)
128 return (DialogResult
)
129 Win32
.MessageBoxA (owner
.Handle
, text
, caption
,
130 (uint) ((uint)buttons
| (uint)icon
| (uint)defaultButton
) );
133 public static DialogResult
134 Show (string text
, string caption
,
135 MessageBoxButtons buttons
, MessageBoxIcon icon
,
136 MessageBoxDefaultButton defaultButton
, MessageBoxOptions options
)
138 return (DialogResult
)
139 Win32
.MessageBoxA ((IntPtr
) 0, text
, caption
,
140 (uint) ((uint)buttons
| (uint)icon
| (uint)defaultButton
|(uint) options
) );
143 public static DialogResult
Show (
144 IWin32Window owner
, string text
, string caption
,
145 MessageBoxButtons buttons
, MessageBoxIcon icon
,
146 MessageBoxDefaultButton defaultButton
, MessageBoxOptions options
)
148 return (DialogResult
)
149 Win32
.MessageBoxA (owner
.Handle
, text
, caption
,
150 (uint) ((uint)buttons
| (uint)icon
| (uint)defaultButton
| (uint)options
) );