javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Shell.java
equal
deleted
inserted
replaced
602 |
602 |
603 void register_pp () { |
603 void register_pp () { |
604 // Viewport & scroll area |
604 // Viewport & scroll area |
605 super.register_pp (); |
605 super.register_pp (); |
606 // Main window, if top-level |
606 // Main window, if top-level |
607 if(mainWindowHandle != 0) display.addWidget (mainWindowHandle, this); |
607 if(mainWindowHandle != 0) Display.addWidget (mainWindowHandle, this); |
608 // Dialog window, if a dialog Shell |
608 // Dialog window, if a dialog Shell |
609 if(dialogWindowHandle != 0) display.addWidget (dialogWindowHandle, this); |
609 if(dialogWindowHandle != 0) Display.addWidget (dialogWindowHandle, this); |
610 } |
610 } |
611 |
611 |
612 void releaseParent_pp () { |
612 void releaseParent_pp () { |
613 /* Do nothing */ |
613 /* Do nothing */ |
614 } |
614 } |
909 if (!restoreFocus ()) traverseGroup (true); |
909 if (!restoreFocus ()) traverseGroup (true); |
910 } |
910 } |
911 } |
911 } |
912 |
912 |
913 void enableWidget(boolean enabled) { |
913 void enableWidget(boolean enabled) { |
914 Control oldFocus = display._getFocusControl(); |
914 Control oldFocus = Display._getFocusControl(); |
915 super.enableWidget(enabled); |
915 super.enableWidget(enabled); |
916 if(!enabled) { |
916 if(!enabled) { |
917 // All children were looped through and disabled by QWidget unless they |
917 // All children were looped through and disabled by QWidget unless they |
918 // were explicitly disabled. SWT behavior is not to disable the dialog |
918 // were explicitly disabled. SWT behavior is not to disable the dialog |
919 // Shells so we have to restore their states. |
919 // Shells so we have to restore their states. |
967 checkWidget(); |
967 checkWidget(); |
968 |
968 |
969 int mask = SWT.PRIMARY_MODAL | SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL; |
969 int mask = SWT.PRIMARY_MODAL | SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL; |
970 if ((style & mask) != 0) { |
970 if ((style & mask) != 0) { |
971 if (visible) { |
971 if (visible) { |
972 display.setModalShell (this); |
972 Display.setModalShell (this); |
973 if ((style & (SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL)) != 0) { |
973 if ((style & (SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL)) != 0) { |
974 display.setModalDialog (null); |
974 Display.setModalDialog (null); |
975 } |
975 } |
976 Control control = display._getFocusControl(); |
976 Control control = Display._getFocusControl(); |
977 if (control != null && !control.isActive()) { |
977 if (control != null && !control.isActive()) { |
978 bringToTop(false); |
978 bringToTop(false); |
979 if (isDisposed()) return; |
979 if (isDisposed()) return; |
980 } |
980 } |
981 OS.QWidget_setWindowModality(topHandle, modalityFromStyle()); |
981 OS.QWidget_setWindowModality(topHandle, modalityFromStyle()); |
1027 } |
1027 } |
1028 |
1028 |
1029 void deregister_pp () { |
1029 void deregister_pp () { |
1030 super.deregister_pp (); |
1030 super.deregister_pp (); |
1031 if(mainWindowHandle != 0) { |
1031 if(mainWindowHandle != 0) { |
1032 display.removeWidget(mainWindowHandle); |
1032 Display.removeWidget(mainWindowHandle); |
1033 } |
1033 } |
1034 if(dialogWindowHandle != 0) { |
1034 if(dialogWindowHandle != 0) { |
1035 display.removeWidget(dialogWindowHandle); |
1035 Display.removeWidget(dialogWindowHandle); |
1036 } |
1036 } |
1037 } |
1037 } |
1038 |
1038 |
1039 /** |
1039 /** |
1040 * If the receiver is visible, moves it to the top of the |
1040 * If the receiver is visible, moves it to the top of the |