equal
deleted
inserted
replaced
102 */ |
102 */ |
103 public class Shell extends Decorations |
103 public class Shell extends Decorations |
104 { |
104 { |
105 private int shellHandle; |
105 private int shellHandle; |
106 |
106 |
107 // Widgets registered with this Shell |
|
108 private Vector widgets = new Vector(); |
|
109 private Vector asyncPaintControls = new Vector(); |
107 private Vector asyncPaintControls = new Vector(); |
110 |
108 |
111 /** |
109 /** |
112 * Constructs a new instance of this class. This is equivalent |
110 * Constructs a new instance of this class. This is equivalent |
113 * to calling <code>Shell((Display) null)</code>. |
111 * to calling <code>Shell((Display) null)</code>. |
394 if (size.x < minSize.x) size.x = minSize.x; |
392 if (size.x < minSize.x) size.x = minSize.x; |
395 if (size.y < minSize.y) size.y = minSize.y; |
393 if (size.y < minSize.y) size.y = minSize.y; |
396 return size; |
394 return size; |
397 } |
395 } |
398 |
396 |
|
397 /** |
|
398 * <b>IMPORTANT:</b> This method is <em>not</em> part of the public |
|
399 * API for <code>Shell</code>. It is marked public only so that it |
|
400 * can be shared within the packages provided by SWT. It is not |
|
401 * available on all platforms, and should never be called from |
|
402 * application code. |
|
403 */ |
399 protected void internal_setShellHandle(int shellHandle) |
404 protected void internal_setShellHandle(int shellHandle) |
400 { |
405 { |
401 this.shellHandle = shellHandle; |
406 this.shellHandle = shellHandle; |
402 internal_setDecorationsHandle(OS.Shell_DecorationsHandle(shellHandle)); |
407 internal_setDecorationsHandle(OS.Shell_DecorationsHandle(shellHandle)); |
403 } |
408 } |
404 |
409 |
|
410 /** |
|
411 * <b>IMPORTANT:</b> This method is <em>not</em> part of the public |
|
412 * API for <code>Shell</code>. It is marked public only so that it |
|
413 * can be shared within the packages provided by SWT. It is not |
|
414 * available on all platforms, and should never be called from |
|
415 * application code. |
|
416 */ |
405 public void internal_checkShell() |
417 public void internal_checkShell() |
406 { |
418 { |
407 checkWidget(); |
419 checkWidget(); |
408 } |
420 } |
409 |
421 |
548 setActive(); |
560 setActive(); |
549 } |
561 } |
550 |
562 |
551 protected void internal_releaseResources() |
563 protected void internal_releaseResources() |
552 { |
564 { |
553 int size = widgets.size(); |
|
554 for (int i=0; i<size; ++i) |
|
555 { |
|
556 // release the registered widgets |
|
557 // that take this shell as parent |
|
558 Widget widget = (Widget)widgets.elementAt(i); |
|
559 widget.internal_release(); |
|
560 } |
|
561 widgets.removeAllElements(); |
|
562 asyncPaintControls.removeAllElements(); |
565 asyncPaintControls.removeAllElements(); |
563 super.internal_releaseResources(); |
566 super.internal_releaseResources(); |
564 } |
567 } |
565 |
568 |
566 /** |
569 /** |
678 { |
681 { |
679 checkWidget(); |
682 checkWidget(); |
680 OS.Shell_SetImeInputMode(shellHandle, mode); |
683 OS.Shell_SetImeInputMode(shellHandle, mode); |
681 } |
684 } |
682 |
685 |
|
686 /** |
|
687 * <b>IMPORTANT:</b> This method is <em>not</em> part of the public |
|
688 * API for <code>Shell</code>. It is marked public only so that it |
|
689 * can be shared within the packages provided by SWT. It is not |
|
690 * available on all platforms, and should never be called from |
|
691 * application code. |
|
692 */ |
683 public int internal_getShellHandle() |
693 public int internal_getShellHandle() |
684 { |
694 { |
685 return shellHandle; |
695 return shellHandle; |
686 } |
696 } |
687 |
697 |
688 public void internal_registerWidget(Widget widget) |
698 /** |
689 { |
699 * <b>IMPORTANT:</b> This method is <em>not</em> part of the public |
690 widgets.addElement(widget); |
700 * API for <code>Shell</code>. It is marked public only so that it |
691 } |
701 * can be shared within the packages provided by SWT. It is not |
692 |
702 * available on all platforms, and should never be called from |
693 public void internal_unregisterWidget(Widget widget) |
703 * application code. |
694 { |
704 */ |
695 widgets.removeElement(widget); |
|
696 } |
|
697 |
|
698 public Rectangle internal_getDefaultBounds() |
705 public Rectangle internal_getDefaultBounds() |
699 { |
706 { |
700 return OS.Shell_GetDefaultBounds(shellHandle); |
707 return OS.Shell_GetDefaultBounds(shellHandle); |
701 } |
708 } |
702 |
709 |
710 if ((state & DISPOSED) != 0) internal_error(SWT.ERROR_WIDGET_DISPOSED); |
717 if ((state & DISPOSED) != 0) internal_error(SWT.ERROR_WIDGET_DISPOSED); |
711 |
718 |
712 return OS.Control_GetVisible(this.display.handle, handle); |
719 return OS.Control_GetVisible(this.display.handle, handle); |
713 } |
720 } |
714 |
721 |
|
722 /** |
|
723 * <b>IMPORTANT:</b> This method is <em>not</em> part of the public |
|
724 * API for <code>Shell</code>. It is marked public only so that it |
|
725 * can be shared within the packages provided by SWT. It is not |
|
726 * available on all platforms, and should never be called from |
|
727 * application code. |
|
728 */ |
|
729 public void internal_setTaskTip() |
|
730 { |
|
731 OS.Shell_SetTaskTip(shellHandle); |
|
732 } |
|
733 |
715 void setAsyncPainting(Control child, boolean status) |
734 void setAsyncPainting(Control child, boolean status) |
716 { |
735 { |
717 if (status) |
736 if (status) |
718 { |
737 { |
719 if (!asyncPaintControls.contains(child)) |
738 if (!asyncPaintControls.contains(child)) |