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) != 0;
117 internal bool IsSet (WindowExStyles ExStyle) {
118 return (this.ex_style & (int)ExStyle) != 0;
121 internal bool HasWindowManager {
123 return control != null && control is Form && ((Form) control).window_manager != null;
126 internal WindowExStyles WindowExStyle {
128 return (WindowExStyles) ex_style;
132 ex_style = (int)value;
136 internal WindowStyles WindowStyle {
138 return (WindowStyles) style;
146 #region Public Instance Methods
147 public override string ToString() {
148 return "CreateParams {'" + class_name +
150 "', " + String.Format("0x{0:X}", class_style) +
151 ", " + String.Format("0x{0:X}", ex_style) +
152 ", {" + String.Format("{0}", x) +
153 ", " + String.Format("{0}", y) +
154 ", " + String.Format("{0}", width) +
155 ", " + String.Format("{0}", height) +
158 #endregion // Public Instance Methods