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