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:
9 // The above copyright notice and this permission notice shall be
10 // included in all copies or substantial portions of the Software.
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.
20 // Copyright (c) 2004-2006 Novell, Inc.
23 // Peter Bartok pbartok@novell.com
29 using System.Collections;
30 using System.ComponentModel;
32 namespace System.Windows.Forms {
33 public class CreateParams {
34 #region Local Variables
35 private string caption;
36 private string class_name;
37 private int class_style;
45 private IntPtr parent;
47 internal Control control;
48 #endregion // Local variables
50 #region Public Constructors
51 public CreateParams() {
53 #endregion // Public Constructors
55 #region Public Instance Properties
56 public string Caption {
57 get { return caption; }
58 set { caption = value; }
61 public string ClassName {
62 get { return class_name; }
63 set { class_name = value; }
66 public int ClassStyle {
67 get { return class_style; }
68 set { class_style = value; }
72 get { return ex_style; }
73 set { ex_style = value; }
88 set { width = value; }
92 get { return height; }
93 set { height = value; }
98 set { style = value; }
101 public object Param {
102 get { return param; }
103 set { param = value; }
106 public IntPtr Parent {
107 get { return parent; }
108 set { parent = value; }
110 #endregion // Public Instance Properties
112 #region Internal Instance Methods
113 internal bool IsSet (WindowStyles Style) {
114 return (this.style & (int) Style) == (int) Style;
117 internal bool IsSet (WindowExStyles ExStyle) {
118 return (this.ex_style & (int) ExStyle) == (int) ExStyle;
121 internal static bool IsSet (WindowExStyles ExStyle, WindowExStyles Option) {
122 return (Option & ExStyle) == Option;
125 internal static bool IsSet (WindowStyles Style, WindowStyles Option) {
126 return (Option & Style) == Option;
129 internal bool HasWindowManager {
134 Form form = control as Form;
139 return form.window_manager != null;
142 internal WindowExStyles WindowExStyle {
144 return (WindowExStyles) ex_style;
148 ex_style = (int)value;
152 internal WindowStyles WindowStyle {
154 return (WindowStyles) style;
162 #region Public Instance Methods
163 public override string ToString() {
164 return string.Format ("CreateParams {{'{0}', '{1}', 0x{2:X}, 0x{3:X}, {{{4}, {5}, {6}, {7}}}}}",
165 class_name, caption, class_style, ex_style, x, y, width, height);
167 #endregion // Public Instance Methods