doc: Fixed newlines (specified by <BR> rather than \n)
[sdk] / doc / ecere / ecere / gui / Window.econ
1 {
2    name = "Window",
3    description = "Base class for all GUI elements (controls, dialogs and forms)",
4    fields = [
5       {
6          "sbh",
7          {
8             description = "This is the instance of the horizontal ScrollBar. Generally only used internally by eC."
9          }
10       },
11       {
12          "sbv",
13          {
14             description = "This is the instance of the vertical ScrollBar. Generally only used internally by eC."
15          }
16       }
17    ],
18    properties = [
19       {
20          "alphaBlend",
21          {
22             description = "Set to true to blend with the desktop environment's. Support & performance varies."
23          }
24       },
25       {
26          "anchor",
27          {
28             description = "Very similar to position, only with more versatility. Anchor allows you to set the top, left, bottom, and right settings relative to the top, left, bottom and right of the Window/Controls parent's clientArea."
29          }
30       },
31       {
32          "background",
33          {
34             description = "Color the client area is filled with"
35          }
36       },
37       {
38          "borderStyle",
39          {
40             description = "The type of Window frame your Window has."
41          }
42       },
43       {
44          "caption",
45          {
46             description = "The text which should appear in the caption of this window. For forms/dialogs with title bars, this will appear in the title bar. For controls, this is typically the text which should appear in the label associated with th control through the 'labeledWindow' property."
47          }
48       },
49       {
50          "clickThrough",
51          {
52             description = "When true, this Window/Control redirects mouse clicks to its parent rather than processing the mouse clicks itself. Essentially, the mouse becomes invisible to this item."
53          }
54       },
55       {
56          "clientSize",
57          {
58             description = "Sets the size of the interior of the Window; the Client Area.<br>"
59                "Example: clientSize = { 190, 290 };"
60          }
61       },
62       {
63          "closeButton",
64          {
65             description = "This is the control for the CloseButton at the top right of the Window."
66          }
67       },
68       {
69          "disabled",
70          {
71             description = "Greys out ALL controls within the Window making them unusable, including the controls on the TitleBar. When applied to an individual control, rather than an entire Window, then only that control is greyed out an unusable."
72          }
73       },
74       {
75          "dontHideScroll",
76          {
77             description = "When true, the Horizontal and Vertical Scroll Bars are not hidden when all the contents are within the viewspace."
78          }
79       },
80       {
81          "drawBehind",
82          {
83             description = "When true(default), then the contents of the screen behind the Window are still redrawn. If false, then the screen behind is not redrawn, which can leave \"ghosts\" of the Window on the screen when it is moved or resized."
84          }
85       },
86       {
87          "font",
88          {
89             description = "Default font used for rendering the text within this Window and its controls.."
90          }
91       },
92       {
93          "foreground",
94          {
95             description = "The Color of the text in the Client Area.<br>"
96                "Example: foreground = { r = 0, g = 0, b = 0 };"
97          }
98       },
99       {
100          "hasClose",
101          {
102             description = "When true, the Window will contain a Close button on the top right side of the Title Bar."
103          }
104       },
105       {
106          "hasHorzScroll",
107          {
108             description = "When true, the Window has a Horizontal Scroll bar across its bottom. When the contents of the Window exceeds its horizontal borders."
109          }
110       },
111       {
112          "hasMaximize",
113          {
114             description = "When true, the Window will contain a Maximize button on the right side of the Title Bar."
115          }
116       },
117       {
118          "hasMenuBar",
119          {
120             description = "When true, the Window will contain a Menu Bar immediately below the Title Bar."
121          }
122       },
123       {
124          "hasMinimize",
125          {
126             description = "When true, the Window will contain a Minimize button on the right side of the Title Bar."
127          }
128       },
129       {
130          "hasStatusBar",
131          {
132             description = "When true, the Window will contain a Status Bar at the bottom."
133          }
134       },
135       {
136          "hasVertScroll",
137          {
138             description = "When true, the Window has a Vertical Scroll bar along the right hand side. When the contents of the Window exceeds its vertical borders."
139          }
140       },
141       {
142          "hotKey",
143          {
144             description = "The key associated with a particular Window or Control. Pressing this key, or key combination will automatically activate the associated Window or Control.<br>"
145                "Note: If the tabCycle property of the parent is not true, then hotKey will not work unless the parent is active."
146          }
147       },
148       {
149          "id",
150          {
151             description = "An integer id to uniquely identify the window (e.g. when sharing method implementations among multiple controls), or for storing arbitrary user data."
152          }
153       },
154       {
155          "isDocument",
156          {
157             description = "When true, this Window/Control would be treated as a document, enabling things like having the path show up in the Title Bar. <br>"
158                "Note: For best results, set this property true on a Window rather than on a Control."
159          }
160       },
161       {
162          "master",
163          {
164             description = "The owner of this Window which should receive notifications (e.g. if this Window is a control)."
165          }
166       },
167       {
168          "maxClientSize",
169          {
170             description = "The Maximum allowable size for the Client Area within the window.<br>"
171                "Example: maxClientSize = { 120, 400 };"
172          }
173       },
174       {
175          "maximizeButton",
176          {
177             description = "This is the control for the MaximizeButton at the top right of the Window."
178          }
179       },
180       {
181          "menu",
182          {
183             description = "The Menu portion of the Window."
184          }
185       },
186       {
187          "minClientSize",
188          {
189             description = "The Minimum allowable size for the Client Area within the window.<br>"
190                "Example: minClientSize = { 50, 50 };"
191          }
192       },
193       {
194          "minimizeButton",
195          {
196             description = "This is the control for the MinimizeButton at the top right of the Window."
197          }
198       },
199       {
200          "name",
201          {
202             description = "(internal field for the Ecere IDE's Object Designer which matches the instance or class name)"
203          }
204       },
205       {
206          "noCycle",
207          {
208             description = "When true, then the particular control which this is set on becomes exempt from the Tab cycling normally available from it's parents tabCycle property."
209          }
210       },
211       {
212          "nonClient",
213          {
214             description = "When true, enables the Window/Control to inhabit a region outside of the clientArea, but still constrained to the Parent. Normally this is used for system controls like the buttons in the Title Bar."
215          }
216       },
217       {
218          "normalAnchor",
219          {
220             description = "The anchor of the Window in its normal state, that is not minimized or maximized."
221          }
222       },
223       {
224          "opacity",
225          {
226             description = "A value between 0.0f and 1.0f specifying the opacity which wthich the client area's background will be filled using the background color."
227          }
228       },
229       {
230          "parent",
231          {
232             description = "The Window within whose client area this window is constrained."
233          }
234       },
235       {
236          "position",
237          {
238             description = "The position of a Window/Control relative to the top left client area of the Parent. <br>"
239                "Example: position = { 10, 10 };"
240          }
241       },
242       {
243          "size",
244          {
245             description = "Sets the size of the Window, including all the decorations.<br>"
246                "Example: size = { 200, 300 };"
247          }
248       },
249       {
250          "state",
251          {
252             description = "Sets the state of the Window, either Normal, Minimized, or Maximized.<br>"
253                "state = Normal;"
254          }
255       },
256       {
257          "stayOnTop",
258          {
259             description = "When true, the Window will stay on top of all other windows. Does not apply to controls."
260          }
261       },
262       {
263          "tabCycle",
264          {
265             description = "When true, then it becomes possible to use the tab key to cycle through all of the children of this Window/Control. The order of cycling is determined by the order of instantiation. Note: If tabCycle is not true on the parent, then children with hotKeys set, will not be activated by pressing the hotKey, unless the parent is currently active."
266          }
267       },
268       {
269          "text",
270          {
271             description = "Deprecated. Use 'caption'."
272          }
273       },
274       {
275          "visible",
276          {
277             description = "When true, the Window/Control is actually visible on the screen."
278          }
279       }
280    ],
281    methods = [
282       {
283          "Destroy",
284          {
285             description = "Destroys the current Window/Control.",
286             usage = "Used in the statement section of the source code.",
287             example = "Window<br>"
288                "{<br>"
289                "   text = \"Destroy Example\";<br>"
290                "   Button <br>"
291                "   {<br>"
292                "      text = \"Destroy this Window!\";",
293             parameters = [
294                {
295                   "code",
296                   {
297                      description = "0",
298                      position = 1
299                   }
300                }
301             ]
302          }
303       },
304       {
305          "OnCreate",
306          {
307             description = "Called any time a Window is created. And can be overridden to perform actions at the time that a window is created.",
308             returnValue = "When true, the Window creation was successful."
309          }
310       },
311       {
312          "OnRedraw",
313          {
314             description = "This method is called anytime the Window is redrawn. Usually when it is resized or moved, however can also be called manually by calling Update() to redraw the contents of the window.",
315             usage = "Use this method by overriding it in your own code, within the Window class that it belongs to.",
316             example = "class Form1 : Window<br>"
317                "{<br>"
318                "   void OnRedraw(Surface surface)<br>"
319                "   {<br>"
320                "      surface.blit( image, xdest, ydest, sourceX, sourceY, sourceW, sourceH );<br>"
321                "   }<br>"
322                "}",
323             remarks = "Typically this method is responsible for the actual drawing of all the graphics for your program.",
324             also = "OnApplyGraphics(), OnLoadGraphics(), OnResize(), OnResizing(), Update(), Window",
325             parameters = [
326                {
327                   "surface",
328                   {
329                      description = "The graphical context which is obtained for this window, which will be drawn to.",
330                      position = 1
331                   }
332                }
333             ]
334          }
335       },
336       {
337          "Update",
338          {
339             description = "Causes the OnRedraw() method of the Window to be called.",
340             usage = "Used in the statement section of the code.",
341             example = "class Form1 : Window<br>"
342                "{<br>"
343                "   Update( null ); // update the entire window<br>"
344                "   Update( { 0, 0, 50, 50 } ); // update the region from 0 to 50 on the x axis, and 0 to 50 on the y axis.<br>"
345                "} ",
346             remarks = "One should only update the necessary areas when possible, as updating the entire window indiscriminately can hog precious CPU cycles.",
347             also = "UpdateDisplay(), OnRedraw()",
348             parameters = [
349                {
350                   "region",
351                   {
352                      description = "Defines the area of the Window to be updated. If null is specified, then the entire window is updated.",
353                      position = 1
354                   }
355                }
356             ]
357          }
358       }
359    ]
360 }