Mercurial > projects > dwt-win
annotate dwt/DWT.d @ 213:36f5cb12e1a2
Update to SWT 3.4M7
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 17 May 2008 17:34:28 +0200 |
parents | ab60f3309436 |
children | fd9c62a2998e |
rev | line source |
---|---|
78 | 1 /******************************************************************************* |
0 | 2 * Copyright (c) 2000, 2007 IBM Corporation and others. |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * Port to the D Programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
4
bf9fe45b4422
C, Platform, Point, Rectangle
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
13 module dwt.DWT; |
0 | 14 |
15 | |
16 import dwt.internal.Compatibility; | |
17 import dwt.internal.Library; | |
18 import dwt.internal.Platform; | |
19 import dwt.DWTError; | |
20 import dwt.DWTException; | |
21 | |
22 import tango.core.Exception; | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
196
diff
changeset
|
23 import dwt.dwthelper.utils; |
0 | 24 |
78 | 25 version(build){ |
26 pragma(link, "advapi32"); | |
27 pragma(link, "comctl32"); | |
84
00a333240696
FileDialog, sync dwthelper with dwt-linux, some TCHAR issues
Frank Benoit <benoit@tionex.de>
parents:
78
diff
changeset
|
28 pragma(link, "comdlg32"); |
78 | 29 pragma(link, "gdi32"); |
30 pragma(link, "kernel32"); | |
31 pragma(link, "shell32"); | |
32 pragma(link, "ole32"); | |
133 | 33 pragma(link, "oleaut32"); |
34 pragma(link, "olepro32"); | |
35 pragma(link, "oleacc"); | |
78 | 36 pragma(link, "user32"); |
37 pragma(link, "usp10"); | |
38 pragma(link, "msimg32"); | |
126 | 39 pragma(link, "opengl32"); |
192
135517d29564
moved pragme link for shlwapi into DWT
Frank Benoit <benoit@tionex.de>
parents:
133
diff
changeset
|
40 pragma(link, "shlwapi"); |
78 | 41 //pragma(link, "gdiplus"); // load dynamic |
42 //pragma(link, "uxtheme"); // load dynamic | |
43 } | |
44 | |
0 | 45 /** |
46 * This class provides access to a small number of DWT system-wide | |
47 * methods, and in addition defines the public constants provided | |
48 * by DWT. | |
49 * <p> | |
50 * By defining constants like UP and DOWN in a single class, DWT | |
51 * can share common names and concepts at the same time minimizing | |
52 * the number of classes, names and constants for the application | |
53 * programmer. | |
54 * </p><p> | |
55 * Note that some of the constants provided by this class represent | |
56 * optional, appearance related aspects of widgets which are available | |
57 * either only on some window systems, or for a differing set of | |
58 * widgets on each window system. These constants are marked | |
59 * as <em>HINT</em>s. The set of widgets which support a particular | |
60 * <em>HINT</em> may change from release to release, although we typically | |
61 * will not withdraw support for a <em>HINT</em> once it is made available. | |
62 * </p> | |
63 */ | |
64 | |
65 /* NOTE: | |
66 * Good javadoc coding style is to put the values of static const | |
67 * constants in the comments. This reinforces the fact that | |
68 * consumers are allowed to rely on the value (and they must | |
69 * since the values are compiled inline in their code). We | |
70 * can <em>not</em> change the values of these constants between | |
71 * releases. | |
72 */ | |
73 public class DWT { | |
74 | |
75 /* Widget Event Constants */ | |
76 | |
77 /** | |
78 * The null event type (value is 0). | |
79 * | |
80 * @since 3.0 | |
81 */ | |
82 public static const int None = 0; | |
83 | |
84 /** | |
85 * The key down event type (value is 1). | |
86 * | |
87 * @see dwt.widgets.Widget#addListener | |
88 * @see dwt.widgets.Display#addFilter | |
89 * @see dwt.widgets.Event | |
90 * | |
91 * @see dwt.widgets.Control#addKeyListener | |
92 * @see dwt.widgets.Tracker#addKeyListener | |
93 * @see dwt.events.KeyListener#keyPressed | |
94 * @see dwt.events.KeyEvent | |
95 */ | |
96 public static const int KeyDown = 1; | |
97 | |
98 /** | |
99 * The key up event type (value is 2). | |
100 * | |
101 * @see dwt.widgets.Widget#addListener | |
102 * @see dwt.widgets.Display#addFilter | |
103 * @see dwt.widgets.Event | |
104 * | |
105 * @see dwt.widgets.Control#addKeyListener | |
106 * @see dwt.widgets.Tracker#addKeyListener | |
107 * @see dwt.events.KeyListener#keyReleased | |
108 * @see dwt.events.KeyEvent | |
109 */ | |
110 public static const int KeyUp = 2; | |
111 | |
112 /** | |
113 * The mouse down event type (value is 3). | |
114 * | |
115 * @see dwt.widgets.Widget#addListener | |
116 * @see dwt.widgets.Display#addFilter | |
117 * @see dwt.widgets.Event | |
118 * | |
119 * @see dwt.widgets.Control#addMouseListener | |
120 * @see dwt.events.MouseListener#mouseDown | |
121 * @see dwt.events.MouseEvent | |
122 */ | |
123 public static const int MouseDown = 3; | |
124 | |
125 /** | |
126 * The mouse up event type (value is 4). | |
127 * | |
128 * @see dwt.widgets.Widget#addListener | |
129 * @see dwt.widgets.Display#addFilter | |
130 * @see dwt.widgets.Event | |
131 * | |
132 * @see dwt.widgets.Control#addMouseListener | |
133 * @see dwt.events.MouseListener#mouseUp | |
134 * @see dwt.events.MouseEvent | |
135 */ | |
136 public static const int MouseUp = 4; | |
137 | |
138 /** | |
139 * The mouse move event type (value is 5). | |
140 * | |
141 * @see dwt.widgets.Widget#addListener | |
142 * @see dwt.widgets.Display#addFilter | |
143 * @see dwt.widgets.Event | |
144 * | |
145 * @see dwt.widgets.Control#addMouseMoveListener | |
146 * @see dwt.events.MouseMoveListener#mouseMove | |
147 * @see dwt.events.MouseEvent | |
148 */ | |
149 public static const int MouseMove = 5; | |
150 | |
151 /** | |
152 * The mouse enter event type (value is 6). | |
153 * | |
154 * @see dwt.widgets.Widget#addListener | |
155 * @see dwt.widgets.Display#addFilter | |
156 * @see dwt.widgets.Event | |
157 * | |
158 * @see dwt.widgets.Control#addMouseTrackListener | |
159 * @see dwt.events.MouseTrackListener#mouseEnter | |
160 * @see dwt.events.MouseEvent | |
161 */ | |
162 public static const int MouseEnter = 6; | |
163 | |
164 /** | |
165 * The mouse exit event type (value is 7). | |
166 * | |
167 * @see dwt.widgets.Widget#addListener | |
168 * @see dwt.widgets.Display#addFilter | |
169 * @see dwt.widgets.Event | |
170 * | |
171 * @see dwt.widgets.Control#addMouseTrackListener | |
172 * @see dwt.events.MouseTrackListener#mouseExit | |
173 * @see dwt.events.MouseEvent | |
174 */ | |
175 public static const int MouseExit = 7; | |
176 | |
177 /** | |
178 * The mouse double click event type (value is 8). | |
179 * | |
180 * @see dwt.widgets.Widget#addListener | |
181 * @see dwt.widgets.Display#addFilter | |
182 * @see dwt.widgets.Event | |
183 * | |
184 * @see dwt.widgets.Control#addMouseListener | |
185 * @see dwt.events.MouseListener#mouseDoubleClick | |
186 * @see dwt.events.MouseEvent | |
187 */ | |
188 public static const int MouseDoubleClick = 8; | |
189 | |
190 /** | |
191 * The paint event type (value is 9). | |
192 * | |
193 * @see dwt.widgets.Widget#addListener | |
194 * @see dwt.widgets.Display#addFilter | |
195 * @see dwt.widgets.Event | |
196 * | |
197 * @see dwt.widgets.Control#addPaintListener | |
198 * @see dwt.events.PaintListener#paintControl | |
199 * @see dwt.events.PaintEvent | |
200 */ | |
201 public static const int Paint = 9; | |
202 | |
203 /** | |
204 * The move event type (value is 10). | |
205 * | |
206 * @see dwt.widgets.Widget#addListener | |
207 * @see dwt.widgets.Display#addFilter | |
208 * @see dwt.widgets.Event | |
209 * | |
210 * @see dwt.widgets.Control#addControlListener | |
211 * @see dwt.widgets.TableColumn#addControlListener | |
212 * @see dwt.widgets.Tracker#addControlListener | |
213 * @see dwt.widgets.TreeColumn#addControlListener | |
214 * @see dwt.events.ControlListener#controlMoved | |
215 * @see dwt.events.ControlEvent | |
216 */ | |
217 public static const int Move = 10; | |
218 | |
219 /** | |
220 * The resize event type (value is 11). | |
221 * | |
222 * @see dwt.widgets.Widget#addListener | |
223 * @see dwt.widgets.Display#addFilter | |
224 * @see dwt.widgets.Event | |
225 * | |
226 * @see dwt.widgets.Control#addControlListener | |
227 * @see dwt.widgets.TableColumn#addControlListener | |
228 * @see dwt.widgets.Tracker#addControlListener | |
229 * @see dwt.widgets.TreeColumn#addControlListener | |
230 * @see dwt.events.ControlListener#controlResized | |
231 * @see dwt.events.ControlEvent | |
232 */ | |
233 public static const int Resize = 11; | |
234 | |
235 /** | |
236 * The dispose event type (value is 12). | |
237 * | |
238 * @see dwt.widgets.Widget#addListener | |
239 * @see dwt.widgets.Display#addListener | |
240 * @see dwt.widgets.Display#addFilter | |
241 * @see dwt.widgets.Event | |
242 * | |
243 * @see dwt.widgets.Widget#addDisposeListener | |
244 * @see dwt.events.DisposeListener#widgetDisposed | |
245 * @see dwt.events.DisposeEvent | |
246 */ | |
247 public static const int Dispose = 12; | |
248 | |
249 /** | |
250 * The selection event type (value is 13). | |
251 * | |
252 * @see dwt.widgets.Widget#addListener | |
253 * @see dwt.widgets.Display#addFilter | |
254 * @see dwt.widgets.Event | |
255 * | |
256 * @see dwt.widgets.Button#addSelectionListener | |
257 * @see dwt.widgets.Combo#addSelectionListener | |
258 * @see dwt.widgets.CoolItem#addSelectionListener | |
259 * @see dwt.widgets.Link#addSelectionListener | |
260 * @see dwt.widgets.List#addSelectionListener | |
261 * @see dwt.widgets.MenuItem#addSelectionListener | |
262 * @see dwt.widgets.Sash#addSelectionListener | |
263 * @see dwt.widgets.Scale#addSelectionListener | |
264 * @see dwt.widgets.ScrollBar#addSelectionListener | |
265 * @see dwt.widgets.Slider#addSelectionListener | |
266 * @see dwt.widgets.TabFolder#addSelectionListener | |
267 * @see dwt.widgets.Table#addSelectionListener | |
268 * @see dwt.widgets.TableColumn#addSelectionListener | |
269 * @see dwt.widgets.ToolItem#addSelectionListener | |
270 * @see dwt.widgets.TrayItem#addSelectionListener | |
271 * @see dwt.widgets.Tree#addSelectionListener | |
272 * @see dwt.widgets.TreeColumn#addSelectionListener | |
273 * @see dwt.events.SelectionListener#widgetSelected | |
274 * @see dwt.events.SelectionEvent | |
275 */ | |
276 public static const int Selection = 13; | |
277 | |
278 /** | |
279 * The default selection event type (value is 14). | |
280 * | |
281 * @see dwt.widgets.Widget#addListener | |
282 * @see dwt.widgets.Display#addFilter | |
283 * @see dwt.widgets.Event | |
284 * | |
285 * @see dwt.widgets.Combo#addSelectionListener | |
286 * @see dwt.widgets.List#addSelectionListener | |
287 * @see dwt.widgets.Spinner#addSelectionListener | |
288 * @see dwt.widgets.Table#addSelectionListener | |
289 * @see dwt.widgets.Text#addSelectionListener | |
290 * @see dwt.widgets.TrayItem#addSelectionListener | |
291 * @see dwt.widgets.Tree#addSelectionListener | |
292 * @see dwt.events.SelectionListener#widgetDefaultSelected | |
293 * @see dwt.events.SelectionEvent | |
294 */ | |
295 public static const int DefaultSelection = 14; | |
296 | |
297 /** | |
298 * The focus in event type (value is 15). | |
299 * | |
300 * @see dwt.widgets.Widget#addListener | |
301 * @see dwt.widgets.Display#addFilter | |
302 * @see dwt.widgets.Event | |
303 * | |
304 * @see dwt.widgets.Control#addFocusListener | |
305 * @see dwt.events.FocusListener#focusGained | |
306 * @see dwt.events.FocusEvent | |
307 */ | |
308 public static const int FocusIn = 15; | |
309 | |
310 /** | |
311 * The focus out event type (value is 16). | |
312 * | |
313 * @see dwt.widgets.Widget#addListener | |
314 * @see dwt.widgets.Display#addFilter | |
315 * @see dwt.widgets.Event | |
316 * | |
317 * @see dwt.widgets.Control#addFocusListener | |
318 * @see dwt.events.FocusListener#focusLost | |
319 * @see dwt.events.FocusEvent | |
320 */ | |
321 public static const int FocusOut = 16; | |
322 | |
323 /** | |
324 * The expand event type (value is 17). | |
325 * | |
326 * @see dwt.widgets.Widget#addListener | |
327 * @see dwt.widgets.Display#addFilter | |
328 * @see dwt.widgets.Event | |
329 * | |
330 * @see dwt.widgets.Tree#addTreeListener | |
331 * @see dwt.events.TreeListener#treeExpanded | |
332 * @see dwt.events.TreeEvent | |
333 */ | |
334 public static const int Expand = 17; | |
335 | |
336 /** | |
337 * The collapse event type (value is 18). | |
338 * | |
339 * @see dwt.widgets.Widget#addListener | |
340 * @see dwt.widgets.Display#addFilter | |
341 * @see dwt.widgets.Event | |
342 * | |
343 * @see dwt.widgets.Tree#addTreeListener | |
344 * @see dwt.events.TreeListener#treeCollapsed | |
345 * @see dwt.events.TreeEvent | |
346 */ | |
347 public static const int Collapse = 18; | |
348 | |
349 /** | |
350 * The iconify event type (value is 19). | |
351 * | |
352 * @see dwt.widgets.Widget#addListener | |
353 * @see dwt.widgets.Display#addFilter | |
354 * @see dwt.widgets.Event | |
355 * | |
356 * @see dwt.widgets.Shell#addShellListener | |
357 * @see dwt.events.ShellListener#shellIconified | |
358 * @see dwt.events.ShellEvent | |
359 */ | |
360 public static const int Iconify = 19; | |
361 | |
362 /** | |
363 * The de-iconify event type (value is 20). | |
364 * | |
365 * @see dwt.widgets.Widget#addListener | |
366 * @see dwt.widgets.Display#addFilter | |
367 * @see dwt.widgets.Event | |
368 * | |
369 * @see dwt.widgets.Shell#addShellListener | |
370 * @see dwt.events.ShellListener#shellDeiconified | |
371 * @see dwt.events.ShellEvent | |
372 */ | |
373 public static const int Deiconify = 20; | |
374 | |
375 /** | |
376 * The close event type (value is 21). | |
377 * | |
378 * @see dwt.widgets.Widget#addListener | |
379 * @see dwt.widgets.Display#addListener | |
380 * @see dwt.widgets.Display#addFilter | |
381 * @see dwt.widgets.Event | |
382 * | |
383 * @see dwt.widgets.Shell#addShellListener | |
384 * @see dwt.events.ShellListener#shellClosed | |
385 * @see dwt.events.ShellEvent | |
386 */ | |
387 public static const int Close = 21; | |
388 | |
389 /** | |
390 * The show event type (value is 22). | |
391 * | |
392 * @see dwt.widgets.Widget#addListener | |
393 * @see dwt.widgets.Display#addFilter | |
394 * @see dwt.widgets.Event | |
395 * | |
396 * @see dwt.widgets.Menu#addMenuListener | |
397 * @see dwt.events.MenuListener#menuShown | |
398 * @see dwt.events.MenuEvent | |
399 */ | |
400 public static const int Show = 22; | |
401 | |
402 /** | |
403 * The hide event type (value is 23). | |
404 * | |
405 * @see dwt.widgets.Widget#addListener | |
406 * @see dwt.widgets.Display#addFilter | |
407 * @see dwt.widgets.Event | |
408 * | |
409 * @see dwt.widgets.Menu#addMenuListener | |
410 * @see dwt.events.MenuListener#menuHidden | |
411 * @see dwt.events.MenuEvent | |
412 */ | |
413 public static const int Hide = 23; | |
414 | |
415 /** | |
416 * The modify event type (value is 24). | |
417 * | |
418 * @see dwt.widgets.Widget#addListener | |
419 * @see dwt.widgets.Display#addFilter | |
420 * @see dwt.widgets.Event | |
421 * | |
422 * @see dwt.widgets.Combo#addModifyListener | |
423 * @see dwt.widgets.Spinner#addModifyListener | |
424 * @see dwt.widgets.Text#addModifyListener | |
425 * @see dwt.events.ModifyListener#modifyText | |
426 * @see dwt.events.ModifyEvent | |
427 */ | |
428 public static const int Modify = 24; | |
429 | |
430 /** | |
431 * The verify event type (value is 25). | |
432 * | |
433 * @see dwt.widgets.Widget#addListener | |
434 * @see dwt.widgets.Display#addFilter | |
435 * @see dwt.widgets.Event | |
436 * | |
437 * @see dwt.widgets.Combo#addVerifyListener | |
438 * @see dwt.widgets.Text#addVerifyListener | |
439 * @see dwt.events.VerifyListener#verifyText | |
440 * @see dwt.events.VerifyEvent | |
441 */ | |
442 public static const int Verify = 25; | |
443 | |
444 /** | |
445 * The activate event type (value is 26). | |
446 * | |
447 * @see dwt.widgets.Widget#addListener | |
448 * @see dwt.widgets.Display#addFilter | |
449 * @see dwt.widgets.Event | |
450 * | |
451 * @see dwt.widgets.Shell#addShellListener | |
452 * @see dwt.events.ShellListener#shellActivated | |
453 * @see dwt.events.ShellEvent | |
454 */ | |
455 public static const int Activate = 26; | |
456 | |
457 /** | |
458 * The deactivate event type (value is 27). | |
459 * | |
460 * @see dwt.widgets.Widget#addListener | |
461 * @see dwt.widgets.Display#addFilter | |
462 * @see dwt.widgets.Event | |
463 * | |
464 * @see dwt.widgets.Shell#addShellListener | |
465 * @see dwt.events.ShellListener#shellDeactivated | |
466 * @see dwt.events.ShellEvent | |
467 */ | |
468 public static const int Deactivate = 27; | |
469 | |
470 /** | |
471 * The help event type (value is 28). | |
472 * | |
473 * @see dwt.widgets.Widget#addListener | |
474 * @see dwt.widgets.Display#addFilter | |
475 * @see dwt.widgets.Event | |
476 * | |
477 * @see dwt.widgets.Control#addHelpListener | |
478 * @see dwt.widgets.Menu#addHelpListener | |
479 * @see dwt.widgets.MenuItem#addHelpListener | |
480 * @see dwt.events.HelpListener#helpRequested | |
481 * @see dwt.events.HelpEvent | |
482 */ | |
483 public static const int Help = 28; | |
484 | |
485 /** | |
486 * The drag detect event type (value is 29). | |
487 * | |
488 * @see dwt.widgets.Widget#addListener | |
489 * @see dwt.widgets.Display#addFilter | |
490 * @see dwt.widgets.Event | |
491 * | |
492 * @see dwt.dnd.DragSource | |
493 */ | |
494 public static const int DragDetect = 29; | |
495 | |
496 /** | |
497 * The arm event type (value is 30). | |
498 * | |
499 * @see dwt.widgets.Widget#addListener | |
500 * @see dwt.widgets.Display#addFilter | |
501 * @see dwt.widgets.Event | |
502 * | |
503 * @see dwt.widgets.MenuItem#addArmListener | |
504 * @see dwt.events.ArmListener#widgetArmed | |
505 * @see dwt.events.ArmEvent | |
506 */ | |
507 public static const int Arm = 30; | |
508 | |
509 /** | |
510 * The traverse event type (value is 31). | |
511 * | |
512 * @see dwt.widgets.Widget#addListener | |
513 * @see dwt.widgets.Display#addFilter | |
514 * @see dwt.widgets.Event | |
515 * | |
516 * @see dwt.widgets.Control#addTraverseListener | |
517 * @see dwt.events.TraverseListener#keyTraversed | |
518 * @see dwt.events.TraverseEvent | |
519 */ | |
520 public static const int Traverse = 31; | |
521 | |
522 /** | |
523 * The mouse hover event type (value is 32). | |
524 * | |
525 * @see dwt.widgets.Widget#addListener | |
526 * @see dwt.widgets.Display#addFilter | |
527 * @see dwt.widgets.Event | |
528 * | |
529 * @see dwt.widgets.Control#addMouseTrackListener | |
530 * @see dwt.events.MouseTrackListener#mouseHover | |
531 * @see dwt.events.MouseEvent | |
532 */ | |
533 public static const int MouseHover = 32; | |
534 | |
535 /** | |
536 * The hardware key down event type (value is 33). | |
537 * | |
538 * @see dwt.widgets.Widget#addListener | |
539 * @see dwt.widgets.Display#addFilter | |
540 * @see dwt.widgets.Event | |
541 */ | |
542 public static const int HardKeyDown = 33; | |
543 | |
544 /** | |
545 * The hardware key up event type (value is 34). | |
546 * | |
547 * @see dwt.widgets.Widget#addListener | |
548 * @see dwt.widgets.Display#addFilter | |
549 * @see dwt.widgets.Event | |
550 */ | |
551 public static const int HardKeyUp = 34; | |
552 | |
553 /** | |
554 * The menu detect event type (value is 35). | |
555 * | |
556 * @see dwt.widgets.Widget#addListener | |
557 * @see dwt.widgets.Display#addFilter | |
558 * @see dwt.widgets.Event | |
559 * | |
560 * @since 3.0 | |
561 */ | |
562 public static const int MenuDetect = 35; | |
563 | |
564 /** | |
565 * The set data event type (value is 36). | |
566 * | |
567 * @see dwt.widgets.Widget#addListener | |
568 * @see dwt.widgets.Display#addFilter | |
569 * @see dwt.widgets.Event | |
570 * | |
571 * @see dwt.widgets.Table | |
572 * @see dwt.widgets.Tree | |
573 * | |
574 * @since 3.0 | |
575 */ | |
576 public static const int SetData = 36; | |
577 | |
578 /** | |
579 * The mouse wheel event type (value is 37). | |
580 * | |
581 * @see dwt.widgets.Widget#addListener | |
582 * @see dwt.widgets.Display#addFilter | |
583 * @see dwt.widgets.Event | |
584 * | |
585 * @since 3.1 | |
586 */ | |
587 public static const int MouseWheel = 37; | |
588 | |
589 /** | |
590 * The settings changed event type (value is 39). | |
591 * <p> | |
592 * The settings changed event is sent when an operating system | |
593 * property, such as a system font or color, has been changed. | |
594 * The event occurs after the property has been changed, but | |
595 * before any widget is redrawn. Applications that cache operating | |
596 * system properties can use this event to update their caches. | |
597 * A specific property change can be detected by querying the | |
598 * new value of a property and comparing it with the equivalent | |
599 * cached value. The operating system automatically redraws and | |
600 * lays out all widgets after this event is sent. | |
601 * </p> | |
602 * | |
603 * @see dwt.widgets.Display#addListener | |
604 * @see dwt.widgets.Event | |
605 * | |
606 * @since 3.2 | |
607 */ | |
608 public static const int Settings = 39; | |
609 | |
610 /** | |
611 * The erase item event type (value is 40). | |
612 * | |
613 * @see dwt.widgets.Widget#addListener | |
614 * @see dwt.widgets.Display#addFilter | |
615 * @see dwt.widgets.Event | |
616 * | |
617 * @since 3.2 | |
618 */ | |
619 public static const int EraseItem = 40; | |
620 | |
621 /** | |
622 * The measure item event type (value is 41). | |
623 * | |
624 * @see dwt.widgets.Widget#addListener | |
625 * @see dwt.widgets.Display#addFilter | |
626 * @see dwt.widgets.Event | |
627 * | |
628 * @since 3.2 | |
629 */ | |
630 public static const int MeasureItem = 41; | |
631 | |
632 /** | |
633 * The paint item event type (value is 42). | |
634 * | |
635 * @see dwt.widgets.Widget#addListener | |
636 * @see dwt.widgets.Display#addFilter | |
637 * @see dwt.widgets.Event | |
638 * | |
639 * @since 3.2 | |
640 */ | |
641 public static const int PaintItem = 42; | |
642 | |
213 | 643 /** |
644 * The IME composition event type (value is 43). | |
645 * <p> | |
646 * The IME composition event is sent to allow | |
647 * custom text editors to implement in-line | |
648 * editing of international text. | |
649 * </p> | |
650 * | |
651 * The detail field indicates the action to be taken: | |
652 * <p><ul> | |
653 * <li>{@link DWT#COMPOSITION_CHANGED}</li> | |
654 * <li>{@link DWT#COMPOSITION_OFFSET}</li> | |
655 * <li>{@link DWT#COMPOSITION_SELECTION}</li> | |
656 * </ul></p> | |
657 * | |
658 * @see dwt.widgets.Widget#addListener | |
659 * @see dwt.widgets.Display#addFilter | |
660 * @see dwt.widgets.Event | |
661 * | |
662 * @since 3.4 | |
663 */ | |
664 public static const int ImeComposition = 43; | |
665 | |
0 | 666 /* Event Details */ |
667 | |
668 /** | |
213 | 669 * The IME composition event detail that indicates |
670 * a change in the IME composition. The text field | |
671 * of the event is the new composition text. | |
672 * The start and end indicate the offsets where the | |
673 * composition text should be inserted. | |
674 * The styles and ranges are stored in the IME | |
675 * object (value is 1). | |
676 * | |
677 * @see DWT#ImeComposition | |
678 * | |
679 * @since 3.4 | |
680 */ | |
681 public static const int COMPOSITION_CHANGED = 1; | |
682 | |
683 /** | |
684 * The IME composition event detail that indicates | |
685 * that the IME needs the offset for a given location. | |
686 * The x and y fields of the event are used by the | |
687 * application to determine the offset. | |
688 * | |
689 * The index field of the event should be set to the | |
690 * text offset at that location. The count field should | |
691 * be set to indicate whether the location is closer to | |
692 * the leading edge (0) or the trailing edge (1) (value is 2). | |
693 * | |
694 * @see DWT#ImeComposition | |
695 * @see dwt.graphics.TextLayout#getOffset(int, int, int[]) | |
696 * | |
697 * @since 3.4 | |
698 */ | |
699 public static const int COMPOSITION_OFFSET = 2; | |
700 | |
701 /** | |
702 * The IME composition event detail that indicates | |
703 * that IME needs the selected text and its start | |
704 * and end offsets (value is 3). | |
705 * | |
706 * @see DWT#ImeComposition | |
707 * | |
708 * @since 3.4 | |
709 */ | |
710 public static const int COMPOSITION_SELECTION = 3; | |
711 | |
712 /** | |
0 | 713 * Indicates that a user-interface component is being dragged, |
714 * for example dragging the thumb of a scroll bar (value is 1). | |
715 */ | |
716 public static const int DRAG = 1; | |
717 | |
718 /** | |
719 * Event detail field that indicates a user-interface component | |
720 * state is selected (value is 1<<1). | |
721 * | |
722 * @since 3.2 | |
723 */ | |
724 public static const int SELECTED = 1 << 1; | |
725 | |
726 /** | |
727 * Event detail field that indicates a user-interface component | |
728 * state is focused (value is 1<<2). | |
729 * | |
730 * @since 3.2 | |
731 */ | |
732 public static const int FOCUSED = 1 << 2; | |
733 | |
734 /** | |
735 * Event detail field that indicates a user-interface component | |
736 * draws the background (value is 1<<3). | |
737 * | |
738 * @since 3.2 | |
739 */ | |
740 public static const int BACKGROUND = 1 << 3; | |
741 | |
742 /** | |
743 * Event detail field that indicates a user-interface component | |
744 * draws the foreground (value is 1<<4). | |
745 * | |
746 * @since 3.2 | |
747 */ | |
748 public static const int FOREGROUND = 1 << 4; | |
749 | |
750 /** | |
751 * Event detail field that indicates a user-interface component | |
752 * state is hot (value is 1<<5). | |
753 * | |
754 * @since 3.3 | |
755 */ | |
756 public static const int HOT = 1 << 5; | |
757 | |
758 /* This code is intentionally commented */ | |
759 //public static const int PRESSED = 1 << 3; | |
760 //public static const int ACTIVE = 1 << 4; | |
761 //public static const int DISABLED = 1 << 5; | |
762 //public static const int HOT = 1 << 6; | |
763 //public static const int DEFAULTED = 1 << 7; | |
764 | |
765 /** | |
766 * Traversal event detail field value indicating that no | |
767 * traversal action should be taken | |
768 * (value is 0). | |
769 */ | |
770 public static const int TRAVERSE_NONE = 0; | |
771 | |
772 /** | |
773 * Traversal event detail field value indicating that the | |
774 * key which designates that a dialog should be cancelled was | |
775 * pressed; typically, this is the ESC key | |
776 * (value is 1<<1). | |
777 */ | |
778 public static const int TRAVERSE_ESCAPE = 1 << 1; | |
779 | |
780 /** | |
781 * Traversal event detail field value indicating that the | |
782 * key which activates the default button in a dialog was | |
783 * pressed; typically, this is the ENTER key | |
784 * (value is 1<<2). | |
785 */ | |
786 public static const int TRAVERSE_RETURN = 1 << 2; | |
787 | |
788 /** | |
789 * Traversal event detail field value indicating that the | |
790 * key which designates that focus should be given to the | |
791 * previous tab group was pressed; typically, this is the | |
792 * SHIFT-TAB key sequence | |
793 * (value is 1<<3). | |
794 */ | |
795 public static const int TRAVERSE_TAB_PREVIOUS = 1 << 3; | |
796 | |
797 /** | |
798 * Traversal event detail field value indicating that the | |
799 * key which designates that focus should be given to the | |
800 * next tab group was pressed; typically, this is the | |
801 * TAB key | |
802 * (value is 1<<4). | |
803 */ | |
804 public static const int TRAVERSE_TAB_NEXT = 1 << 4; | |
805 | |
806 /** | |
807 * Traversal event detail field value indicating that the | |
808 * key which designates that focus should be given to the | |
809 * previous tab item was pressed; typically, this is either | |
810 * the LEFT-ARROW or UP-ARROW keys | |
811 * (value is 1<<5). | |
812 */ | |
813 public static const int TRAVERSE_ARROW_PREVIOUS = 1 << 5; | |
814 | |
815 /** | |
816 * Traversal event detail field value indicating that the | |
817 * key which designates that focus should be given to the | |
818 * previous tab item was pressed; typically, this is either | |
819 * the RIGHT-ARROW or DOWN-ARROW keys | |
820 * (value is 1<<6). | |
821 */ | |
822 public static const int TRAVERSE_ARROW_NEXT = 1 << 6; | |
823 | |
824 /** | |
825 * Traversal event detail field value indicating that a | |
826 * mnemonic key sequence was pressed | |
827 * (value is 1<<7). | |
828 */ | |
829 public static const int TRAVERSE_MNEMONIC = 1 << 7; | |
830 | |
831 /** | |
832 * Traversal event detail field value indicating that the | |
833 * key which designates that the previous page of a multi-page | |
834 * window should be shown was pressed; typically, this | |
835 * is the CTRL-PAGEUP key sequence | |
836 * (value is 1<<8). | |
837 */ | |
838 public static const int TRAVERSE_PAGE_PREVIOUS = 1 << 8; | |
839 | |
840 /** | |
841 * Traversal event detail field value indicating that the | |
842 * key which designates that the next page of a multi-page | |
843 * window should be shown was pressed; typically, this | |
844 * is the CTRL-PAGEDOWN key sequence | |
845 * (value is 1<<9). | |
846 */ | |
847 public static const int TRAVERSE_PAGE_NEXT = 1 << 9; | |
848 | |
849 /** | |
850 * A constant known to be zero (0), typically used in operations | |
851 * which take bit flags to indicate that "no bits are set". | |
852 */ | |
853 public static const int NONE = 0; | |
854 | |
855 /** | |
856 * A constant known to be zero (0), used in operations which | |
857 * take pointers to indicate a null argument. | |
858 */ | |
859 public static const int NULL = 0; | |
860 | |
861 /** | |
862 * Indicates that a default should be used (value is -1). | |
863 */ | |
864 public static const int DEFAULT = -1; | |
865 | |
866 /** | |
867 * Indicates that a property is off (value is 0). | |
868 * | |
869 * @since 3.1 | |
870 */ | |
871 public static const int OFF = 0; | |
872 | |
873 /** | |
874 * Indicates that a property is on (value is 1). | |
875 * | |
876 * @since 3.1 | |
877 */ | |
878 public static const int ON = 1; | |
879 | |
880 /** | |
881 * Indicates low quality (value is 1). | |
882 * | |
883 * @since 3.1 | |
884 */ | |
885 public static const int LOW = 1; | |
886 | |
887 /** | |
888 * Indicates high quality (value is 2). | |
889 * | |
890 * @since 3.1 | |
891 */ | |
892 public static const int HIGH = 2; | |
893 | |
894 /** | |
895 * Style constant for menu bar behavior (value is 1<<1). | |
896 * <p><b>Used By:</b><ul> | |
897 * <li><code>Menu</code></li> | |
898 * </ul></p> | |
899 */ | |
900 public static const int BAR = 1 << 1; | |
901 | |
902 /** | |
903 * Style constant for drop down menu/list behavior (value is 1<<2). | |
904 * <p><b>Used By:</b><ul> | |
905 * <li><code>Menu</code></li> | |
906 * <li><code>ToolItem</code></li> | |
907 * <li><code>CoolItem</code></li> | |
908 * <li><code>Combo</code></li> | |
909 * </ul></p> | |
910 */ | |
911 public static const int DROP_DOWN = 1 << 2; | |
912 | |
913 /** | |
914 * Style constant for pop up menu behavior (value is 1<<3). | |
915 * <p><b>Used By:</b><ul> | |
916 * <li><code>Menu</code></li> | |
917 * </ul></p> | |
918 */ | |
919 public static const int POP_UP = 1 << 3; | |
920 | |
921 /** | |
922 * Style constant for line separator behavior (value is 1<<1). | |
923 * <p><b>Used By:</b><ul> | |
924 * <li><code>Label</code></li> | |
925 * <li><code>MenuItem</code></li> | |
926 * <li><code>ToolItem</code></li> | |
927 * </ul></p> | |
928 */ | |
929 public static const int SEPARATOR = 1 << 1; | |
930 | |
931 /** | |
932 * Style constant for toggle button behavior (value is 1<<1). | |
933 * <p><b>Used By:</b><ul> | |
934 * <li><code>Button</code></li> | |
935 * </ul></p> | |
936 */ | |
937 public static const int TOGGLE = 1 << 1; | |
938 | |
939 /** | |
940 * Style constant for arrow button behavior (value is 1<<2). | |
941 * <p><b>Used By:</b><ul> | |
942 * <li><code>Button</code></li> | |
943 * </ul></p> | |
944 */ | |
945 public static const int ARROW = 1 << 2; | |
946 | |
947 /** | |
948 * Style constant for push button behavior (value is 1<<3). | |
949 * <p><b>Used By:</b><ul> | |
950 * <li><code>Button</code></li> | |
951 * <li><code>MenuItem</code></li> | |
952 * <li><code>ToolItem</code></li> | |
953 * </ul></p> | |
954 */ | |
955 public static const int PUSH = 1 << 3; | |
956 | |
957 /** | |
958 * Style constant for radio button behavior (value is 1<<4). | |
959 * <p><b>Used By:</b><ul> | |
960 * <li><code>Button</code></li> | |
961 * <li><code>MenuItem</code></li> | |
962 * <li><code>ToolItem</code></li> | |
963 * </ul></p> | |
964 */ | |
965 public static const int RADIO = 1 << 4; | |
966 | |
967 /** | |
968 * Style constant for check box behavior (value is 1<<5). | |
969 * <p><b>Used By:</b><ul> | |
970 * <li><code>Button</code></li> | |
971 * <li><code>MenuItem</code></li> | |
972 * <li><code>ToolItem</code></li> | |
973 * <li><code>Table</code></li> | |
974 * <li><code>Tree</code></li> | |
975 * </ul></p> | |
976 */ | |
977 public static const int CHECK = 1 << 5; | |
978 | |
979 /** | |
980 * Style constant for cascade behavior (value is 1<<6). | |
981 * <p><b>Used By:</b><ul> | |
982 * <li><code>MenuItem</code></li> | |
983 * </ul></p> | |
984 */ | |
985 public static const int CASCADE = 1 << 6; | |
986 | |
987 /** | |
988 * Style constant for multi-selection behavior in lists | |
989 * and multiple line support on text fields (value is 1<<1). | |
990 * <p><b>Used By:</b><ul> | |
991 * <li><code>Text</code></li> | |
992 * <li><code>List</code></li> | |
993 * <li><code>FileDialog</code></li> | |
994 * </ul></p> | |
995 */ | |
996 public static const int MULTI = 1 << 1; | |
997 | |
998 /** | |
999 * Style constant for single selection behavior in lists | |
1000 * and single line support on text fields (value is 1<<2). | |
1001 * <p><b>Used By:</b><ul> | |
1002 * <li><code>Text</code></li> | |
1003 * <li><code>List</code></li> | |
1004 * <li><code>Table</code></li> | |
1005 * <li><code>Tree</code></li> | |
1006 * </ul></p> | |
1007 */ | |
1008 public static const int SINGLE = 1 << 2; | |
1009 | |
1010 /** | |
1011 * Style constant for read-only behavior (value is 1<<3). | |
1012 * <p><b>Used By:</b><ul> | |
1013 * <li><code>Combo</code></li> | |
1014 * <li><code>Text</code></li> | |
1015 * </ul></p> | |
1016 */ | |
1017 public static const int READ_ONLY = 1 << 3; | |
1018 | |
1019 /** | |
1020 * Style constant for automatic line wrap behavior (value is 1<<6). | |
1021 * <p><b>Used By:</b><ul> | |
1022 * <li><code>Label</code></li> | |
1023 * <li><code>Text</code></li> | |
1024 * <li><code>ToolBar</code></li> | |
1025 * <li><code>Spinner</code></li> | |
1026 * </ul></p> | |
1027 */ | |
1028 public static const int WRAP = 1 << 6; | |
1029 | |
1030 /** | |
1031 * Style constant for search behavior (value is 1<<7). | |
1032 * <p><b>Used By:</b><ul> | |
1033 * <li><code>Text</code></li> | |
1034 * </ul></p> | |
1035 * | |
1036 * @since 3.3 | |
1037 */ | |
1038 public static const int SEARCH = 1 << 7; | |
1039 | |
1040 /** | |
1041 * Style constant for simple (not drop down) behavior (value is 1<<6). | |
1042 * <p><b>Used By:</b><ul> | |
1043 * <li><code>Combo</code></li> | |
1044 * </ul></p> | |
1045 */ | |
1046 public static const int SIMPLE = 1 << 6; | |
1047 | |
1048 /** | |
1049 * Style constant for password behavior (value is 1<<22). | |
1050 * <p><b>Used By:</b><ul> | |
1051 * <li><code>Text</code></li> | |
1052 * </ul></p> | |
1053 * | |
1054 * @since 3.0 | |
1055 */ | |
1056 public static const int PASSWORD = 1 << 22; | |
1057 | |
1058 /** | |
1059 * Style constant for shadow in behavior (value is 1<<2). | |
1060 * <br>Note that this is a <em>HINT</em>. | |
1061 * <p><b>Used By:</b><ul> | |
1062 * <li><code>Label</code></li> | |
1063 * <li><code>Group</code></li> | |
1064 * </ul></p> | |
1065 */ | |
1066 public static const int SHADOW_IN = 1 << 2; | |
1067 | |
1068 /** | |
1069 * Style constant for shadow out behavior (value is 1<<3). | |
1070 * <br>Note that this is a <em>HINT</em>. | |
1071 * <p><b>Used By:</b><ul> | |
1072 * <li><code>Label</code></li> | |
1073 * <li><code>Group</code></li> | |
1074 * <li><code>ToolBar</code></li> | |
1075 * </ul></p> | |
1076 */ | |
1077 public static const int SHADOW_OUT = 1 << 3; | |
1078 | |
1079 /** | |
1080 * Style constant for shadow etched in behavior (value is 1<<4). | |
1081 * <br>Note that this is a <em>HINT</em>. It is ignored on all platforms except Motif. | |
1082 * <p><b>Used By:</b><ul> | |
1083 * <li><code>Group</code></li> | |
1084 * </ul></p> | |
1085 */ | |
1086 public static const int SHADOW_ETCHED_IN = 1 << 4; | |
1087 | |
1088 /** | |
1089 * Style constant for shadow etched out behavior (value is 1<<6). | |
1090 * <br>Note that this is a <em>HINT</em>. It is ignored on all platforms except Motif. | |
1091 * <p><b>Used By:</b><ul> | |
1092 * <li><code>Group</code></li> | |
1093 * </ul></p> | |
1094 */ | |
1095 public static const int SHADOW_ETCHED_OUT = 1 << 6; | |
1096 | |
1097 /** | |
1098 * Style constant for no shadow behavior (value is 1<<5). | |
1099 * <br>Note that this is a <em>HINT</em>. | |
1100 * <p><b>Used By:</b><ul> | |
1101 * <li><code>Label</code></li> | |
1102 * <li><code>Group</code></li> | |
1103 * </ul></p> | |
1104 */ | |
1105 public static const int SHADOW_NONE = 1 << 5; | |
1106 | |
1107 /** | |
1108 * Style constant for progress bar behavior (value is 1<<1). | |
1109 * <p><b>Used By:</b><ul> | |
1110 * <li><code>ProgressBar</code></li> | |
1111 * </ul></p> | |
1112 */ | |
1113 public static const int INDETERMINATE = 1 << 1; | |
1114 | |
1115 /** | |
1116 * Style constant for tool window behavior (value is 1<<2). | |
1117 * <p> | |
1118 * A tool window is a window intended to be used as a floating toolbar. | |
1119 * It typically has a title bar that is shorter than a normal title bar, | |
1120 * and the window title is typically drawn using a smaller font. | |
1121 * <br>Note that this is a <em>HINT</em>. | |
1122 * </p><p><b>Used By:</b><ul> | |
1123 * <li><code>Decorations</code> and subclasses</li> | |
1124 * </ul></p> | |
1125 */ | |
1126 public static const int TOOL = 1 << 2; | |
1127 | |
1128 /** | |
1129 * Style constant to ensure no trimmings are used (value is 1<<3). | |
1130 * <br>Note that this overrides all other trim styles. | |
1131 * <p><b>Used By:</b><ul> | |
1132 * <li><code>Decorations</code> and subclasses</li> | |
1133 * </ul></p> | |
1134 */ | |
1135 public static const int NO_TRIM = 1 << 3; | |
1136 | |
1137 /** | |
1138 * Style constant for resize box trim (value is 1<<4). | |
1139 * <p><b>Used By:</b><ul> | |
1140 * <li><code>Decorations</code> and subclasses</li> | |
1141 * <li><code>Tracker</code></li> | |
1142 * </ul></p> | |
1143 */ | |
1144 public static const int RESIZE = 1 << 4; | |
1145 | |
1146 /** | |
1147 * Style constant for title area trim (value is 1<<5). | |
1148 * <p><b>Used By:</b><ul> | |
1149 * <li><code>Decorations</code> and subclasses</li> | |
1150 * </ul></p> | |
1151 */ | |
1152 public static const int TITLE = 1 << 5; | |
1153 | |
1154 /** | |
1155 * Style constant for close box trim (value is 1<<6, | |
1156 * since we do not distinguish between CLOSE style and MENU style). | |
1157 * <p><b>Used By:</b><ul> | |
1158 * <li><code>Decorations</code> and subclasses</li> | |
1159 * </ul></p> | |
1160 */ | |
1161 public static const int CLOSE = 1 << 6; | |
1162 | |
1163 /** | |
1164 * Style constant for shell menu trim (value is 1<<6, | |
1165 * since we do not distinguish between CLOSE style and MENU style). | |
1166 * <p><b>Used By:</b><ul> | |
1167 * <li><code>Decorations</code> and subclasses</li> | |
1168 * </ul></p> | |
1169 */ | |
1170 public static const int MENU = CLOSE; | |
1171 | |
1172 /** | |
1173 * Style constant for minimize box trim (value is 1<<7). | |
1174 * <p><b>Used By:</b><ul> | |
1175 * <li><code>Decorations</code> and subclasses</li> | |
1176 * </ul></p> | |
1177 */ | |
1178 public static const int MIN = 1 << 7; | |
1179 | |
1180 /** | |
1181 * Style constant for maximize box trim (value is 1<<10). | |
1182 * <p><b>Used By:</b><ul> | |
1183 * <li><code>Decorations</code> and subclasses</li> | |
1184 * </ul></p> | |
1185 */ | |
1186 public static const int MAX = 1 << 10; | |
1187 | |
1188 /** | |
1189 * Style constant for horizontal scrollbar behavior (value is 1<<8). | |
1190 * <p><b>Used By:</b><ul> | |
1191 * <li><code>Scrollable</code> and subclasses</li> | |
1192 * </ul></p> | |
1193 */ | |
1194 public static const int H_SCROLL = 1 << 8; | |
1195 | |
1196 /** | |
1197 * Style constant for vertical scrollbar behavior (value is 1<<9). | |
1198 * <p><b>Used By:</b><ul> | |
1199 * <li><code>Scrollable</code> and subclasses</li> | |
1200 * </ul></p> | |
1201 */ | |
1202 public static const int V_SCROLL = 1 << 9; | |
1203 | |
1204 /** | |
213 | 1205 * Style constant for no scrollbar behavior (value is 1<<4). |
1206 * <p> | |
1207 * When neither H_SCROLL or V_SCROLL are specified, controls | |
1208 * are free to create the default scroll bars for the control. | |
1209 * Using NO_SCROLL overrides the default and forces the control | |
1210 * to have no scroll bars. | |
1211 * | |
1212 * <b>Used By:</b><ul> | |
1213 * <li><code>Tree</code></li> | |
1214 * <li><code>Table</code></li> | |
1215 * </ul></p> | |
1216 * | |
1217 * @since 3.4 | |
1218 */ | |
1219 public static const int NO_SCROLL = 1 << 4; | |
1220 | |
1221 /** | |
0 | 1222 * Style constant for bordered behavior (value is 1<<11). |
1223 * <br>Note that this is a <em>HINT</em>. | |
1224 * <p><b>Used By:</b><ul> | |
1225 * <li><code>Control</code> and subclasses</li> | |
1226 * </ul></p> | |
1227 */ | |
1228 public static const int BORDER = 1 << 11; | |
1229 | |
1230 /** | |
1231 * Style constant indicating that the window manager should clip | |
1232 * a widget's children with respect to its viewable area. (value is 1<<12). | |
1233 * <br>Note that this is a <em>HINT</em>. | |
1234 * <p><b>Used By:</b><ul> | |
1235 * <li><code>Control</code> and subclasses</li> | |
1236 * </ul></p> | |
1237 */ | |
1238 public static const int CLIP_CHILDREN = 1 << 12; | |
1239 | |
1240 /** | |
1241 * Style constant indicating that the window manager should clip | |
1242 * a widget's siblings with respect to its viewable area. (value is 1<<13). | |
1243 * <br>Note that this is a <em>HINT</em>. | |
1244 * <p><b>Used By:</b><ul> | |
1245 * <li><code>Control</code> and subclasses</li> | |
1246 * </ul></p> | |
1247 */ | |
1248 public static const int CLIP_SIBLINGS = 1 << 13; | |
1249 | |
1250 /** | |
1251 * Style constant for always on top behavior (value is 1<<14). | |
1252 * <br>Note that this is a <em>HINT</em>. | |
1253 * <p><b>Used By:</b><ul> | |
1254 * <li><code>Shell</code> and subclasses</li> | |
1255 * </ul></p> | |
1256 */ | |
1257 public static const int ON_TOP = 1 << 14; | |
1258 | |
1259 /** | |
1260 * Trim style convenience constant for the most common top level shell appearance | |
1261 * (value is CLOSE|TITLE|MIN|MAX|RESIZE). | |
1262 * <p><b>Used By:</b><ul> | |
1263 * <li><code>Shell</code></li> | |
1264 * </ul></p> | |
1265 */ | |
1266 public static const int SHELL_TRIM = CLOSE | TITLE | MIN | MAX | RESIZE; | |
1267 | |
1268 /** | |
1269 * Trim style convenience constant for the most common dialog shell appearance | |
1270 * (value is CLOSE|TITLE|BORDER). | |
1271 * <p><b>Used By:</b><ul> | |
1272 * <li><code>Shell</code></li> | |
1273 * </ul></p> | |
1274 */ | |
1275 public static const int DIALOG_TRIM = TITLE | CLOSE | BORDER; | |
1276 | |
1277 /** | |
1278 * Style constant for modeless behavior (value is 0). | |
1279 * <br>Note that this is a <em>HINT</em>. | |
1280 * <p><b>Used By:</b><ul> | |
1281 * <li><code>Dialog</code></li> | |
1282 * <li><code>Shell</code></li> | |
1283 * </ul></p> | |
1284 */ | |
1285 public static const int MODELESS = 0; | |
1286 | |
1287 /** | |
1288 * Style constant for primary modal behavior (value is 1<<15). | |
1289 * <br>Note that this is a <em>HINT</em>. | |
1290 * <p><b>Used By:</b><ul> | |
1291 * <li><code>Dialog</code></li> | |
1292 * <li><code>Shell</code></li> | |
1293 * </ul></p> | |
1294 */ | |
1295 public static const int PRIMARY_MODAL = 1 << 15; | |
1296 | |
1297 /** | |
1298 * Style constant for application modal behavior (value is 1<<16). | |
1299 * <br>Note that this is a <em>HINT</em>. | |
1300 * <p><b>Used By:</b><ul> | |
1301 * <li><code>Dialog</code></li> | |
1302 * <li><code>Shell</code></li> | |
1303 * </ul></p> | |
1304 */ | |
1305 public static const int APPLICATION_MODAL = 1 << 16; | |
1306 | |
1307 /** | |
1308 * Style constant for system modal behavior (value is 1<<17). | |
1309 * <br>Note that this is a <em>HINT</em>. | |
1310 * <p><b>Used By:</b><ul> | |
1311 * <li><code>Dialog</code></li> | |
1312 * <li><code>Shell</code></li> | |
1313 * </ul></p> | |
1314 */ | |
1315 public static const int SYSTEM_MODAL = 1 << 17; | |
1316 | |
1317 /** | |
1318 * Style constant for selection hiding behavior when the widget loses focus (value is 1<<15). | |
1319 * <br>Note that this is a <em>HINT</em>. | |
1320 * <p><b>Used By:</b><ul> | |
1321 * <li><code>Table</code></li> | |
1322 * </ul></p> | |
1323 */ | |
1324 public static const int HIDE_SELECTION = 1 << 15; | |
1325 | |
1326 /** | |
1327 * Style constant for full row selection behavior and | |
1328 * selection constant indicating that a full line should be | |
1329 * drawn. (value is 1<<16). | |
1330 * <br>Note that for some widgets this is a <em>HINT</em>. | |
1331 * <p><b>Used By:</b><ul> | |
1332 * <li><code>Table</code></li> | |
1333 * <li><code>Tree</code></li> | |
1334 * <li><code>StyledText</code></li> | |
1335 * <li><code>TextLayout</code></li> | |
1336 * </ul></p> | |
1337 */ | |
1338 public static const int FULL_SELECTION = 1 << 16; | |
1339 | |
1340 /** | |
1341 * Style constant for flat appearance. (value is 1<<23). | |
1342 * <br>Note that this is a <em>HINT</em>. | |
1343 * <p><b>Used By:</b><ul> | |
1344 * <li><code>Button</code></li> | |
1345 * <li><code>ToolBar</code></li> | |
1346 * </ul></p> | |
1347 */ | |
1348 public static const int FLAT = 1 << 23; | |
1349 | |
1350 /** | |
1351 * Style constant for smooth appearance. (value is 1<<16). | |
1352 * <br>Note that this is a <em>HINT</em>. | |
1353 * <p><b>Used By:</b><ul> | |
1354 * <li><code>ProgressBar</code></li> | |
1355 * <li><code>Sash</code></li> | |
1356 * </ul></p> | |
1357 */ | |
1358 public static const int SMOOTH = 1 << 16; | |
1359 | |
1360 /** | |
1361 * Style constant for no background behavior (value is 1<<18). | |
1362 * <p> | |
1363 * By default, before a widget paints, the client area is filled with the current background. | |
1364 * When this style is specified, the background is not filled, and the application is responsible | |
1365 * for filling every pixel of the client area. | |
1366 * This style might be used as an alternative to "double-buffering" in order to reduce flicker. | |
1367 * This style does not mean "transparent" - widgets that are obscured will not draw through. | |
1368 * </p><p><b>Used By:</b><ul> | |
1369 * <li><code>Composite</code></li> | |
1370 * </ul></p> | |
1371 */ | |
1372 public static const int NO_BACKGROUND = 1 << 18; | |
1373 | |
1374 /** | |
1375 * Style constant for no focus from the mouse behavior (value is 1<<19). | |
213 | 1376 * <p> |
1377 * Normally, when the user clicks on a control, focus is assigned to that | |
1378 * control, providing the control has no children. Some controls, such as | |
1379 * tool bars and sashes, don't normally take focus when the mouse is clicked | |
1380 * or accept focus when assigned from within the program. This style allows | |
1381 * Composites to implement "no focus" mouse behavior. | |
1382 * | |
0 | 1383 * <br>Note that this is a <em>HINT</em>. |
213 | 1384 * </p> |
0 | 1385 * <p><b>Used By:</b><ul> |
1386 * <li><code>Composite</code></li> | |
1387 * </ul></p> | |
1388 */ | |
1389 public static const int NO_FOCUS = 1 << 19; | |
1390 | |
1391 /** | |
1392 * Style constant for no redraw on resize behavior (value is 1<<20). | |
1393 * <p> | |
1394 * This style stops the entire client area from being invalidated when the size | |
1395 * of the Canvas changes. Specifically, when the size of the Canvas gets smaller, | |
1396 * the DWT.Paint event is not sent. When it gets bigger, an DWT.Paint event is | |
1397 * sent with a GC clipped to only the new areas to be painted. Without this | |
1398 * style, the entire client area will be repainted. | |
213 | 1399 * |
1400 * <br>Note that this is a <em>HINT</em>. | |
0 | 1401 * </p><p><b>Used By:</b><ul> |
1402 * <li><code>Composite</code></li> | |
1403 * </ul></p> | |
1404 */ | |
1405 public static const int NO_REDRAW_RESIZE = 1 << 20; | |
1406 | |
1407 /** | |
1408 * Style constant for no paint event merging behavior (value is 1<<21). | |
213 | 1409 * |
1410 * <br>Note that this is a <em>HINT</em>. | |
0 | 1411 * <p><b>Used By:</b><ul> |
1412 * <li><code>Composite</code></li> | |
1413 * </ul></p> | |
1414 */ | |
1415 public static const int NO_MERGE_PAINTS = 1 << 21; | |
1416 | |
1417 /** | |
1418 * Style constant for preventing child radio group behavior (value is 1<<22). | |
1419 * <p><b>Used By:</b><ul> | |
1420 * <li><code>Composite</code></li> | |
1421 * </ul></p> | |
1422 */ | |
1423 public static const int NO_RADIO_GROUP = 1 << 22; | |
1424 | |
1425 /** | |
1426 * Style constant for left to right orientation (value is 1<<25). | |
1427 * <p> | |
1428 * When orientation is not explicitly specified, orientation is | |
1429 * inherited. This means that children will be assigned the | |
1430 * orientation of their parent. To override this behavior and | |
1431 * force an orientation for a child, explicitly set the orientation | |
1432 * of the child when that child is created. | |
1433 * <br>Note that this is a <em>HINT</em>. | |
1434 * </p> | |
1435 * <p><b>Used By:</b><ul> | |
1436 * <li><code>Control</code></li> | |
1437 * <li><code>Menu</code></li> | |
1438 * <li><code>GC</code></li> | |
1439 * </ul></p> | |
1440 * | |
1441 * @since 2.1.2 | |
1442 */ | |
1443 public static const int LEFT_TO_RIGHT = 1 << 25; | |
1444 | |
1445 /** | |
1446 * Style constant for right to left orientation (value is 1<<26). | |
1447 * <p> | |
1448 * When orientation is not explicitly specified, orientation is | |
1449 * inherited. This means that children will be assigned the | |
1450 * orientation of their parent. To override this behavior and | |
1451 * force an orientation for a child, explicitly set the orientation | |
1452 * of the child when that child is created. | |
1453 * <br>Note that this is a <em>HINT</em>. | |
1454 * </p> | |
1455 * <p><b>Used By:</b><ul> | |
1456 * <li><code>Control</code></li> | |
1457 * <li><code>Menu</code></li> | |
1458 * <li><code>GC</code></li> | |
1459 * </ul></p> | |
1460 * | |
1461 * @since 2.1.2 | |
1462 */ | |
1463 public static const int RIGHT_TO_LEFT = 1 << 26; | |
1464 | |
1465 /** | |
1466 * Style constant to indicate coordinate mirroring (value is 1<<27). | |
1467 * <p><b>Used By:</b><ul> | |
1468 * <li><code>Control</code></li> | |
1469 * <li><code>Menu</code></li> | |
1470 * </ul></p> | |
1471 * | |
1472 * @since 2.1.2 | |
1473 */ | |
1474 public static const int MIRRORED = 1 << 27; | |
1475 | |
1476 /** | |
1477 * Style constant to allow embedding (value is 1<<24). | |
1478 * <p><b>Used By:</b><ul> | |
1479 * <li><code>Composite</code></li> | |
1480 * </ul></p> | |
1481 * | |
1482 * @since 3.0 | |
1483 */ | |
1484 public static const int EMBEDDED = 1 << 24; | |
1485 | |
1486 /** | |
1487 * Style constant to allow virtual data (value is 1<<28). | |
1488 * <p><b>Used By:</b><ul> | |
1489 * <li><code>Table</code></li> | |
1490 * <li><code>Tree</code></li> | |
1491 * </ul></p> | |
1492 * | |
1493 * @since 3.0 | |
1494 */ | |
1495 public static const int VIRTUAL = 1 << 28; | |
1496 | |
1497 /** | |
1498 * Style constant to indicate double buffering (value is 1<<29). | |
1499 * <p><b>Used By:</b><ul> | |
1500 * <li><code>Control</code></li> | |
1501 * </ul></p> | |
1502 * | |
1503 * @since 3.1 | |
1504 */ | |
1505 public static const int DOUBLE_BUFFERED = 1 << 29; | |
1506 | |
1507 /** | |
213 | 1508 * Style constant for transparent behavior (value is 1<<30). |
1509 * <p> | |
1510 * By default, before a widget paints, the client area is filled with the current background. | |
1511 * When this style is specified, the background is not filled and widgets that are obscured | |
1512 * will draw through. | |
1513 * </p><p><b>Used By:</b><ul> | |
1514 * <li><code>Composite</code></li> | |
1515 * </ul></p> | |
1516 * | |
1517 * @since 3.4 | |
1518 * | |
1519 * WARNING: THIS API IS UNDER CONSTRUCTION AND SHOULD NOT BE USED | |
1520 */ | |
1521 public static const int TRANSPARENT = 1 << 30; | |
1522 | |
1523 /** | |
0 | 1524 * Style constant for align up behavior (value is 1<<7, |
1525 * since align UP and align TOP are considered the same). | |
1526 * <p><b>Used By:</b><ul> | |
1527 * <li><code>Button</code> with <code>ARROW</code> style</li> | |
1528 * <li><code>Tracker</code></li> | |
213 | 1529 * <li><code>Table</code></li> |
1530 * <li><code>Tree</code></li> | |
0 | 1531 * </ul></p> |
1532 */ | |
1533 public static const int UP = 1 << 7; | |
1534 | |
1535 /** | |
213 | 1536 * Style constant to indicate single underline (value is 0). |
1537 * <p><b>Used By:</b><ul> | |
1538 * <li><code>TextStyle</code></li> | |
1539 * </ul></p> | |
1540 * | |
1541 * @since 3.4 | |
1542 */ | |
1543 public static const int UNDERLINE_SINGLE = 0; | |
1544 | |
1545 /** | |
1546 * Style constant to indicate double underline (value is 1). | |
1547 * <p><b>Used By:</b><ul> | |
1548 * <li><code>TextStyle</code></li> | |
1549 * </ul></p> | |
1550 * | |
1551 * @since 3.4 | |
1552 */ | |
1553 public static const int UNDERLINE_DOUBLE = 1; | |
1554 | |
1555 /** | |
1556 * Style constant to indicate error underline (value is 2). | |
1557 * <p><b>Used By:</b><ul> | |
1558 * <li><code>TextStyle</code></li> | |
1559 * </ul></p> | |
1560 * | |
1561 * @since 3.4 | |
1562 */ | |
1563 public static const int UNDERLINE_ERROR = 2; | |
1564 | |
1565 /** | |
1566 * Style constant to indicate squiggle underline (value is 3). | |
1567 * <p><b>Used By:</b><ul> | |
1568 * <li><code>TextStyle</code></li> | |
1569 * </ul></p> | |
1570 * | |
1571 * @since 3.4 | |
1572 */ | |
1573 public static const int UNDERLINE_SQUIGGLE = 3; | |
1574 | |
1575 /** | |
1576 * Style constant to indicate solid border (value is 1). | |
1577 * <p><b>Used By:</b><ul> | |
1578 * <li><code>TextStyle</code></li> | |
1579 * </ul></p> | |
1580 * | |
1581 * @since 3.4 | |
1582 */ | |
1583 public static const int BORDER_SOLID = 1; | |
1584 | |
1585 /** | |
1586 * Style constant to indicate dashed border (value is 2). | |
1587 * <p><b>Used By:</b><ul> | |
1588 * <li><code>TextStyle</code></li> | |
1589 * </ul></p> | |
1590 * | |
1591 * @since 3.4 | |
1592 */ | |
1593 public static const int BORDER_DASH = 2; | |
1594 | |
1595 /** | |
1596 * Style constant to indicate dotted border (value is 4). | |
1597 * <p><b>Used By:</b><ul> | |
1598 * <li><code>TextStyle</code></li> | |
1599 * </ul></p> | |
1600 * | |
1601 * @since 3.4 | |
1602 */ | |
1603 public static const int BORDER_DOT = 4; | |
1604 | |
1605 /** | |
0 | 1606 * Style constant for align top behavior (value is 1<<7, |
1607 * since align UP and align TOP are considered the same). | |
1608 * <p><b>Used By:</b><ul> | |
1609 * <li><code>FormAttachment</code> in a <code>FormLayout</code></li> | |
1610 * </ul></p> | |
1611 */ | |
1612 public static const int TOP = UP; | |
1613 | |
1614 /** | |
1615 * Style constant for align down behavior (value is 1<<10, | |
1616 * since align DOWN and align BOTTOM are considered the same). | |
1617 * <p><b>Used By:</b><ul> | |
1618 * <li><code>Button</code> with <code>ARROW</code> style</li> | |
1619 * <li><code>Tracker</code></li> | |
213 | 1620 * <li><code>Table</code></li> |
1621 * <li><code>Tree</code></li> | |
0 | 1622 * </ul></p> |
1623 */ | |
1624 public static const int DOWN = 1 << 10; | |
1625 | |
1626 /** | |
1627 * Style constant for align bottom behavior (value is 1<<10, | |
1628 * since align DOWN and align BOTTOM are considered the same). | |
1629 * <p><b>Used By:</b><ul> | |
1630 * <li><code>FormAttachment</code> in a <code>FormLayout</code></li> | |
1631 * </ul></p> | |
1632 */ | |
1633 public static const int BOTTOM = DOWN; | |
1634 | |
1635 /** | |
1636 * Style constant for leading alignment (value is 1<<14). | |
1637 * <p><b>Used By:</b><ul> | |
1638 * <li><code>Button</code></li> | |
1639 * <li><code>Label</code></li> | |
1640 * <li><code>TableColumn</code></li> | |
1641 * <li><code>Tracker</code></li> | |
1642 * <li><code>FormAttachment</code> in a <code>FormLayout</code></li> | |
1643 * </ul></p> | |
1644 * | |
1645 * @since 2.1.2 | |
1646 */ | |
1647 public static const int LEAD = 1 << 14; | |
1648 | |
1649 /** | |
1650 * Style constant for align left behavior (value is 1<<14). | |
1651 * This is a synonym for LEAD (value is 1<<14). Newer | |
1652 * applications should use LEAD instead of LEFT to make code more | |
1653 * understandable on right-to-left platforms. | |
1654 */ | |
1655 public static const int LEFT = LEAD; | |
1656 | |
1657 /** | |
1658 * Style constant for trailing alignment (value is 1<<17). | |
1659 * <p><b>Used By:</b><ul> | |
1660 * <li><code>Button</code></li> | |
1661 * <li><code>Label</code></li> | |
1662 * <li><code>TableColumn</code></li> | |
1663 * <li><code>Tracker</code></li> | |
1664 * <li><code>FormAttachment</code> in a <code>FormLayout</code></li> | |
1665 * </ul></p> | |
1666 * | |
1667 * @since 2.1.2 | |
1668 */ | |
1669 public static const int TRAIL = 1 << 17; | |
1670 | |
1671 /** | |
1672 * Style constant for align right behavior (value is 1<<17). | |
1673 * This is a synonym for TRAIL (value is 1<<17). Newer | |
1674 * applications should use TRAIL instead of RIGHT to make code more | |
1675 * understandable on right-to-left platforms. | |
1676 */ | |
1677 public static const int RIGHT = TRAIL; | |
1678 | |
1679 /** | |
1680 * Style constant for align center behavior (value is 1<<24). | |
1681 * <p><b>Used By:</b><ul> | |
1682 * <li><code>Button</code></li> | |
1683 * <li><code>Label</code></li> | |
1684 * <li><code>TableColumn</code></li> | |
1685 * <li><code>FormAttachment</code> in a <code>FormLayout</code></li> | |
1686 * </ul></p> | |
1687 */ | |
1688 public static const int CENTER = 1 << 24; | |
1689 | |
1690 /** | |
1691 * Style constant for horizontal alignment or orientation behavior (value is 1<<8). | |
1692 * <p><b>Used By:</b><ul> | |
1693 * <li><code>Label</code></li> | |
1694 * <li><code>ProgressBar</code></li> | |
1695 * <li><code>Sash</code></li> | |
1696 * <li><code>Scale</code></li> | |
1697 * <li><code>ScrollBar</code></li> | |
1698 * <li><code>Slider</code></li> | |
1699 * <li><code>ToolBar</code></li> | |
1700 * <li><code>FillLayout</code> type</li> | |
1701 * <li><code>RowLayout</code> type</li> | |
1702 * </ul></p> | |
1703 */ | |
1704 public static const int HORIZONTAL = 1 << 8; | |
1705 | |
1706 /** | |
1707 * Style constant for vertical alignment or orientation behavior (value is 1<<9). | |
1708 * <p><b>Used By:</b><ul> | |
1709 * <li><code>Label</code></li> | |
1710 * <li><code>ProgressBar</code></li> | |
1711 * <li><code>Sash</code></li> | |
1712 * <li><code>Scale</code></li> | |
1713 * <li><code>ScrollBar</code></li> | |
1714 * <li><code>Slider</code></li> | |
1715 * <li><code>ToolBar</code></li> | |
1716 * <li><code>CoolBar</code></li> | |
1717 * <li><code>FillLayout</code> type</li> | |
1718 * <li><code>RowLayout</code> type</li> | |
1719 * </ul></p> | |
1720 */ | |
1721 public static const int VERTICAL = 1 << 9; | |
1722 | |
1723 /** | |
1724 * Style constant for date display (value is 1<<5). | |
1725 * <p><b>Used By:</b><ul> | |
1726 * <li><code>DateTime</code></li> | |
1727 * </ul></p> | |
1728 * | |
1729 * @since 3.3 | |
1730 */ | |
1731 public static const int DATE = 1 << 5; | |
1732 | |
1733 /** | |
1734 * Style constant for time display (value is 1<<7). | |
1735 * <p><b>Used By:</b><ul> | |
1736 * <li><code>DateTime</code></li> | |
1737 * </ul></p> | |
1738 * | |
1739 * @since 3.3 | |
1740 */ | |
1741 public static const int TIME = 1 << 7; | |
1742 | |
1743 /** | |
1744 * Style constant for calendar display (value is 1<<10). | |
1745 * <p><b>Used By:</b><ul> | |
1746 * <li><code>DateTime</code></li> | |
1747 * </ul></p> | |
1748 * | |
1749 * @since 3.3 | |
1750 */ | |
1751 public static const int CALENDAR = 1 << 10; | |
1752 | |
1753 /** | |
1754 * Style constant for short date/time format (value is 1<<15). | |
1755 * <p> | |
1756 * A short date displays the month and year. | |
1757 * A short time displays hours and minutes. | |
1758 * <br>Note that this is a <em>HINT</em>. | |
1759 * </p> | |
1760 * <p><b>Used By:</b><ul> | |
1761 * <li><code>DateTime</code></li> | |
1762 * </ul></p> | |
1763 * | |
1764 * @since 3.3 | |
1765 */ | |
1766 public static const int SHORT = 1 << 15; | |
1767 | |
1768 /** | |
1769 * Style constant for medium date/time format (value is 1<<16). | |
1770 * <p> | |
1771 * A medium date displays the day, month and year. | |
1772 * A medium time displays hours, minutes, and seconds. | |
1773 * <br>Note that this is a <em>HINT</em>. | |
1774 * </p> | |
1775 * <p><b>Used By:</b><ul> | |
1776 * <li><code>DateTime</code></li> | |
1777 * </ul></p> | |
1778 * | |
1779 * @since 3.3 | |
1780 */ | |
1781 public static const int MEDIUM = 1 << 16; | |
1782 | |
1783 /** | |
1784 * Style constant for long date/time format (value is 1<<28). | |
1785 * <p> | |
1786 * A long date displays the day, month and year. | |
1787 * A long time displays hours, minutes, and seconds. | |
1788 * The day and month names may be displayed. | |
1789 * <br>Note that this is a <em>HINT</em>. | |
1790 * </p> | |
1791 * <p><b>Used By:</b><ul> | |
1792 * <li><code>DateTime</code></li> | |
1793 * </ul></p> | |
1794 * | |
1795 * @since 3.3 | |
1796 */ | |
1797 public static const int LONG = 1 << 28; | |
1798 | |
1799 /** | |
1800 * Style constant specifying that a Browser should use a Mozilla GRE | |
1801 * for rendering its content (value is 1<<15). | |
1802 * <p> | |
1803 * <p><b>Used By:</b><ul> | |
1804 * <li><code>Browser</code></li> | |
1805 * </ul></p> | |
1806 * | |
1807 * @since 3.3 | |
1808 */ | |
1809 public static const int MOZILLA = 1 << 15; | |
1810 | |
1811 /** | |
1812 * Style constant for balloon behavior (value is 1<<12). | |
1813 * <p><b>Used By:</b><ul> | |
1814 * <li><code>ToolTip</code></li> | |
1815 * </ul></p> | |
1816 * | |
1817 * @since 3.2 | |
1818 */ | |
1819 public static const int BALLOON = 1 << 12; | |
1820 | |
1821 /** | |
1822 * Style constant for vertical alignment or orientation behavior (value is 1). | |
1823 * <p><b>Used By:</b><ul> | |
1824 * <li><code>GridLayout</code> type</li> | |
1825 * </ul></p> | |
1826 */ | |
1827 public static const int BEGINNING = 1; | |
1828 | |
1829 /** | |
1830 * Style constant for vertical alignment or orientation behavior (value is 4). | |
1831 * <p><b>Used By:</b><ul> | |
1832 * <li><code>GridLayout</code> type</li> | |
1833 * </ul></p> | |
1834 */ | |
1835 public static const int FILL = 4; | |
1836 | |
1837 /** | |
1838 * Input Method Editor style constant for double byte | |
1839 * input behavior (value is 1<<1). | |
1840 */ | |
1841 public static const int DBCS = 1 << 1; | |
1842 | |
1843 /** | |
1844 * Input Method Editor style constant for alpha | |
1845 * input behavior (value is 1<<2). | |
1846 */ | |
1847 public static const int ALPHA = 1 << 2; | |
1848 | |
1849 /** | |
1850 * Input Method Editor style constant for native | |
1851 * input behavior (value is 1<<3). | |
1852 */ | |
1853 public static const int NATIVE = 1 << 3; | |
1854 | |
1855 /** | |
1856 * Input Method Editor style constant for phonetic | |
1857 * input behavior (value is 1<<4). | |
1858 */ | |
1859 public static const int PHONETIC = 1 << 4; | |
1860 | |
1861 /** | |
1862 * Input Method Editor style constant for romanicized | |
1863 * input behavior (value is 1<<5). | |
1864 */ | |
1865 public static const int ROMAN = 1 << 5; | |
1866 | |
1867 /** | |
1868 * ASCII character convenience constant for the backspace character | |
1869 * (value is the <code>char</code> '\b'). | |
1870 */ | |
1871 public static const char BS = '\b'; | |
1872 | |
1873 /** | |
1874 * ASCII character convenience constant for the carriage return character | |
1875 * (value is the <code>char</code> '\r'). | |
1876 */ | |
1877 public static const char CR = '\r'; | |
1878 | |
1879 /** | |
1880 * ASCII character convenience constant for the delete character | |
1881 * (value is the <code>char</code> with value 127). | |
1882 */ | |
1883 public static const char DEL = 0x7F; | |
1884 | |
1885 /** | |
1886 * ASCII character convenience constant for the escape character | |
1887 * (value is the <code>char</code> with value 27). | |
1888 */ | |
1889 public static const char ESC = 0x1B; | |
1890 | |
1891 /** | |
1892 * ASCII character convenience constant for the line feed character | |
1893 * (value is the <code>char</code> '\n'). | |
1894 */ | |
1895 public static const char LF = '\n'; | |
1896 | |
1897 /** | |
1898 * ASCII character convenience constant for the tab character | |
1899 * (value is the <code>char</code> '\t'). | |
1900 * | |
1901 * @since 2.1 | |
1902 */ | |
1903 public static const char TAB = '\t'; | |
1904 | |
1905 /** | |
1906 * keyboard and/or mouse event mask indicating that the ALT key | |
1907 * was pushed on the keyboard when the event was generated | |
1908 * (value is 1<<16). | |
1909 */ | |
1910 public static const int ALT = 1 << 16; | |
1911 | |
1912 /** | |
1913 * Keyboard and/or mouse event mask indicating that the SHIFT key | |
1914 * was pushed on the keyboard when the event was generated | |
1915 * (value is 1<<17). | |
1916 */ | |
1917 public static const int SHIFT = 1 << 17; | |
1918 | |
1919 /** | |
1920 * Keyboard and/or mouse event mask indicating that the CTRL key | |
1921 * was pushed on the keyboard when the event was generated | |
1922 * (value is 1<<18). | |
1923 */ | |
1924 public static const int CTRL = 1 << 18; | |
1925 | |
1926 /** | |
1927 * Keyboard and/or mouse event mask indicating that the CTRL key | |
1928 * was pushed on the keyboard when the event was generated. This | |
1929 * is a synonym for CTRL (value is 1<<18). | |
1930 */ | |
1931 public static const int CONTROL = CTRL; | |
1932 | |
1933 /** | |
1934 * Keyboard and/or mouse event mask indicating that the COMMAND key | |
1935 * was pushed on the keyboard when the event was generated | |
1936 * (value is 1<<22). | |
1937 * | |
1938 * @since 2.1 | |
1939 */ | |
1940 public static const int COMMAND = 1 << 22; | |
1941 | |
1942 /** | |
1943 * Keyboard and/or mouse event mask indicating all possible | |
1944 * keyboard modifiers. | |
1945 * | |
1946 * To allow for the future, this mask is intended to be used in | |
1947 * place of code that references each individual keyboard mask. | |
1948 * For example, the following expression will determine whether | |
1949 * any modifier is pressed and will continue to work as new modifier | |
1950 * masks are added. | |
1951 * | |
1952 * <code>(stateMask & DWT.MODIFIER_MASK) !is 0</code>. | |
1953 * | |
1954 * @since 2.1 | |
1955 */ | |
196
1e7701c27c03
Fix initialization of key modifiers
Frank Benoit <benoit@tionex.de>
parents:
192
diff
changeset
|
1956 public static const int MODIFIER_MASK = ALT | SHIFT | CTRL | COMMAND; |
0 | 1957 |
1958 /** | |
1959 * Keyboard and/or mouse event mask indicating that mouse button one | |
1960 * was pushed when the event was generated. (value is 1<<19). | |
1961 */ | |
1962 public static const int BUTTON1 = 1 << 19; | |
1963 | |
1964 /** | |
1965 * Keyboard and/or mouse event mask indicating that mouse button two | |
1966 * was pushed when the event was generated. (value is 1<<20). | |
1967 */ | |
1968 public static const int BUTTON2 = 1 << 20; | |
1969 | |
1970 /** | |
1971 * Keyboard and/or mouse event mask indicating that mouse button three | |
1972 * was pushed when the event was generated. (value is 1<<21). | |
1973 */ | |
1974 public static const int BUTTON3 = 1 << 21; | |
1975 | |
1976 /** | |
1977 * Keyboard and/or mouse event mask indicating that mouse button four | |
1978 * was pushed when the event was generated. (value is 1<<23). | |
1979 * | |
1980 * @since 3.1 | |
1981 */ | |
1982 public static const int BUTTON4 = 1 << 23; | |
1983 | |
1984 /** | |
1985 * Keyboard and/or mouse event mask indicating that mouse button five | |
1986 * was pushed when the event was generated. (value is 1<<25). | |
1987 * | |
1988 * @since 3.1 | |
1989 */ | |
1990 public static const int BUTTON5 = 1 << 25; | |
1991 | |
1992 /** | |
1993 * Keyboard and/or mouse event mask indicating all possible | |
1994 * mouse buttons. | |
1995 * | |
1996 * To allow for the future, this mask is intended to be used | |
1997 * in place of code that references each individual button mask. | |
1998 * For example, the following expression will determine whether | |
1999 * any button is pressed and will continue to work as new button | |
2000 * masks are added. | |
2001 * | |
2002 * <code>(stateMask & DWT.BUTTON_MASK) !is 0</code>. | |
2003 * | |
2004 * @since 2.1 | |
2005 */ | |
196
1e7701c27c03
Fix initialization of key modifiers
Frank Benoit <benoit@tionex.de>
parents:
192
diff
changeset
|
2006 public static const int BUTTON_MASK = BUTTON1 | BUTTON2 | BUTTON3 | BUTTON4 | BUTTON5; |
0 | 2007 |
2008 /** | |
2009 * Keyboard and/or mouse event mask indicating that the MOD1 key | |
2010 * was pushed on the keyboard when the event was generated. | |
2011 * | |
2012 * This is the primary keyboard modifier for the platform. | |
2013 * | |
2014 * @since 2.1 | |
2015 */ | |
196
1e7701c27c03
Fix initialization of key modifiers
Frank Benoit <benoit@tionex.de>
parents:
192
diff
changeset
|
2016 public static const int MOD1 = CONTROL; |
0 | 2017 |
2018 /** | |
2019 * Keyboard and/or mouse event mask indicating that the MOD2 key | |
2020 * was pushed on the keyboard when the event was generated. | |
2021 * | |
2022 * This is the secondary keyboard modifier for the platform. | |
2023 * | |
2024 * @since 2.1 | |
2025 */ | |
196
1e7701c27c03
Fix initialization of key modifiers
Frank Benoit <benoit@tionex.de>
parents:
192
diff
changeset
|
2026 public static const int MOD2 = SHIFT; |
0 | 2027 |
2028 /** | |
2029 * Keyboard and/or mouse event mask indicating that the MOD3 key | |
2030 * was pushed on the keyboard when the event was generated. | |
2031 * | |
2032 * @since 2.1 | |
2033 */ | |
196
1e7701c27c03
Fix initialization of key modifiers
Frank Benoit <benoit@tionex.de>
parents:
192
diff
changeset
|
2034 public static const int MOD3 = ALT; |
0 | 2035 |
2036 /** | |
2037 * Keyboard and/or mouse event mask indicating that the MOD4 key | |
2038 * was pushed on the keyboard when the event was generated. | |
2039 * | |
2040 * @since 2.1 | |
2041 */ | |
196
1e7701c27c03
Fix initialization of key modifiers
Frank Benoit <benoit@tionex.de>
parents:
192
diff
changeset
|
2042 public static const int MOD4 = 0; |
0 | 2043 |
2044 /** | |
2045 * Constants to indicate line scrolling (value is 1). | |
2046 * <p><b>Used By:</b><ul> | |
2047 * <li><code>Control</code></li> | |
2048 * </ul></p> | |
2049 * | |
2050 * @since 3.1 | |
2051 */ | |
2052 public static const int SCROLL_LINE = 1; | |
2053 | |
2054 /** | |
2055 * Constants to indicate page scrolling (value is 2). | |
2056 * <p><b>Used By:</b><ul> | |
2057 * <li><code>Control</code></li> | |
2058 * </ul></p> | |
2059 * | |
2060 * @since 3.1 | |
2061 */ | |
2062 public static const int SCROLL_PAGE = 2; | |
2063 | |
2064 /** | |
2065 * Accelerator constant used to differentiate a key code from a | |
2066 * unicode character. | |
2067 * | |
2068 * If this bit is set, then the key stroke | |
2069 * portion of an accelerator represents a key code. If this bit | |
2070 * is not set, then the key stroke portion of an accelerator is | |
2071 * a unicode character. | |
2072 * | |
2073 * The following expression is false: | |
2074 * | |
2075 * <code>((DWT.MOD1 | DWT.MOD2 | 'T') & DWT.KEYCODE_BIT) !is 0</code>. | |
2076 * | |
2077 * The following expression is true: | |
2078 * | |
2079 * <code>((DWT.MOD3 | DWT.F2) & DWT.KEYCODE_BIT) !is 0</code>. | |
2080 * | |
2081 * (value is (1<<24)) | |
2082 * | |
2083 * @since 2.1 | |
2084 */ | |
2085 public static const int KEYCODE_BIT = (1 << 24); | |
2086 | |
2087 /** | |
2088 * Accelerator constant used to extract the key stroke portion of | |
2089 * an accelerator. | |
2090 * | |
2091 * The key stroke may be a key code or a unicode | |
2092 * value. If the key stroke is a key code <code>KEYCODE_BIT</code> | |
2093 * will be set. | |
2094 * | |
2095 * @since 2.1 | |
2096 */ | |
2097 public static const int KEY_MASK = KEYCODE_BIT + 0xFFFF; | |
2098 | |
2099 /** | |
2100 * Keyboard event constant representing the UP ARROW key | |
2101 * (value is (1<<24)+1). | |
2102 */ | |
2103 public static const int ARROW_UP = KEYCODE_BIT + 1; | |
2104 | |
2105 /** | |
2106 * Keyboard event constant representing the DOWN ARROW key | |
2107 * (value is (1<<24)+2). | |
2108 */ | |
2109 public static const int ARROW_DOWN = KEYCODE_BIT + 2; | |
2110 | |
2111 /** | |
2112 * Keyboard event constant representing the LEFT ARROW key | |
2113 * (value is (1<<24)+3). | |
2114 */ | |
2115 public static const int ARROW_LEFT = KEYCODE_BIT + 3; | |
2116 | |
2117 /** | |
2118 * Keyboard event constant representing the RIGHT ARROW key | |
2119 * (value is (1<<24)+4). | |
2120 */ | |
2121 public static const int ARROW_RIGHT = KEYCODE_BIT + 4; | |
2122 | |
2123 /** | |
2124 * Keyboard event constant representing the PAGE UP key | |
2125 * (value is (1<<24)+5). | |
2126 */ | |
2127 public static const int PAGE_UP = KEYCODE_BIT + 5; | |
2128 | |
2129 /** | |
2130 * Keyboard event constant representing the PAGE DOWN key | |
2131 * (value is (1<<24)+6). | |
2132 */ | |
2133 public static const int PAGE_DOWN = KEYCODE_BIT + 6; | |
2134 | |
2135 /** | |
2136 * Keyboard event constant representing the HOME key | |
2137 * (value is (1<<24)+7). | |
2138 */ | |
2139 public static const int HOME = KEYCODE_BIT + 7; | |
2140 | |
2141 /** | |
2142 * Keyboard event constant representing the END key | |
2143 * (value is (1<<24)+8). | |
2144 */ | |
2145 public static const int END = KEYCODE_BIT + 8; | |
2146 | |
2147 /** | |
2148 * Keyboard event constant representing the INSERT key | |
2149 * (value is (1<<24)+9). | |
2150 */ | |
2151 public static const int INSERT = KEYCODE_BIT + 9; | |
2152 | |
2153 /** | |
2154 * Keyboard event constant representing the F1 key | |
2155 * (value is (1<<24)+10). | |
2156 */ | |
2157 public static const int F1 = KEYCODE_BIT + 10; | |
2158 | |
2159 /** | |
2160 * Keyboard event constant representing the F2 key | |
2161 * (value is (1<<24)+11). | |
2162 */ | |
2163 public static const int F2 = KEYCODE_BIT + 11; | |
2164 | |
2165 /** | |
2166 * Keyboard event constant representing the F3 key | |
2167 * (value is (1<<24)+12). | |
2168 */ | |
2169 public static const int F3 = KEYCODE_BIT + 12; | |
2170 | |
2171 /** | |
2172 * Keyboard event constant representing the F4 key | |
2173 * (value is (1<<24)+13). | |
2174 */ | |
2175 public static const int F4 = KEYCODE_BIT + 13; | |
2176 | |
2177 /** | |
2178 * Keyboard event constant representing the F5 key | |
2179 * (value is (1<<24)+14). | |
2180 */ | |
2181 public static const int F5 = KEYCODE_BIT + 14; | |
2182 | |
2183 /** | |
2184 * Keyboard event constant representing the F6 key | |
2185 * (value is (1<<24)+15). | |
2186 */ | |
2187 public static const int F6 = KEYCODE_BIT + 15; | |
2188 | |
2189 /** | |
2190 * Keyboard event constant representing the F7 key | |
2191 * (value is (1<<24)+16). | |
2192 */ | |
2193 public static const int F7 = KEYCODE_BIT + 16; | |
2194 | |
2195 /** | |
2196 * Keyboard event constant representing the F8 key | |
2197 * (value is (1<<24)+17). | |
2198 */ | |
2199 public static const int F8 = KEYCODE_BIT + 17; | |
2200 | |
2201 /** | |
2202 * Keyboard event constant representing the F9 key | |
2203 * (value is (1<<24)+18). | |
2204 */ | |
2205 public static const int F9 = KEYCODE_BIT + 18; | |
2206 | |
2207 /** | |
2208 * Keyboard event constant representing the F10 key | |
2209 * (value is (1<<24)+19). | |
2210 */ | |
2211 public static const int F10 = KEYCODE_BIT + 19; | |
2212 | |
2213 /** | |
2214 * Keyboard event constant representing the F11 key | |
2215 * (value is (1<<24)+20). | |
2216 */ | |
2217 public static const int F11 = KEYCODE_BIT + 20; | |
2218 | |
2219 /** | |
2220 * Keyboard event constant representing the F12 key | |
2221 * (value is (1<<24)+21). | |
2222 */ | |
2223 public static const int F12 = KEYCODE_BIT + 21; | |
2224 | |
2225 /** | |
2226 * Keyboard event constant representing the F13 key | |
2227 * (value is (1<<24)+22). | |
2228 * | |
2229 * @since 3.0 | |
2230 */ | |
2231 public static const int F13 = KEYCODE_BIT + 22; | |
2232 | |
2233 /** | |
2234 * Keyboard event constant representing the F14 key | |
2235 * (value is (1<<24)+23). | |
2236 * | |
2237 * @since 3.0 | |
2238 */ | |
2239 public static const int F14 = KEYCODE_BIT + 23; | |
2240 | |
2241 /** | |
2242 * Keyboard event constant representing the F15 key | |
2243 * (value is (1<<24)+24). | |
2244 * | |
2245 * @since 3.0 | |
2246 */ | |
2247 public static const int F15 = KEYCODE_BIT + 24; | |
2248 | |
2249 /** | |
2250 * Keyboard event constant representing the numeric key | |
2251 * pad multiply key (value is (1<<24)+42). | |
2252 * | |
2253 * @since 3.0 | |
2254 */ | |
2255 public static const int KEYPAD_MULTIPLY = KEYCODE_BIT + 42; | |
2256 | |
2257 /** | |
2258 * Keyboard event constant representing the numeric key | |
2259 * pad add key (value is (1<<24)+43). | |
2260 * | |
2261 * @since 3.0 | |
2262 */ | |
2263 public static const int KEYPAD_ADD = KEYCODE_BIT + 43; | |
2264 | |
2265 /** | |
2266 * Keyboard event constant representing the numeric key | |
2267 * pad subtract key (value is (1<<24)+45). | |
2268 * | |
2269 * @since 3.0 | |
2270 */ | |
2271 public static const int KEYPAD_SUBTRACT = KEYCODE_BIT + 45; | |
2272 | |
2273 /** | |
2274 * Keyboard event constant representing the numeric key | |
2275 * pad decimal key (value is (1<<24)+46). | |
2276 * | |
2277 * @since 3.0 | |
2278 */ | |
2279 public static const int KEYPAD_DECIMAL = KEYCODE_BIT + 46; | |
2280 | |
2281 /** | |
2282 * Keyboard event constant representing the numeric key | |
2283 * pad divide key (value is (1<<24)+47). | |
2284 * | |
2285 * @since 3.0 | |
2286 */ | |
2287 public static const int KEYPAD_DIVIDE = KEYCODE_BIT + 47; | |
2288 | |
2289 /** | |
2290 * Keyboard event constant representing the numeric key | |
2291 * pad zero key (value is (1<<24)+48). | |
2292 * | |
2293 * @since 3.0 | |
2294 */ | |
2295 public static const int KEYPAD_0 = KEYCODE_BIT + 48; | |
2296 | |
2297 /** | |
2298 * Keyboard event constant representing the numeric key | |
2299 * pad one key (value is (1<<24)+49). | |
2300 * | |
2301 * @since 3.0 | |
2302 */ | |
2303 public static const int KEYPAD_1 = KEYCODE_BIT + 49; | |
2304 | |
2305 /** | |
2306 * Keyboard event constant representing the numeric key | |
2307 * pad two key (value is (1<<24)+50). | |
2308 * | |
2309 * @since 3.0 | |
2310 */ | |
2311 public static const int KEYPAD_2 = KEYCODE_BIT + 50; | |
2312 | |
2313 /** | |
2314 * Keyboard event constant representing the numeric key | |
2315 * pad three key (value is (1<<24)+51). | |
2316 * | |
2317 * @since 3.0 | |
2318 */ | |
2319 public static const int KEYPAD_3 = KEYCODE_BIT + 51; | |
2320 | |
2321 /** | |
2322 * Keyboard event constant representing the numeric key | |
2323 * pad four key (value is (1<<24)+52). | |
2324 * | |
2325 * @since 3.0 | |
2326 */ | |
2327 public static const int KEYPAD_4 = KEYCODE_BIT + 52; | |
2328 | |
2329 /** | |
2330 * Keyboard event constant representing the numeric key | |
2331 * pad five key (value is (1<<24)+53). | |
2332 * | |
2333 * @since 3.0 | |
2334 */ | |
2335 public static const int KEYPAD_5 = KEYCODE_BIT + 53; | |
2336 | |
2337 /** | |
2338 * Keyboard event constant representing the numeric key | |
2339 * pad six key (value is (1<<24)+54). | |
2340 * | |
2341 * @since 3.0 | |
2342 */ | |
2343 public static const int KEYPAD_6 = KEYCODE_BIT + 54; | |
2344 | |
2345 /** | |
2346 * Keyboard event constant representing the numeric key | |
2347 * pad seven key (value is (1<<24)+55). | |
2348 * | |
2349 * @since 3.0 | |
2350 */ | |
2351 public static const int KEYPAD_7 = KEYCODE_BIT + 55; | |
2352 | |
2353 /** | |
2354 * Keyboard event constant representing the numeric key | |
2355 * pad eight key (value is (1<<24)+56). | |
2356 * | |
2357 * @since 3.0 | |
2358 */ | |
2359 public static const int KEYPAD_8 = KEYCODE_BIT + 56; | |
2360 | |
2361 /** | |
2362 * Keyboard event constant representing the numeric key | |
2363 * pad nine key (value is (1<<24)+57). | |
2364 * | |
2365 * @since 3.0 | |
2366 */ | |
2367 public static const int KEYPAD_9 = KEYCODE_BIT + 57; | |
2368 | |
2369 /** | |
2370 * Keyboard event constant representing the numeric key | |
2371 * pad equal key (value is (1<<24)+61). | |
2372 * | |
2373 * @since 3.0 | |
2374 */ | |
2375 public static const int KEYPAD_EQUAL = KEYCODE_BIT + 61; | |
2376 | |
2377 /** | |
2378 * Keyboard event constant representing the numeric key | |
2379 * pad enter key (value is (1<<24)+80). | |
2380 * | |
2381 * @since 3.0 | |
2382 */ | |
2383 public static const int KEYPAD_CR = KEYCODE_BIT + 80; | |
2384 | |
2385 /** | |
2386 * Keyboard event constant representing the help | |
2387 * key (value is (1<<24)+81). | |
2388 * | |
2389 * NOTE: The HELP key maps to the key labeled "help", | |
2390 * not "F1". If your keyboard does not have a HELP key, | |
2391 * you will never see this key press. To listen for | |
2392 * help on a control, use DWT.Help. | |
2393 * | |
2394 * @since 3.0 | |
2395 * | |
2396 * @see DWT#Help | |
2397 */ | |
2398 public static const int HELP = KEYCODE_BIT + 81; | |
2399 | |
2400 /** | |
2401 * Keyboard event constant representing the caps | |
2402 * lock key (value is (1<<24)+82). | |
2403 * | |
2404 * @since 3.0 | |
2405 */ | |
2406 public static const int CAPS_LOCK = KEYCODE_BIT + 82; | |
2407 | |
2408 /** | |
2409 * Keyboard event constant representing the num | |
2410 * lock key (value is (1<<24)+83). | |
2411 * | |
2412 * @since 3.0 | |
2413 */ | |
2414 public static const int NUM_LOCK = KEYCODE_BIT + 83; | |
2415 | |
2416 /** | |
2417 * Keyboard event constant representing the scroll | |
2418 * lock key (value is (1<<24)+84). | |
2419 * | |
2420 * @since 3.0 | |
2421 */ | |
2422 public static const int SCROLL_LOCK = KEYCODE_BIT + 84; | |
2423 | |
2424 /** | |
2425 * Keyboard event constant representing the pause | |
2426 * key (value is (1<<24)+85). | |
2427 * | |
2428 * @since 3.0 | |
2429 */ | |
2430 public static const int PAUSE = KEYCODE_BIT + 85; | |
2431 | |
2432 /** | |
2433 * Keyboard event constant representing the break | |
2434 * key (value is (1<<24)+86). | |
2435 * | |
2436 * @since 3.0 | |
2437 */ | |
2438 public static const int BREAK = KEYCODE_BIT + 86; | |
2439 | |
2440 /** | |
2441 * Keyboard event constant representing the print screen | |
2442 * key (value is (1<<24)+87). | |
2443 * | |
2444 * @since 3.0 | |
2445 */ | |
2446 public static const int PRINT_SCREEN = KEYCODE_BIT + 87; | |
2447 | |
2448 /** | |
2449 * The <code>MessageBox</code> style constant for error icon | |
2450 * behavior (value is 1). | |
2451 */ | |
2452 public static const int ICON_ERROR = 1; | |
2453 | |
2454 /** | |
2455 * The <code>MessageBox</code> style constant for information icon | |
2456 * behavior (value is 1<<1). | |
2457 */ | |
2458 public static const int ICON_INFORMATION = 1 << 1; | |
2459 | |
2460 /** | |
2461 * The <code>MessageBox</code> style constant for question icon | |
2462 * behavior (value is 1<<2). | |
2463 */ | |
2464 public static const int ICON_QUESTION = 1 << 2; | |
2465 | |
2466 /** | |
2467 * The <code>MessageBox</code> style constant for warning icon | |
2468 * behavior (value is 1<<3). | |
2469 */ | |
2470 public static const int ICON_WARNING = 1 << 3; | |
2471 | |
2472 /** | |
2473 * The <code>MessageBox</code> style constant for "working" icon | |
2474 * behavior (value is 1<<4). | |
2475 */ | |
2476 public static const int ICON_WORKING = 1 << 4; | |
2477 | |
2478 /** | |
2479 * The <code>MessageBox</code> style constant for an OK button; | |
2480 * valid combinations are OK, OK|CANCEL | |
2481 * (value is 1<<5). | |
2482 */ | |
2483 public static const int OK = 1 << 5; | |
2484 | |
2485 /** | |
2486 * The <code>MessageBox</code> style constant for YES button; | |
2487 * valid combinations are YES|NO, YES|NO|CANCEL | |
2488 * (value is 1<<6). | |
2489 */ | |
2490 public static const int YES = 1 << 6; | |
2491 | |
2492 /** | |
2493 * The <code>MessageBox</code> style constant for NO button; | |
2494 * valid combinations are YES|NO, YES|NO|CANCEL | |
2495 * (value is 1<<7). | |
2496 */ | |
2497 public static const int NO = 1 << 7; | |
2498 | |
2499 /** | |
2500 * The <code>MessageBox</code> style constant for a CANCEL button; | |
2501 * valid combinations are OK|CANCEL, YES|NO|CANCEL, RETRY|CANCEL | |
2502 * (value is 1<<8). This style constant is also used with | |
2503 * <code>Text</code> in combination with SEARCH. | |
2504 * | |
2505 * <p><b>Used By:</b><ul> | |
2506 * <li><code>MessageBox</code></li> | |
2507 * <li><code>Text</code></li> | |
2508 * </ul></p> | |
2509 */ | |
2510 public static const int CANCEL = 1 << 8; | |
2511 | |
2512 /** | |
2513 * The <code>MessageBox</code> style constant for an ABORT button; | |
2514 * the only valid combination is ABORT|RETRY|IGNORE | |
2515 * (value is 1<<9). | |
2516 */ | |
2517 public static const int ABORT = 1 << 9; | |
2518 | |
2519 /** | |
2520 * The <code>MessageBox</code> style constant for a RETRY button; | |
2521 * valid combinations are ABORT|RETRY|IGNORE, RETRY|CANCEL | |
2522 * (value is 1<<10). | |
2523 */ | |
2524 public static const int RETRY = 1 << 10; | |
2525 | |
2526 /** | |
2527 * The <code>MessageBox</code> style constant for an IGNORE button; | |
2528 * the only valid combination is ABORT|RETRY|IGNORE | |
2529 * (value is 1<<11). | |
2530 */ | |
2531 public static const int IGNORE = 1 << 11; | |
2532 | |
2533 /** | |
2534 * The <code>FileDialog</code> style constant for open file dialog behavior | |
2535 * (value is 1<<12). | |
2536 */ | |
2537 public static const int OPEN = 1 << 12; | |
2538 | |
2539 /** | |
2540 * The <code>FileDialog</code> style constant for save file dialog behavior | |
2541 * (value is 1<<13). | |
2542 */ | |
2543 public static const int SAVE = 1 << 13; | |
2544 | |
2545 /** | |
2546 * The <code>Composite</code> constant to indicate that | |
2547 * an attribute (such as background) is not inherited | |
2548 * by the children (value is 0). | |
2549 * | |
2550 * @since 3.2 | |
2551 */ | |
2552 public static const int INHERIT_NONE = 0; | |
2553 | |
2554 /** | |
2555 * The <code>Composite</code> constant to indicate that | |
2556 * an attribute (such as background) is inherited by | |
2557 * children who choose this value as their "default" | |
2558 * (value is 1). For example, a label child will | |
2559 * typically choose to inherit the background color | |
2560 * of a composite while a list or table will not. | |
2561 * | |
2562 * @since 3.2 | |
2563 */ | |
2564 public static const int INHERIT_DEFAULT = 1; | |
2565 | |
2566 /** | |
2567 * The <code>Composite</code> constant to indicate that | |
2568 * an attribute (such as background) is inherited by | |
2569 * all children. | |
2570 * | |
2571 * @since 3.2 | |
2572 */ | |
2573 public static const int INHERIT_FORCE = 2; | |
2574 | |
2575 /** | |
2576 * Default color white (value is 1). | |
2577 */ | |
2578 public static const int COLOR_WHITE = 1; | |
2579 | |
2580 /** | |
2581 * Default color black (value is 2). | |
2582 */ | |
2583 public static const int COLOR_BLACK = 2; | |
2584 | |
2585 /** | |
2586 * Default color red (value is 3). | |
2587 */ | |
2588 public static const int COLOR_RED = 3; | |
2589 | |
2590 /** | |
2591 * Default color dark red (value is 4). | |
2592 */ | |
2593 public static const int COLOR_DARK_RED = 4; | |
2594 | |
2595 /** | |
2596 * Default color green (value is 5). | |
2597 */ | |
2598 public static const int COLOR_GREEN = 5; | |
2599 | |
2600 /** | |
2601 * Default color dark green (value is 6). | |
2602 */ | |
2603 public static const int COLOR_DARK_GREEN = 6; | |
2604 | |
2605 /** | |
2606 * Default color yellow (value is 7). | |
2607 */ | |
2608 public static const int COLOR_YELLOW = 7; | |
2609 | |
2610 /** | |
2611 * Default color dark yellow (value is 8). | |
2612 */ | |
2613 public static const int COLOR_DARK_YELLOW = 8; | |
2614 | |
2615 /** | |
2616 * Default color blue (value is 9). | |
2617 */ | |
2618 public static const int COLOR_BLUE = 9; | |
2619 | |
2620 /** | |
2621 * Default color dark blue (value is 10). | |
2622 */ | |
2623 public static const int COLOR_DARK_BLUE = 10; | |
2624 | |
2625 /** | |
2626 * Default color magenta (value is 11). | |
2627 */ | |
2628 public static const int COLOR_MAGENTA = 11; | |
2629 | |
2630 /** | |
2631 * Default color dark magenta (value is 12). | |
2632 */ | |
2633 public static const int COLOR_DARK_MAGENTA = 12; | |
2634 | |
2635 /** | |
2636 * Default color cyan (value is 13). | |
2637 */ | |
2638 public static const int COLOR_CYAN = 13; | |
2639 | |
2640 /** | |
2641 * Default color dark cyan (value is 14). | |
2642 */ | |
2643 public static const int COLOR_DARK_CYAN = 14; | |
2644 | |
2645 /** | |
2646 * Default color gray (value is 15). | |
2647 */ | |
2648 public static const int COLOR_GRAY = 15; | |
2649 | |
2650 /** | |
2651 * Default color dark gray (value is 16). | |
2652 */ | |
2653 public static const int COLOR_DARK_GRAY = 16; | |
2654 | |
2655 /* | |
2656 * System Colors | |
2657 * | |
2658 * Dealing with system colors is an area where there are | |
2659 * many platform differences. On some platforms, system | |
2660 * colors can change dynamically while the program is | |
2661 * running. On other platforms, system colors can be | |
2662 * changed for all instances of a particular widget. | |
2663 * Therefore, the only truly portable method to obtain | |
2664 * a widget color query is to query the color from an | |
2665 * instance of the widget. | |
2666 * | |
2667 * It is expected that the list of supported colors | |
2668 * will grow over time. | |
2669 */ | |
2670 | |
2671 /** | |
2672 * System color used to paint dark shadow areas (value is 17). | |
2673 */ | |
2674 public static const int COLOR_WIDGET_DARK_SHADOW = 17; | |
2675 | |
2676 /** | |
2677 * System color used to paint normal shadow areas (value is 18). | |
2678 */ | |
2679 public static const int COLOR_WIDGET_NORMAL_SHADOW = 18; | |
2680 | |
2681 /** | |
2682 * System color used to paint light shadow areas (value is 19). | |
2683 */ | |
2684 public static const int COLOR_WIDGET_LIGHT_SHADOW = 19; | |
2685 | |
2686 /** | |
2687 * System color used to paint highlight shadow areas (value is 20). | |
2688 */ | |
2689 public static const int COLOR_WIDGET_HIGHLIGHT_SHADOW = 20; | |
2690 | |
2691 /** | |
2692 * System color used to paint foreground areas (value is 21). | |
2693 */ | |
2694 public static const int COLOR_WIDGET_FOREGROUND = 21; | |
2695 | |
2696 /** | |
2697 * System color used to paint background areas (value is 22). | |
2698 */ | |
2699 public static const int COLOR_WIDGET_BACKGROUND = 22; | |
2700 | |
2701 /** | |
2702 * System color used to paint border areas (value is 23). | |
2703 */ | |
2704 public static const int COLOR_WIDGET_BORDER = 23; | |
2705 | |
2706 /** | |
2707 * System color used to paint list foreground areas (value is 24). | |
2708 */ | |
2709 public static const int COLOR_LIST_FOREGROUND = 24; | |
2710 | |
2711 /** | |
2712 * System color used to paint list background areas (value is 25). | |
2713 */ | |
2714 public static const int COLOR_LIST_BACKGROUND = 25; | |
2715 | |
2716 /** | |
2717 * System color used to paint list selection background areas (value is 26). | |
2718 */ | |
2719 public static const int COLOR_LIST_SELECTION = 26; | |
2720 | |
2721 /** | |
2722 * System color used to paint list selected text (value is 27). | |
2723 */ | |
2724 public static const int COLOR_LIST_SELECTION_TEXT = 27; | |
2725 | |
2726 /** | |
2727 * System color used to paint tooltip text (value is 28). | |
2728 */ | |
2729 public static const int COLOR_INFO_FOREGROUND = 28; | |
2730 | |
2731 /** | |
2732 * System color used to paint tooltip background areas (value is 29). | |
2733 */ | |
2734 public static const int COLOR_INFO_BACKGROUND = 29; | |
2735 | |
2736 /** | |
2737 * System color used to paint title text (value is 30). | |
2738 */ | |
2739 public static const int COLOR_TITLE_FOREGROUND = 30; | |
2740 | |
2741 /** | |
2742 * System color used to paint title background areas (value is 31). | |
2743 */ | |
2744 public static const int COLOR_TITLE_BACKGROUND = 31; | |
2745 | |
2746 /** | |
2747 * System color used to paint title background gradient (value is 32). | |
2748 */ | |
2749 public static const int COLOR_TITLE_BACKGROUND_GRADIENT = 32; | |
2750 | |
2751 /** | |
2752 * System color used to paint inactive title text (value is 33). | |
2753 */ | |
2754 public static const int COLOR_TITLE_INACTIVE_FOREGROUND = 33; | |
2755 | |
2756 /** | |
2757 * System color used to paint inactive title background areas (value is 34). | |
2758 */ | |
2759 public static const int COLOR_TITLE_INACTIVE_BACKGROUND = 34; | |
2760 | |
2761 /** | |
2762 * System color used to paint inactive title background gradient (value is 35). | |
2763 */ | |
2764 public static const int COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT = 35; | |
2765 | |
2766 /** | |
2767 * Draw constant indicating whether the drawing operation | |
2768 * should fill the background (value is 1<<0). | |
2769 */ | |
2770 public static const int DRAW_TRANSPARENT = 1 << 0; | |
2771 | |
2772 /** | |
2773 * Draw constant indicating whether the string drawing operation | |
2774 * should handle line-delimiters (value is 1<<1). | |
2775 */ | |
2776 public static const int DRAW_DELIMITER = 1 << 1; | |
2777 | |
2778 /** | |
2779 * Draw constant indicating whether the string drawing operation | |
2780 * should expand TAB characters (value is 1<<2). | |
2781 */ | |
2782 public static const int DRAW_TAB = 1 << 2; | |
2783 | |
2784 /** | |
2785 * Draw constant indicating whether the string drawing operation | |
2786 * should handle mnemonics (value is 1<<3). | |
2787 */ | |
2788 public static const int DRAW_MNEMONIC = 1 << 3; | |
2789 | |
2790 | |
2791 /** | |
2792 * Selection constant indicating that a line delimiter should be | |
2793 * drawn (value is 1<<17). | |
2794 * | |
2795 * <p><b>Used By:</b><ul> | |
2796 * <li><code>TextLayout</code></li> | |
2797 * </ul></p> | |
2798 * | |
2799 * @see #FULL_SELECTION | |
2800 * @see #LAST_LINE_SELECTION | |
2801 * | |
2802 * @since 3.3 | |
2803 */ | |
2804 public static const int DELIMITER_SELECTION = 1 << 17; | |
2805 | |
2806 /** | |
2807 * Selection constant indicating that the last line is selected | |
2808 * to the end and should be drawn using either a line delimiter | |
2809 * or full line selection (value is 1<<20). | |
2810 * | |
2811 * <p><b>Used By:</b><ul> | |
2812 * <li><code>TextLayout</code></li> | |
2813 * </ul></p> | |
2814 * | |
2815 * @see #DELIMITER_SELECTION | |
2816 * @see #FULL_SELECTION | |
2817 * | |
2818 * @since 3.3 | |
2819 */ | |
2820 public static const int LAST_LINE_SELECTION = 1 << 20; | |
2821 | |
2822 /** | |
2823 * DWT error constant indicating that no error number was specified | |
2824 * (value is 1). | |
2825 */ | |
2826 public static const int ERROR_UNSPECIFIED = 1; | |
2827 | |
2828 /** | |
2829 * DWT error constant indicating that no more handles for an | |
2830 * operating system resource are available | |
2831 * (value is 2). | |
2832 */ | |
2833 public static const int ERROR_NO_HANDLES = 2; | |
2834 | |
2835 /** | |
2836 * DWT error constant indicating that no more callback resources are available | |
2837 * (value is 3). | |
2838 */ | |
2839 public static const int ERROR_NO_MORE_CALLBACKS = 3; | |
2840 | |
2841 /** | |
2842 * DWT error constant indicating that a null argument was passed in | |
2843 * (value is 4). | |
2844 */ | |
2845 public static const int ERROR_NULL_ARGUMENT = 4; | |
2846 | |
2847 /** | |
2848 * DWT error constant indicating that an invalid argument was passed in | |
2849 * (value is 5). | |
2850 */ | |
2851 public static const int ERROR_INVALID_ARGUMENT = 5; | |
2852 | |
2853 /** | |
2854 * DWT error constant indicating that a value was found to be | |
2855 * outside the allowable range | |
2856 * (value is 6). | |
2857 */ | |
2858 public static const int ERROR_INVALID_RANGE = 6; | |
2859 | |
2860 /** | |
2861 * DWT error constant indicating that a value which can not be | |
2862 * zero was found to be | |
2863 * (value is 7). | |
2864 */ | |
2865 public static const int ERROR_CANNOT_BE_ZERO = 7; | |
2866 | |
2867 /** | |
2868 * DWT error constant indicating that the underlying operating | |
2869 * system was unable to provide the value of an item | |
2870 * (value is 8). | |
2871 */ | |
2872 public static const int ERROR_CANNOT_GET_ITEM = 8; | |
2873 | |
2874 /** | |
2875 * DWT error constant indicating that the underlying operating | |
2876 * system was unable to provide the selection | |
2877 * (value is 9). | |
2878 */ | |
2879 public static const int ERROR_CANNOT_GET_SELECTION = 9; | |
2880 | |
2881 /** | |
2882 * DWT error constant indicating that the matrix is not invertible | |
2883 * (value is 10). | |
2884 * | |
2885 * @since 3.1 | |
2886 */ | |
2887 public static const int ERROR_CANNOT_INVERT_MATRIX = 10; | |
2888 | |
2889 /** | |
2890 * DWT error constant indicating that the underlying operating | |
2891 * system was unable to provide the height of an item | |
2892 * (value is 11). | |
2893 */ | |
2894 public static const int ERROR_CANNOT_GET_ITEM_HEIGHT = 11; | |
2895 | |
2896 /** | |
2897 * DWT error constant indicating that the underlying operating | |
2898 * system was unable to provide the text of a widget | |
2899 * (value is 12). | |
2900 */ | |
2901 public static const int ERROR_CANNOT_GET_TEXT = 12; | |
2902 | |
2903 /** | |
2904 * DWT error constant indicating that the underlying operating | |
2905 * system was unable to set the text of a widget | |
2906 * (value is 13). | |
2907 */ | |
2908 public static const int ERROR_CANNOT_SET_TEXT = 13; | |
2909 | |
2910 /** | |
2911 * DWT error constant indicating that the underlying operating | |
2912 * system was unable to add an item | |
2913 * (value is 14). | |
2914 */ | |
2915 public static const int ERROR_ITEM_NOT_ADDED = 14; | |
2916 | |
2917 /** | |
2918 * DWT error constant indicating that the underlying operating | |
2919 * system was unable to remove an item | |
2920 * (value is 15). | |
2921 */ | |
2922 public static const int ERROR_ITEM_NOT_REMOVED = 15; | |
2923 | |
2924 /** | |
2925 * DWT error constant indicating that the graphics library | |
2926 * is not available | |
2927 * (value is 16). | |
2928 */ | |
2929 public static const int ERROR_NO_GRAPHICS_LIBRARY = 16; | |
2930 | |
2931 /** | |
2932 * DWT error constant indicating that a particular feature has | |
2933 * not been implemented on this platform | |
2934 * (value is 20). | |
2935 */ | |
2936 public static const int ERROR_NOT_IMPLEMENTED = 20; | |
2937 | |
2938 /** | |
2939 * DWT error constant indicating that a menu which needed | |
2940 * to have the drop down style had some other style instead | |
2941 * (value is 21). | |
2942 */ | |
2943 public static const int ERROR_MENU_NOT_DROP_DOWN = 21; | |
2944 | |
2945 /** | |
2946 * DWT error constant indicating that an attempt was made to | |
2947 * invoke an DWT operation which can only be executed by the | |
2948 * user-interface thread from some other thread | |
2949 * (value is 22). | |
2950 */ | |
2951 public static const int ERROR_THREAD_INVALID_ACCESS = 22; | |
2952 | |
2953 /** | |
2954 * DWT error constant indicating that an attempt was made to | |
2955 * invoke an DWT operation using a widget which had already | |
2956 * been disposed | |
2957 * (value is 24). | |
2958 */ | |
2959 public static const int ERROR_WIDGET_DISPOSED = 24; | |
2960 | |
2961 /** | |
2962 * DWT error constant indicating that a menu item which needed | |
2963 * to have the cascade style had some other style instead | |
2964 * (value is 27). | |
2965 */ | |
2966 public static const int ERROR_MENUITEM_NOT_CASCADE = 27; | |
2967 | |
2968 /** | |
2969 * DWT error constant indicating that the underlying operating | |
2970 * system was unable to set the selection of a widget | |
2971 * (value is 28). | |
2972 */ | |
2973 public static const int ERROR_CANNOT_SET_SELECTION = 28; | |
2974 | |
2975 /** | |
2976 * DWT error constant indicating that the underlying operating | |
2977 * system was unable to set the menu | |
2978 * (value is 29). | |
2979 */ | |
2980 public static const int ERROR_CANNOT_SET_MENU = 29; | |
2981 | |
2982 /** | |
2983 * DWT error constant indicating that the underlying operating | |
2984 * system was unable to set the enabled state | |
2985 * (value is 30). | |
2986 */ | |
2987 public static const int ERROR_CANNOT_SET_ENABLED = 30; | |
2988 | |
2989 /** | |
2990 * DWT error constant indicating that the underlying operating | |
2991 * system was unable to provide enabled/disabled state information | |
2992 * (value is 31). | |
2993 */ | |
2994 public static const int ERROR_CANNOT_GET_ENABLED = 31; | |
2995 | |
2996 /** | |
2997 * DWT error constant indicating that a provided widget can | |
2998 * not be used as a parent in the current operation | |
2999 * (value is 32). | |
3000 */ | |
3001 public static const int ERROR_INVALID_PARENT = 32; | |
3002 | |
3003 /** | |
3004 * DWT error constant indicating that a menu which needed | |
3005 * to have the menu bar style had some other style instead | |
3006 * (value is 33). | |
3007 */ | |
3008 public static const int ERROR_MENU_NOT_BAR = 33; | |
3009 | |
3010 /** | |
3011 * DWT error constant indicating that the underlying operating | |
3012 * system was unable to provide count information | |
3013 * (value is 36). | |
3014 */ | |
3015 public static const int ERROR_CANNOT_GET_COUNT = 36; | |
3016 | |
3017 /** | |
3018 * DWT error constant indicating that a menu which needed | |
3019 * to have the pop up menu style had some other style instead | |
3020 * (value is 37). | |
3021 */ | |
3022 public static const int ERROR_MENU_NOT_POP_UP = 37; | |
3023 | |
3024 /** | |
3025 * DWT error constant indicating that a graphics operation | |
3026 * was attempted with an image of an unsupported depth | |
3027 * (value is 38). | |
3028 */ | |
3029 public static const int ERROR_UNSUPPORTED_DEPTH = 38; | |
3030 | |
3031 /** | |
3032 * DWT error constant indicating that an input/output operation | |
3033 * failed during the execution of an DWT operation | |
3034 * (value is 39). | |
3035 */ | |
3036 public static const int ERROR_IO = 39; | |
3037 | |
3038 /** | |
3039 * DWT error constant indicating that a graphics operation | |
3040 * was attempted with an image having an invalid format | |
3041 * (value is 40). | |
3042 */ | |
3043 public static const int ERROR_INVALID_IMAGE = 40; | |
3044 | |
3045 /** | |
3046 * DWT error constant indicating that a graphics operation | |
3047 * was attempted with an image having a valid but unsupported | |
3048 * format | |
3049 * (value is 42). | |
3050 */ | |
3051 public static const int ERROR_UNSUPPORTED_FORMAT = 42; | |
3052 | |
3053 /** | |
3054 * DWT error constant indicating that an attempt was made | |
3055 * to subclass an DWT widget class without implementing the | |
3056 * <code>checkSubclass()</code> method | |
3057 * (value is 43). | |
3058 * | |
3059 * For additional information see the comment in | |
3060 * <code>Widget.checkSubclass()</code>. | |
3061 * | |
3062 * @see dwt.widgets.Widget#checkSubclass | |
3063 */ | |
3064 public static const int ERROR_INVALID_SUBCLASS = 43; | |
3065 | |
3066 /** | |
3067 * DWT error constant indicating that an attempt was made to | |
3068 * invoke an DWT operation using a graphics object which had | |
3069 * already been disposed | |
3070 * (value is 44). | |
3071 */ | |
3072 public static const int ERROR_GRAPHIC_DISPOSED = 44; | |
3073 | |
3074 /** | |
3075 * DWT error constant indicating that an attempt was made to | |
3076 * invoke an DWT operation using a device which had already | |
3077 * been disposed | |
3078 * (value is 45). | |
3079 */ | |
3080 public static const int ERROR_DEVICE_DISPOSED = 45; | |
3081 | |
3082 /** | |
3083 * DWT error constant indicating that an exception happened | |
3084 * when executing a runnable | |
3085 * (value is 46). | |
3086 */ | |
3087 public static const int ERROR_FAILED_EXEC = 46; | |
3088 | |
3089 /** | |
3090 * DWT error constant indicating that an unsatisfied link | |
3091 * error occurred while attempting to load a library | |
3092 * (value is 47). | |
3093 * | |
3094 * @since 3.1 | |
3095 */ | |
3096 public static const int ERROR_FAILED_LOAD_LIBRARY = 47; | |
3097 | |
3098 /** | |
3099 * DWT error constant indicating that a font is not valid | |
3100 * (value is 48). | |
3101 * | |
3102 * @since 3.1 | |
3103 */ | |
3104 public static const int ERROR_INVALID_FONT = 48; | |
3105 | |
3106 /** | |
3107 * Constant indicating that an image or operation is of type bitmap (value is 0). | |
3108 */ | |
3109 public static const int BITMAP = 0; | |
3110 | |
3111 /** | |
3112 * Constant indicating that an image or operation is of type icon (value is 1). | |
3113 */ | |
3114 public static const int ICON = 1; | |
3115 | |
3116 /** | |
3117 * The <code>Image</code> constructor argument indicating that | |
3118 * the new image should be a copy of the image provided as | |
3119 * an argument (value is 0). | |
3120 */ | |
3121 public static const int IMAGE_COPY = 0; | |
3122 | |
3123 /** | |
3124 * The <code>Image</code> constructor argument indicating that | |
3125 * the new image should have the appearance of a "disabled" | |
3126 * (using the platform's rules for how this should look) | |
3127 * copy of the image provided as an argument (value is 1). | |
3128 */ | |
3129 public static const int IMAGE_DISABLE = 1; | |
3130 | |
3131 /** | |
3132 * The <code>Image</code> constructor argument indicating that | |
3133 * the new image should have the appearance of a "gray scaled" | |
3134 * copy of the image provided as an argument (value is 2). | |
3135 */ | |
3136 public static const int IMAGE_GRAY = 2; | |
3137 | |
3138 /** | |
213 | 3139 * Constant to indicate an error state (value is 1). |
3140 * <p><b>Used By:</b><ul> | |
3141 * <li><code>ProgressBar</code></li> | |
3142 * </ul></p> | |
3143 * | |
3144 * @since 3.4 | |
3145 */ | |
3146 public static const int ERROR = 1; | |
3147 | |
3148 /** | |
3149 * Constant to a indicate a paused state (value is 4). | |
3150 * <p><b>Used By:</b><ul> | |
3151 * <li><code>ProgressBar</code></li> | |
3152 * </ul></p> | |
3153 * | |
3154 * @since 3.4 | |
3155 */ | |
3156 public static const int PAUSED = 1 << 2; | |
3157 | |
3158 /** | |
0 | 3159 * The font style constant indicating a normal weight, non-italic font |
213 | 3160 * (value is 0). This constant is also used with <code>ProgressBar</code> |
3161 * to indicate a normal state. | |
3162 * <p><b>Used By:</b><ul> | |
3163 * <li><code>ProgressBar</code></li> | |
3164 * </ul></p> | |
0 | 3165 */ |
3166 public static const int NORMAL = 0; | |
3167 | |
3168 /** | |
3169 * The font style constant indicating a bold weight font | |
3170 * (value is 1<<0). | |
3171 */ | |
3172 public static const int BOLD = 1 << 0; | |
3173 | |
3174 /** | |
3175 * The font style constant indicating an italic font | |
3176 * (value is 1<<1). | |
3177 */ | |
3178 public static const int ITALIC = 1 << 1; | |
3179 | |
3180 /** | |
3181 * System arrow cursor (value is 0). | |
3182 */ | |
3183 public static const int CURSOR_ARROW = 0; | |
3184 | |
3185 /** | |
3186 * System wait cursor (value is 1). | |
3187 */ | |
3188 public static const int CURSOR_WAIT = 1; | |
3189 | |
3190 /** | |
3191 * System cross hair cursor (value is 2). | |
3192 */ | |
3193 public static const int CURSOR_CROSS = 2; | |
3194 | |
3195 /** | |
3196 * System app startup cursor (value is 3). | |
3197 */ | |
3198 public static const int CURSOR_APPSTARTING = 3; | |
3199 | |
3200 /** | |
3201 * System help cursor (value is 4). | |
3202 */ | |
3203 public static const int CURSOR_HELP = 4; | |
3204 | |
3205 /** | |
3206 * System resize all directions cursor (value is 5). | |
3207 */ | |
3208 public static const int CURSOR_SIZEALL = 5; | |
3209 | |
3210 /** | |
3211 * System resize north-east-south-west cursor (value is 6). | |
3212 */ | |
3213 public static const int CURSOR_SIZENESW = 6; | |
3214 | |
3215 /** | |
3216 * System resize north-south cursor (value is 7). | |
3217 */ | |
3218 public static const int CURSOR_SIZENS = 7; | |
3219 | |
3220 /** | |
3221 * System resize north-west-south-east cursor (value is 8). | |
3222 */ | |
3223 public static const int CURSOR_SIZENWSE = 8; | |
3224 | |
3225 /** | |
3226 * System resize west-east cursor (value is 9). | |
3227 */ | |
3228 public static const int CURSOR_SIZEWE = 9; | |
3229 | |
3230 /** | |
3231 * System resize north cursor (value is 10). | |
3232 */ | |
3233 public static const int CURSOR_SIZEN = 10; | |
3234 | |
3235 /** | |
3236 * System resize south cursor (value is 11). | |
3237 */ | |
3238 public static const int CURSOR_SIZES = 11; | |
3239 | |
3240 /** | |
3241 * System resize east cursor (value is 12). | |
3242 */ | |
3243 public static const int CURSOR_SIZEE = 12; | |
3244 | |
3245 /** | |
3246 * System resize west cursor (value is 13). | |
3247 */ | |
3248 public static const int CURSOR_SIZEW = 13; | |
3249 | |
3250 /** | |
3251 * System resize north-east cursor (value is 14). | |
3252 */ | |
3253 public static const int CURSOR_SIZENE = 14; | |
3254 | |
3255 /** | |
3256 * System resize south-east cursor (value is 15). | |
3257 */ | |
3258 public static const int CURSOR_SIZESE = 15; | |
3259 | |
3260 /** | |
3261 * System resize south-west cursor (value is 16). | |
3262 */ | |
3263 public static const int CURSOR_SIZESW = 16; | |
3264 | |
3265 /** | |
3266 * System resize north-west cursor (value is 17). | |
3267 */ | |
3268 public static const int CURSOR_SIZENW = 17; | |
3269 | |
3270 /** | |
3271 * System up arrow cursor (value is 18). | |
3272 */ | |
3273 public static const int CURSOR_UPARROW = 18; | |
3274 | |
3275 /** | |
3276 * System i-beam cursor (value is 19). | |
3277 */ | |
3278 public static const int CURSOR_IBEAM = 19; | |
3279 | |
3280 /** | |
3281 * System "not allowed" cursor (value is 20). | |
3282 */ | |
3283 public static const int CURSOR_NO = 20; | |
3284 | |
3285 /** | |
3286 * System hand cursor (value is 21). | |
3287 */ | |
3288 public static const int CURSOR_HAND = 21; | |
3289 | |
3290 /** | |
3291 * Line drawing style for flat end caps (value is 1). | |
3292 * | |
3293 * @see dwt.graphics.GC#setLineCap(int) | |
3294 * @see dwt.graphics.GC#getLineCap() | |
3295 * | |
3296 * @since 3.1 | |
3297 */ | |
3298 public static const int CAP_FLAT = 1; | |
3299 | |
3300 /** | |
3301 * Line drawing style for rounded end caps (value is 2). | |
3302 * | |
3303 * @see dwt.graphics.GC#setLineCap(int) | |
3304 * @see dwt.graphics.GC#getLineCap() | |
3305 * | |
3306 * @since 3.1 | |
3307 */ | |
3308 public static const int CAP_ROUND = 2; | |
3309 | |
3310 /** | |
3311 * Line drawing style for square end caps (value is 3). | |
3312 * | |
3313 * @see dwt.graphics.GC#setLineCap(int) | |
3314 * @see dwt.graphics.GC#getLineCap() | |
3315 * | |
3316 * @since 3.1 | |
3317 */ | |
3318 public static const int CAP_SQUARE = 3; | |
3319 | |
3320 /** | |
3321 * Line drawing style for miter joins (value is 1). | |
3322 * | |
3323 * @see dwt.graphics.GC#setLineJoin(int) | |
3324 * @see dwt.graphics.GC#getLineJoin() | |
3325 * | |
3326 * @since 3.1 | |
3327 */ | |
3328 public static const int JOIN_MITER = 1; | |
3329 | |
3330 /** | |
3331 * Line drawing style for rounded joins (value is 2). | |
3332 * | |
3333 * @see dwt.graphics.GC#setLineJoin(int) | |
3334 * @see dwt.graphics.GC#getLineJoin() | |
3335 * | |
3336 * @since 3.1 | |
3337 */ | |
3338 public static const int JOIN_ROUND = 2; | |
3339 | |
3340 /** | |
3341 * Line drawing style for bevel joins (value is 3). | |
3342 * | |
3343 * @see dwt.graphics.GC#setLineJoin(int) | |
3344 * @see dwt.graphics.GC#getLineJoin() | |
3345 * | |
3346 * @since 3.1 | |
3347 */ | |
3348 public static const int JOIN_BEVEL = 3; | |
3349 | |
3350 /** | |
3351 * Line drawing style for solid lines (value is 1). | |
3352 */ | |
3353 public static const int LINE_SOLID = 1; | |
3354 | |
3355 /** | |
3356 * Line drawing style for dashed lines (value is 2). | |
3357 */ | |
3358 public static const int LINE_DASH = 2; | |
3359 | |
3360 /** | |
3361 * Line drawing style for dotted lines (value is 3). | |
3362 */ | |
3363 public static const int LINE_DOT = 3; | |
3364 | |
3365 /** | |
3366 * Line drawing style for alternating dash-dot lines (value is 4). | |
3367 */ | |
3368 public static const int LINE_DASHDOT = 4; | |
3369 | |
3370 /** | |
3371 * Line drawing style for dash-dot-dot lines (value is 5). | |
3372 */ | |
3373 public static const int LINE_DASHDOTDOT = 5; | |
3374 | |
3375 /** | |
3376 * Line drawing style for custom dashed lines (value is 6). | |
3377 * | |
3378 * @see dwt.graphics.GC#setLineDash(int[]) | |
3379 * @see dwt.graphics.GC#getLineDash() | |
3380 * | |
3381 * @since 3.1 | |
3382 */ | |
3383 public static const int LINE_CUSTOM = 6; | |
3384 | |
3385 /** | |
3386 * Path constant that represents a "move to" operation (value is 1). | |
3387 * | |
3388 * @since 3.1 | |
3389 */ | |
3390 public static const int PATH_MOVE_TO = 1; | |
3391 | |
3392 /** | |
3393 * Path constant that represents a "line to" operation (value is 2). | |
3394 * | |
3395 * @since 3.1 | |
3396 */ | |
3397 public static const int PATH_LINE_TO = 2; | |
3398 | |
3399 /** | |
3400 * Path constant that represents a "quadratic curve to" operation (value is 3). | |
3401 * | |
3402 * @since 3.1 | |
3403 */ | |
3404 public static const int PATH_QUAD_TO = 3; | |
3405 | |
3406 /** | |
3407 * Path constant that represents a "cubic curve to" operation (value is 4). | |
3408 * | |
3409 * @since 3.1 | |
3410 */ | |
3411 public static const int PATH_CUBIC_TO = 4; | |
3412 | |
3413 /** | |
3414 * Path constant that represents a "close" operation (value is 5). | |
3415 * | |
3416 * @since 3.1 | |
3417 */ | |
3418 public static const int PATH_CLOSE = 5; | |
3419 | |
3420 /** | |
3421 * Even odd rule for filling operations (value is 1). | |
3422 * | |
3423 * @since 3.1 | |
3424 */ | |
3425 public static const int FILL_EVEN_ODD = 1; | |
3426 | |
3427 /** | |
3428 * Winding rule for filling operations (value is 2). | |
3429 * | |
3430 * @since 3.1 | |
3431 */ | |
3432 public static const int FILL_WINDING = 2; | |
3433 | |
3434 /** | |
3435 * Image format constant indicating an unknown image type (value is -1). | |
3436 */ | |
3437 public static const int IMAGE_UNDEFINED = -1; | |
3438 | |
3439 /** | |
3440 * Image format constant indicating a Windows BMP format image (value is 0). | |
3441 */ | |
3442 public static const int IMAGE_BMP = 0; | |
3443 | |
3444 /** | |
3445 * Image format constant indicating a run-length encoded | |
3446 * Windows BMP format image (value is 1). | |
3447 */ | |
3448 public static const int IMAGE_BMP_RLE = 1; | |
3449 | |
3450 /** | |
3451 * Image format constant indicating a GIF format image (value is 2). | |
3452 */ | |
3453 public static const int IMAGE_GIF = 2; | |
3454 | |
3455 /** | |
3456 * Image format constant indicating a ICO format image (value is 3). | |
3457 */ | |
3458 public static const int IMAGE_ICO = 3; | |
3459 | |
3460 /** | |
3461 * Image format constant indicating a JPEG format image (value is 4). | |
3462 */ | |
3463 public static const int IMAGE_JPEG = 4; | |
3464 | |
3465 /** | |
3466 * Image format constant indicating a PNG format image (value is 5). | |
3467 */ | |
3468 public static const int IMAGE_PNG = 5; | |
3469 | |
3470 /** | |
3471 * Image format constant indicating a TIFF format image (value is 6). | |
3472 */ | |
3473 public static const int IMAGE_TIFF = 6; | |
3474 | |
3475 /** | |
3476 * Image format constant indicating an OS/2 BMP format image (value is 7). | |
3477 */ | |
3478 public static const int IMAGE_OS2_BMP = 7; | |
3479 | |
3480 /** | |
3481 * GIF image disposal method constants indicating that the | |
3482 * disposal method is unspecified (value is 0). | |
3483 */ | |
3484 public static const int DM_UNSPECIFIED = 0x0; | |
3485 | |
3486 /** | |
3487 * GIF image disposal method constants indicating that the | |
3488 * disposal method is to do nothing; that is, to leave the | |
3489 * previous image in place (value is 1). | |
3490 */ | |
3491 public static const int DM_FILL_NONE = 0x1; | |
3492 | |
3493 /** | |
3494 * GIF image disposal method constants indicating that the | |
3495 * the previous images should be covered with the background | |
3496 * color before displaying the next image (value is 2). | |
3497 */ | |
3498 public static const int DM_FILL_BACKGROUND = 0x2; | |
3499 | |
3500 /** | |
3501 * GIF image disposal method constants indicating that the | |
3502 * disposal method is to restore the previous picture | |
3503 * (value is 3). | |
3504 */ | |
3505 public static const int DM_FILL_PREVIOUS = 0x3; | |
3506 | |
3507 /** | |
3508 * Image transparency constant indicating that the image | |
3509 * contains no transparency information (value is 0). | |
3510 */ | |
3511 public static const int TRANSPARENCY_NONE = 0x0; | |
3512 | |
3513 /** | |
3514 * Image transparency constant indicating that the image | |
3515 * contains alpha transparency information (value is 1<<0). | |
3516 */ | |
3517 public static const int TRANSPARENCY_ALPHA = 1 << 0; | |
3518 | |
3519 /** | |
3520 * Image transparency constant indicating that the image | |
3521 * contains a transparency mask (value is 1<<1). | |
3522 */ | |
3523 public static const int TRANSPARENCY_MASK = 1 << 1; | |
3524 | |
3525 /** | |
3526 * Image transparency constant indicating that the image | |
3527 * contains a transparent pixel (value is 1<<2). | |
3528 */ | |
3529 public static const int TRANSPARENCY_PIXEL = 1 << 2; | |
3530 | |
3531 /** | |
3532 * The character movement type (value is 1<<0). | |
3533 * This constant is used to move a text offset over a character. | |
3534 * | |
3535 * @see dwt.graphics.TextLayout#getNextOffset(int, int) | |
3536 * @see dwt.graphics.TextLayout#getPreviousOffset(int, int) | |
3537 * | |
3538 * @since 3.0 | |
3539 */ | |
3540 public static const int MOVEMENT_CHAR = 1 << 0; | |
3541 | |
3542 /** | |
3543 * The cluster movement type (value is 1<<1). | |
3544 * This constant is used to move a text offset over a cluster. | |
3545 * A cluster groups one or more characters. A cluster is | |
3546 * undivisible, this means that a caret offset can not be placed in the | |
3547 * middle of a cluster. | |
3548 * | |
3549 * @see dwt.graphics.TextLayout#getNextOffset(int, int) | |
3550 * @see dwt.graphics.TextLayout#getPreviousOffset(int, int) | |
3551 * | |
3552 * @since 3.0 | |
3553 */ | |
3554 public static const int MOVEMENT_CLUSTER = 1 << 1; | |
3555 | |
3556 /** | |
3557 * The word movement type (value is 1<<2). | |
3558 * This constant is used to move a text offset over a word. | |
3559 * The behavior of this constant depends on the platform and on the | |
3560 * direction of the movement. For example, on Windows the stop is | |
3561 * always at the start of the word. On GTK and Mac the stop is at the end | |
3562 * of the word if the direction is next and at the start of the word if the | |
3563 * direction is previous. | |
3564 * | |
3565 * @see dwt.graphics.TextLayout#getNextOffset(int, int) | |
3566 * @see dwt.graphics.TextLayout#getPreviousOffset(int, int) | |
3567 * | |
3568 * @since 3.0 | |
3569 */ | |
3570 public static const int MOVEMENT_WORD = 1 << 2; | |
3571 | |
3572 /** | |
3573 * The word end movement type (value is 1<<3). | |
3574 * This constant is used to move a text offset to the next or previous | |
3575 * word end. The behavior of this constant does not depend on the platform. | |
3576 * | |
3577 * | |
3578 * @see dwt.graphics.TextLayout#getNextOffset(int, int) | |
3579 * @see dwt.graphics.TextLayout#getPreviousOffset(int, int) | |
3580 * | |
3581 * @since 3.3 | |
3582 */ | |
3583 public static const int MOVEMENT_WORD_END = 1 << 3; | |
3584 | |
3585 /** | |
3586 * The word start movement type (value is 1<<4). | |
3587 * This constant is used to move a text offset to the next or previous | |
3588 * word start. The behavior of this constant does not depend on the platform. | |
3589 * | |
3590 * @see dwt.graphics.TextLayout#getNextOffset(int, int) | |
3591 * @see dwt.graphics.TextLayout#getPreviousOffset(int, int) | |
3592 * | |
3593 * @since 3.3 | |
3594 */ | |
3595 public static const int MOVEMENT_WORD_START = 1 << 4; | |
3596 | |
3597 | |
3598 /** | |
3599 * Answers a concise, human readable description of the error code. | |
3600 * | |
3601 * @param code the DWT error code. | |
3602 * @return a description of the error code. | |
3603 * | |
3604 * @see DWT | |
3605 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
196
diff
changeset
|
3606 static String findErrorText (int code) { |
0 | 3607 switch (code) { |
3608 case ERROR_UNSPECIFIED: return "Unspecified error"; //$NON-NLS-1$ | |
3609 case ERROR_NO_HANDLES: return "No more handles"; //$NON-NLS-1$ | |
3610 case ERROR_NO_MORE_CALLBACKS: return "No more callbacks"; //$NON-NLS-1$ | |
3611 case ERROR_NULL_ARGUMENT: return "Argument cannot be null"; //$NON-NLS-1$ | |
3612 case ERROR_INVALID_ARGUMENT: return "Argument not valid"; //$NON-NLS-1$ | |
3613 case ERROR_INVALID_RANGE: return "Index out of bounds"; //$NON-NLS-1$ | |
3614 case ERROR_CANNOT_BE_ZERO: return "Argument cannot be zero"; //$NON-NLS-1$ | |
3615 case ERROR_CANNOT_GET_ITEM: return "Cannot get item"; //$NON-NLS-1$ | |
3616 case ERROR_CANNOT_GET_SELECTION: return "Cannot get selection"; //$NON-NLS-1$ | |
3617 case ERROR_CANNOT_GET_ITEM_HEIGHT: return "Cannot get item height"; //$NON-NLS-1$ | |
3618 case ERROR_CANNOT_GET_TEXT: return "Cannot get text"; //$NON-NLS-1$ | |
3619 case ERROR_CANNOT_SET_TEXT: return "Cannot set text"; //$NON-NLS-1$ | |
3620 case ERROR_ITEM_NOT_ADDED: return "Item not added"; //$NON-NLS-1$ | |
3621 case ERROR_ITEM_NOT_REMOVED: return "Item not removed"; //$NON-NLS-1$ | |
3622 case ERROR_NOT_IMPLEMENTED: return "Not implemented"; //$NON-NLS-1$ | |
3623 case ERROR_MENU_NOT_DROP_DOWN: return "Menu must be a drop down"; //$NON-NLS-1$ | |
3624 case ERROR_THREAD_INVALID_ACCESS: return "Invalid thread access"; //$NON-NLS-1$ | |
3625 case ERROR_WIDGET_DISPOSED: return "Widget is disposed"; //$NON-NLS-1$ | |
3626 case ERROR_MENUITEM_NOT_CASCADE: return "Menu item is not a CASCADE"; //$NON-NLS-1$ | |
3627 case ERROR_CANNOT_SET_SELECTION: return "Cannot set selection"; //$NON-NLS-1$ | |
3628 case ERROR_CANNOT_SET_MENU: return "Cannot set menu"; //$NON-NLS-1$ | |
3629 case ERROR_CANNOT_SET_ENABLED: return "Cannot set the enabled state"; //$NON-NLS-1$ | |
3630 case ERROR_CANNOT_GET_ENABLED: return "Cannot get the enabled state"; //$NON-NLS-1$ | |
3631 case ERROR_INVALID_PARENT: return "Widget has the wrong parent"; //$NON-NLS-1$ | |
3632 case ERROR_MENU_NOT_BAR: return "Menu is not a BAR"; //$NON-NLS-1$ | |
3633 case ERROR_CANNOT_GET_COUNT: return "Cannot get count"; //$NON-NLS-1$ | |
3634 case ERROR_MENU_NOT_POP_UP: return "Menu is not a POP_UP"; //$NON-NLS-1$ | |
3635 case ERROR_UNSUPPORTED_DEPTH: return "Unsupported color depth"; //$NON-NLS-1$ | |
3636 case ERROR_IO: return "i/o error"; //$NON-NLS-1$ | |
3637 case ERROR_INVALID_IMAGE: return "Invalid image"; //$NON-NLS-1$ | |
3638 case ERROR_UNSUPPORTED_FORMAT: return "Unsupported or unrecognized format"; //$NON-NLS-1$ | |
3639 case ERROR_INVALID_SUBCLASS: return "Subclassing not allowed"; //$NON-NLS-1$ | |
3640 case ERROR_GRAPHIC_DISPOSED: return "Graphic is disposed"; //$NON-NLS-1$ | |
3641 case ERROR_DEVICE_DISPOSED: return "Device is disposed"; //$NON-NLS-1$ | |
3642 case ERROR_FAILED_EXEC: return "Failed to execute runnable"; //$NON-NLS-1$ | |
3643 case ERROR_FAILED_LOAD_LIBRARY: return "Unable to load library"; //$NON-NLS-1$ | |
3644 case ERROR_CANNOT_INVERT_MATRIX: return "Cannot invert matrix"; //$NON-NLS-1$ | |
3645 case ERROR_NO_GRAPHICS_LIBRARY: return "Unable to load graphics library"; //$NON-NLS-1$ | |
3646 case ERROR_INVALID_FONT: return "Font not valid"; //$NON-NLS-1$ | |
3647 default: | |
3648 } | |
3649 return "Unknown error"; //$NON-NLS-1$ | |
3650 } | |
3651 | |
3652 /** | |
3653 * Returns the NLS'ed message for the given argument. | |
3654 * | |
3655 * @param key the key to look up | |
3656 * @return the message for the given key | |
3657 * | |
3658 * @exception IllegalArgumentException <ul> | |
3659 * <li>ERROR_NULL_ARGUMENT - if the key is null</li> | |
3660 * </ul> | |
3661 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
196
diff
changeset
|
3662 public static String getMessage(String key) { |
4
bf9fe45b4422
C, Platform, Point, Rectangle
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
3663 //return Compatibility.getMessage(key); |
bf9fe45b4422
C, Platform, Point, Rectangle
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
3664 return ""; |
0 | 3665 } |
3666 | |
3667 /** | |
3668 * Returns the DWT platform name. | |
3669 * Examples: "win32", "motif", "gtk", "photon", "carbon" | |
3670 * | |
3671 * @return the DWT platform name | |
3672 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
196
diff
changeset
|
3673 public static String getPlatform () { |
0 | 3674 return Platform.PLATFORM; |
3675 } | |
3676 | |
3677 /** | |
3678 * Returns the DWT version number as an integer. | |
3679 * Example: "SWT051" is 51 | |
3680 * | |
3681 * @return the DWT version number | |
3682 */ | |
3683 public static int getVersion () { | |
3684 return Library.SWT_VERSION; | |
3685 } | |
3686 | |
3687 /** | |
3688 * Throws an appropriate exception based on the passed in error code. | |
3689 * | |
3690 * @param code the DWT error code | |
3691 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
196
diff
changeset
|
3692 public static void error (String file, long line, int code) { |
98 | 3693 error (code, null); |
3694 } | |
0 | 3695 public static void error (int code) { |
3696 error (code, null); | |
3697 } | |
3698 | |
3699 /** | |
3700 * Throws an appropriate exception based on the passed in error code. | |
3701 * The <code>throwable</code> argument should be either null, or the | |
3702 * throwable which caused DWT to throw an exception. | |
3703 * <p> | |
3704 * In DWT, errors are reported by throwing one of three exceptions: | |
3705 * <dl> | |
3706 * <dd>java.lang.IllegalArgumentException</dd> | |
3707 * <dt>thrown whenever one of the API methods is invoked with an illegal argument</dt> | |
3708 * <dd>org.eclipse.swt.DWTException (extends java.lang.RuntimeException)</dd> | |
3709 * <dt>thrown whenever a recoverable error happens internally in DWT</dt> | |
3710 * <dd>org.eclipse.swt.DWTError (extends java.lang.Error)</dd> | |
3711 * <dt>thrown whenever a <b>non-recoverable</b> error happens internally in DWT</dt> | |
3712 * </dl> | |
3713 * This method provides the logic which maps between error codes | |
3714 * and one of the above exceptions. | |
3715 * </p> | |
3716 * | |
3717 * @param code the DWT error code. | |
3718 * @param throwable the exception which caused the error to occur. | |
3719 * | |
3720 * @see DWTError | |
3721 * @see DWTException | |
3722 * @see IllegalArgumentException | |
3723 */ | |
57
41dbc4d9faab
Update to tango trunk -r3152. Thanks DavidLeon for the adjustment of TracedException to Exception and creating the patch.
Frank Benoit <benoit@tionex.de>
parents:
4
diff
changeset
|
3724 public static void error (int code, Exception throwable) { |
0 | 3725 error (code, throwable, null); |
3726 } | |
3727 | |
3728 /** | |
3729 * Throws an appropriate exception based on the passed in error code. | |
3730 * The <code>throwable</code> argument should be either null, or the | |
3731 * throwable which caused DWT to throw an exception. | |
3732 * <p> | |
3733 * In DWT, errors are reported by throwing one of three exceptions: | |
3734 * <dl> | |
3735 * <dd>java.lang.IllegalArgumentException</dd> | |
3736 * <dt>thrown whenever one of the API methods is invoked with an illegal argument</dt> | |
3737 * <dd>org.eclipse.swt.DWTException (extends java.lang.RuntimeException)</dd> | |
3738 * <dt>thrown whenever a recoverable error happens internally in DWT</dt> | |
3739 * <dd>org.eclipse.swt.DWTError (extends java.lang.Error)</dd> | |
3740 * <dt>thrown whenever a <b>non-recoverable</b> error happens internally in DWT</dt> | |
3741 * </dl> | |
3742 * This method provides the logic which maps between error codes | |
3743 * and one of the above exceptions. | |
3744 * </p> | |
3745 * | |
3746 * @param code the DWT error code. | |
3747 * @param throwable the exception which caused the error to occur. | |
3748 * @param detail more information about error. | |
3749 * | |
3750 * @see DWTError | |
3751 * @see DWTException | |
3752 * @see IllegalArgumentException | |
3753 * | |
3754 * @since 3.0 | |
3755 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
196
diff
changeset
|
3756 public static void error (int code, Exception throwable, String detail) { |
0 | 3757 |
3758 /* | |
3759 * This code prevents the creation of "chains" of SWTErrors and | |
3760 * SWTExceptions which in turn contain other SWTErrors and | |
3761 * SWTExceptions as their throwable. This can occur when low level | |
3762 * code throws an exception past a point where a higher layer is | |
3763 * being "safe" and catching all exceptions. (Note that, this is | |
3764 * _a_bad_thing_ which we always try to avoid.) | |
3765 * | |
3766 * On the theory that the low level code is closest to the | |
3767 * original problem, we simply re-throw the original exception here. | |
3768 * | |
3769 * NOTE: Exceptions thrown in syncExec and asyncExec must be | |
3770 * wrapped. | |
3771 */ | |
3772 if (code !is DWT.ERROR_FAILED_EXEC) { | |
3773 if (auto t = cast(DWTError)throwable ) throw t; | |
3774 if (auto t = cast(DWTException)throwable ) throw t; | |
3775 } | |
3776 | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
196
diff
changeset
|
3777 String message = findErrorText (code); |
0 | 3778 if (detail != null) message ~= detail; |
3779 switch (code) { | |
3780 | |
3781 /* Illegal Arguments (non-fatal) */ | |
3782 case ERROR_NULL_ARGUMENT: | |
3783 case ERROR_CANNOT_BE_ZERO: | |
3784 case ERROR_INVALID_ARGUMENT: | |
3785 case ERROR_MENU_NOT_BAR: | |
3786 case ERROR_MENU_NOT_DROP_DOWN: | |
3787 case ERROR_MENU_NOT_POP_UP: | |
3788 case ERROR_MENUITEM_NOT_CASCADE: | |
3789 case ERROR_INVALID_PARENT: | |
3790 case ERROR_INVALID_RANGE: { | |
3791 throw new IllegalArgumentException (message); | |
3792 } | |
3793 | |
3794 /* DWT Exceptions (non-fatal) */ | |
3795 case ERROR_INVALID_SUBCLASS: | |
3796 case ERROR_THREAD_INVALID_ACCESS: | |
3797 case ERROR_WIDGET_DISPOSED: | |
3798 case ERROR_GRAPHIC_DISPOSED: | |
3799 case ERROR_DEVICE_DISPOSED: | |
3800 case ERROR_INVALID_IMAGE: | |
3801 case ERROR_UNSUPPORTED_DEPTH: | |
3802 case ERROR_UNSUPPORTED_FORMAT: | |
3803 case ERROR_FAILED_EXEC: | |
3804 case ERROR_CANNOT_INVERT_MATRIX: | |
3805 case ERROR_NO_GRAPHICS_LIBRARY: | |
3806 case ERROR_IO: { | |
3807 auto exception = new DWTException (code, message); | |
3808 exception.throwable = throwable; | |
3809 throw exception; | |
3810 } | |
3811 | |
3812 /* Operation System Errors (fatal, may occur only on some platforms) */ | |
3813 case ERROR_CANNOT_GET_COUNT: | |
3814 case ERROR_CANNOT_GET_ENABLED: | |
3815 case ERROR_CANNOT_GET_ITEM: | |
3816 case ERROR_CANNOT_GET_ITEM_HEIGHT: | |
3817 case ERROR_CANNOT_GET_SELECTION: | |
3818 case ERROR_CANNOT_GET_TEXT: | |
3819 case ERROR_CANNOT_SET_ENABLED: | |
3820 case ERROR_CANNOT_SET_MENU: | |
3821 case ERROR_CANNOT_SET_SELECTION: | |
3822 case ERROR_CANNOT_SET_TEXT: | |
3823 case ERROR_ITEM_NOT_ADDED: | |
3824 case ERROR_ITEM_NOT_REMOVED: | |
3825 case ERROR_NO_HANDLES: | |
3826 //FALL THROUGH | |
3827 | |
3828 /* DWT Errors (fatal, may occur only on some platforms) */ | |
3829 case ERROR_FAILED_LOAD_LIBRARY: | |
3830 case ERROR_NO_MORE_CALLBACKS: | |
3831 case ERROR_NOT_IMPLEMENTED: | |
3832 case ERROR_UNSPECIFIED: { | |
3833 auto error = new DWTError (code, message); | |
3834 error.throwable = throwable; | |
3835 throw error; | |
3836 } | |
3837 default: | |
3838 } | |
3839 | |
3840 /* Unknown/Undefined Error */ | |
3841 DWTError error = new DWTError (code, message); | |
3842 error.throwable = throwable; | |
3843 throw error; | |
3844 } | |
3845 | |
3846 } |