Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 77174 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java (-2 / +26 lines)
Lines 729-734 Link Here
729
	return (state & PARENT_BACKGROUND) != 0 ? parent.findBackgroundControl () : null;
729
	return (state & PARENT_BACKGROUND) != 0 ? parent.findBackgroundControl () : null;
730
}
730
}
731
731
732
void fixChildren (Shell newShell, Shell oldShell) {
733
	oldShell.fixShell (newShell, this);
734
}
735
732
void fixFocus (Control focusControl) {
736
void fixFocus (Control focusControl) {
733
	Shell shell = getShell ();
737
	Shell shell = getShell ();
734
	Control control = this;
738
	Control control = this;
Lines 1544-1550 Link Here
1544
 */
1548
 */
1545
public boolean isReparentable () {
1549
public boolean isReparentable () {
1546
	checkWidget();
1550
	checkWidget();
1547
	return false;
1551
	return true;
1548
}
1552
}
1549
1553
1550
boolean isShowing () {
1554
boolean isShowing () {
Lines 3010-3017 Link Here
3010
 */
3014
 */
3011
public boolean setParent (Composite parent) {
3015
public boolean setParent (Composite parent) {
3012
	checkWidget();
3016
	checkWidget();
3017
	
3018
	if (parent == null) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
3013
	if (parent.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
3019
	if (parent.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
3014
	return false;
3020
	if (this.parent == parent) return true;
3021
	if (!isReparentable ()) return false;
3022
	
3023
	releaseParent ();
3024
	
3025
	Shell newShell = parent.getShell (), oldShell = this.parent.getShell ();
3026
	
3027
	if (oldShell != newShell)
3028
		fixChildren (newShell, oldShell);
3029
	
3030
	int topHandle = topHandle ();
3031
	
3032
	if (OS.EmbedControl(topHandle, parent.topHandle ()) < 0) return false;
3033
	
3034
	this.parent = parent;
3035
		
3036
	setVisible (topHandle, true);
3037
3038
	return true;
3015
}
3039
}
3016
3040
3017
/**
3041
/**
(-)Eclipse SWT/carbon/org/eclipse/swt/widgets/Composite.java (+8 lines)
Lines 298-303 Link Here
298
	return layoutCount > 0 ? this : parent.findDeferredControl ();
298
	return layoutCount > 0 ? this : parent.findDeferredControl ();
299
}
299
}
300
300
301
void fixChildren (Shell newShell, Shell oldShell) {
302
	super.fixChildren (newShell, oldShell);
303
	Control [] children = _getChildren ();
304
	for (int i=0; i<children.length; i++) {
305
		children [i].fixChildren (newShell, oldShell);
306
	}
307
}
308
301
void fixTabList (Control control) {
309
void fixTabList (Control control) {
302
	if (tabList == null) return;
310
	if (tabList == null) return;
303
	int count = 0;
311
	int count = 0;
(-)Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java (-1 / +7 lines)
Lines 10-16 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.swt.widgets;
11
package org.eclipse.swt.widgets;
12
12
13
14
import org.eclipse.swt.internal.carbon.OS;
13
import org.eclipse.swt.internal.carbon.OS;
15
import org.eclipse.swt.internal.carbon.Rect;
14
import org.eclipse.swt.internal.carbon.Rect;
16
import org.eclipse.swt.internal.carbon.CGPoint;
15
import org.eclipse.swt.internal.carbon.CGPoint;
Lines 626-631 Link Here
626
	return layoutCount > 0 ? this : null;
625
	return layoutCount > 0 ? this : null;
627
}
626
}
628
627
628
void fixShell (Shell newShell, Control control) {
629
	if (this == newShell) return;
630
	if (control == lastActive) setActiveControl (null);
631
	if (control == savedFocus) setSavedFocus(null);
632
	if (control == defaultButton) setDefaultButton(null);
633
}
634
629
Cursor findCursor () {
635
Cursor findCursor () {
630
	return cursor;
636
	return cursor;
631
}
637
}

Return to bug 77174