|
Lines 1312-1318
Link Here
|
| 1312 |
*/ |
1312 |
*/ |
| 1313 |
public boolean isReparentable () { |
1313 |
public boolean isReparentable () { |
| 1314 |
checkWidget(); |
1314 |
checkWidget(); |
| 1315 |
return false; |
1315 |
return true; |
| 1316 |
} |
1316 |
} |
| 1317 |
|
1317 |
|
| 1318 |
boolean isShowing () { |
1318 |
boolean isShowing () { |
|
Lines 2495-2504
Link Here
|
| 2495 |
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
2495 |
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
| 2496 |
* </ul> |
2496 |
* </ul> |
| 2497 |
*/ |
2497 |
*/ |
| 2498 |
public boolean setParent (Composite parent) { |
2498 |
public boolean setParent (Composite parent) { |
| 2499 |
checkWidget(); |
2499 |
checkWidget (); |
|
|
2500 |
if (parent == null) error (SWT.ERROR_NULL_ARGUMENT); |
| 2500 |
if (parent.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); |
2501 |
if (parent.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); |
| 2501 |
return false; |
2502 |
if (this.parent == parent) return true; |
|
|
2503 |
if (!isReparentable ()) return false; |
| 2504 |
releaseChild (); |
| 2505 |
Shell newShell = parent.getShell (), oldShell = getShell (); |
| 2506 |
Decorations newDecorations = parent.menuShell (), oldDecorations = menuShell (); |
| 2507 |
if (oldShell != newShell || oldDecorations != newDecorations) { |
| 2508 |
// Menu [] menus = oldShell.findMenus (this); |
| 2509 |
// fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus); |
| 2510 |
} |
| 2511 |
int topHandle = topHandle (); |
| 2512 |
// if (OS.SetParent (topHandle, parent.handle) == 0) return false; |
| 2513 |
OS.EmbedControl(topHandle, parent.topHandle ()); |
| 2514 |
this.parent = parent; |
| 2515 |
setVisible (topHandle, true); |
| 2516 |
// int flags = OS.SWP_NOSIZE | OS.SWP_NOMOVE | OS.SWP_NOACTIVATE; |
| 2517 |
// SetWindowPos (topHandle, OS.HWND_BOTTOM, 0, 0, 0, 0, flags); |
| 2518 |
return true; |
| 2502 |
} |
2519 |
} |
| 2503 |
|
2520 |
|
| 2504 |
/** |
2521 |
/** |