- Timestamp:
- Jun 24, 2008, 9:37:38 PM (17 years ago)
- Location:
- trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/Control.java
r105 r106 472 472 473 473 //@@TODO (dmik): debug code, remove when no more necessary 474 //System.out.println (475 //"Control.createHandle(): Window has been created:\n" +476 //" hwnd = " + Integer.toHexString (handle) + "\n" +477 //" hwnd.parent = hwnd.owner = " + Integer.toHexString (parent.handle) + "\n" +478 //" class = " + windowClass() + "\n" +479 //" style = " + Integer.toHexString (widgetStyle())480 //);474 System.out.println ( 475 "Control.createHandle(): Window has been created:\n" + 476 " hwnd = " + Integer.toHexString (handle) + "\n" + 477 " hwnd.parent = hwnd.owner = " + Integer.toHexString (parent.handle) + "\n" + 478 " class = " + windowClass() + "\n" + 479 " style = " + Integer.toHexString (widgetStyle()) 480 ); 481 481 482 482 //@@TODO(dmik): DBCS handling? … … 3104 3104 // if (mp2 != handle) return null; 3105 3105 // int parentHandle = OS.WinQueryWindow(menu.handle, OS.QW_PARENT); 3106 // System.out.println("Control:WM_CONTEXTMENU - PARENTHANDLE = " + Integer.toHexString(parentHandle)); 3107 // System.out.println("Control:WM_CONTEXTMENU - PARENTHANDLE = " + Integer.toHexString(handle)); 3106 System.out.println("Control:WM_CONTEXTMENU - PARENTHANDLE = " + Integer.toHexString(handle)); 3107 System.out.println("Control:WM_CONTEXTMENU - SHORT1FROMMP = " + OS.SHORT1FROMMP(mp1)); 3108 System.out.println("Control:WM_CONTEXTMENU - SHORT2FROMMP = " + OS.SHORT2FROMMP(mp1)); 3108 3109 short flOptions = OS.PU_HCONSTRAIN | OS.PU_VCONSTRAIN | OS.PU_KEYBOARD | OS.PU_MOUSEBUTTON1; 3109 boolean rc = OS.WinPopupMenu(handle, handle, menu.handle, 0, OS.SHORT1FROMMP(mp1), OS.SHORT2FROMMP(mp1), flOptions); 3110 // if (menu != null && !menu.isDisposed ()) { 3111 // menu.setVisible (true); 3112 // } 3110 boolean rc = OS.WinPopupMenu(handle, handle, menu.handle, 0, 150, OS.SHORT1FROMMP(mp1), flOptions); 3113 3111 return MRESULT.TRUE; 3114 3112 } … … 3867 3865 //} 3868 3866 // 3869 //LRESULT WM_SYSCOMMAND (int wParam, int lParam) {3867 MRESULT WM_SYSCOMMAND (int mp1, int mp2) { 3870 3868 // /* 3871 3869 // * Check to see if the command is a system command or … … 3884 3882 // 3885 3883 // /* Process the System Command */ 3886 // int cmd = wParam & 0xFFF0;3887 //switch (cmd) {3888 //case OS.SC_CLOSE:3889 //int hwndShell = menuShell ().handle;3890 // int bits = OS.GetWindowLong (hwndShell, OS.GWL_STYLE);3891 // if ((bits & OS.WS_SYSMENU) == 0) return LRESULT.ZERO;3892 //break;3884 int cmd = mp1 & 0xFFFF; 3885 switch (cmd) { 3886 case OS.SC_CLOSE: 3887 int hwndShell = menuShell ().handle; 3888 // int bits = OS.WinQueryWindowULong (frameHandle, OS.QWL_STYLE); 3889 // if ((bits & OS.WS_SYSMENU) == 0) return MRESULT.ZERO; 3890 break; 3893 3891 // case OS.SC_KEYMENU: 3894 3892 // if (hooks (SWT.KeyDown) || hooks (SWT.KeyUp)) { … … 3932 3930 // menuShell ().saveFocus (); 3933 3931 // break; 3934 //}3935 // return null;3936 //}3937 // 3932 } 3933 return MRESULT.ZERO; 3934 } 3935 3938 3936 //LRESULT WM_SYSKEYDOWN (int wParam, int lParam) { 3939 3937 // Display display = getDisplay (); -
trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/Decorations.java
r105 r106 261 261 public Rectangle computeTrim (int x, int y, int width, int height) { 262 262 checkWidget (); 263 264 //@@TEMP(dmik): in the future should take scroll bars into account (and menu)? 265 // /* Get the size of the trimmings */ 266 // RECT rect = new RECT (); 267 // OS.SetRect (rect, x, y, x + width, y + height); 268 // int bits = OS.GetWindowLong (handle, OS.GWL_STYLE); 269 // boolean hasMenu = OS.IsWinCE ? false : OS.GetMenu (handle) != 0; 270 // OS.AdjustWindowRectEx (rect, bits, hasMenu, OS.GetWindowLong (handle, OS.GWL_EXSTYLE)); 271 // 272 // /* Get the size of the scroll bars */ 273 // if (horizontalBar != null) rect.bottom += OS.GetSystemMetrics (OS.SM_CYHSCROLL); 274 // if (verticalBar != null) rect.right += OS.GetSystemMetrics (OS.SM_CXVSCROLL); 275 // 276 // /* Get the height of the menu bar */ 263 RECTL rcl = new RECTL (); 264 rcl.xLeft = x; rcl.yBottom = y; 265 rcl.xRight = x + width; rcl.yTop = y + height; 266 267 /* Get the size of the scroll bars */ 268 if (horizontalBar != null) rcl.xRight += OS.WinQuerySysValue (OS.HWND_DESKTOP, OS.SV_CXVSCROLL); 269 if (verticalBar != null) rcl.yTop += OS.WinQuerySysValue (OS.HWND_DESKTOP, OS.SV_CYHSCROLL); 270 /* Get the height of the menu bar */ 271 //@@TEMP(lpino): I'm not sure if we need to calculate the height of the menu using SV_CYMENU' 277 272 // if (hasMenu) { 278 273 // RECT testRect = new RECT (); … … 285 280 // } 286 281 // } 287 // return new Rectangle (rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top);288 RECTL rcl = new RECTL ();289 rcl.xLeft = x; rcl.yBottom = y;290 rcl.xRight = x + width; rcl.yTop = y + height;291 282 OS.WinCalcFrameRect (frameHandle, rcl, false); 292 return new Rectangle (rcl.xLeft, rcl.yBottom, 293 rcl.xRight - rcl.xLeft, rcl.yTop - rcl.yBottom); 283 return new Rectangle (rcl.xLeft, rcl.yBottom, rcl.xRight - rcl.xLeft, rcl.yTop - rcl.yBottom); 294 284 } 295 285 … … 423 413 state |= CANVAS; 424 414 //@@TODO (dmik): debug code, remove when no more necessary 425 //System.out.println (426 //"Decorations.createHandle(): FID_CLIENT window has been created:\n" +427 //" hwnd = " + Integer.toHexString (handle) + "\n" +428 //" hwnd.parent = hwnd.owner = " + Integer.toHexString (frameHandle) + "\n" +429 //" class = " + windowClass() + "\n" +430 //" style = " + Integer.toHexString (widgetStyle())431 //);415 System.out.println ( 416 "Decorations.createHandle(): FID_CLIENT window has been created:\n" + 417 " hwnd = " + Integer.toHexString (handle) + "\n" + 418 " hwnd.parent = hwnd.owner = " + Integer.toHexString (frameHandle) + "\n" + 419 " class = " + windowClass() + "\n" + 420 " style = " + Integer.toHexString (widgetStyle()) 421 ); 432 422 //@@TODO(dmik): do something for MDI windows if needed 433 423 // if (parent == null) return; … … 587 577 } 588 578 589 //@@TODO(dmik)590 / //**591 //* Returns the receiver's menu bar if one had previously592 //* been set, otherwise returns null.593 //*594 //* @return the menu bar or null595 //*596 //* @exception SWTException <ul>597 //* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>598 //* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>599 //* </ul>600 //*/579 580 /** 581 * Returns the receiver's menu bar if one had previously 582 * been set, otherwise returns null. 583 * 584 * @return the menu bar or null 585 * 586 * @exception SWTException <ul> 587 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 588 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 589 * </ul> 590 */ 601 591 public Menu getMenuBar () { 602 592 checkWidget (); … … 1108 1098 1109 1099 //@@TODO(dmik) 1110 //void setParent () { 1111 // /* 1112 // * In order for an MDI child window to support 1113 // * a menu bar, setParent () is needed to reset 1114 // * the parent. Otherwise, the MDI child window 1115 // * will appear as a separate shell. This is an 1116 // * undocumented and possibly dangerous Windows 1117 // * feature. 1118 // */ 1119 // Display display = getDisplay (); 1120 // int hwndParent = parent.handle; 1121 // display.lockActiveWindow = true; 1122 // OS.SetParent (handle, hwndParent); 1123 // if (!OS.IsWindowVisible (hwndParent)) { 1124 // OS.ShowWindow (handle, OS.SW_SHOWNA); 1125 // } 1126 // display.lockActiveWindow = false; 1127 //} 1100 void setParent () { 1101 Display display = getDisplay (); 1102 int hwndParent = parent.handle; 1103 display.lockActiveWindow = true; 1104 OS.WinSetParent (handle, hwndParent, false); 1105 if (!OS.WinIsWindowVisible (hwndParent)) { 1106 OS.WinShowWindow (handle, true); 1107 } 1108 display.lockActiveWindow = false; 1109 } 1128 1110 1129 1111 public void setRedraw (boolean redraw) { … … 1150 1132 } 1151 1133 1152 //@@TODO (dmik): later 1153 //void setSystemMenu () { 1134 //@@TODO (lpino): Understand and complete 1135 void setSystemMenu () { 1136 int hMenu = OS.WinWindowFromID(frameHandle, OS.FID_SYSMENU); 1137 if (hMenu == 0) return; 1138 int oldCount = OS.WinSendMsg(hMenu, OS.MM_QUERYITEMCOUNT, 0, 0); 1154 1139 // if (OS.IsWinCE) return; 1155 1140 // int hMenu = OS.GetSystemMenu (handle, false); … … 1188 1173 // } 1189 1174 // } 1190 //}1175 } 1191 1176 1192 1177 /** … … 1453 1438 sendEvent (SWT.Activate); 1454 1439 if (isDisposed ()) return MRESULT.ZERO; 1455 //@@TODO (dmik): remove1456 // if (restoreFocus ()) return MRESULT.ZERO;1457 1440 restoreFocus (); 1458 1441 } -
trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/Display.java
r89 r106 134 134 //@@TODO (dmik): not yet sure what do we need from these: 135 135 // boolean lastVirtual; 136 //boolean lockActiveWindow;136 boolean lockActiveWindow; 137 137 // int lastKey, lastAscii, lastMouse; 138 138 // byte [] keyboard = new byte [256]; -
trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/Menu.java
r105 r106 2 2 /* 3 3 * OS/2 version. 4 * Copyright (c) 2002, 200 7EclipseOS2 Team.4 * Copyright (c) 2002, 2008 EclipseOS2 Team. 5 5 */ 6 6 … … 242 242 //); 243 243 } else if ((style & SWT.POP_UP) != 0) { 244 handle = OS.WinCreateWindow ( parent.handle, /* parent window */244 handle = OS.WinCreateWindow (OS.HWND_DESKTOP, /* parent window */ 245 245 PSZ.getAtom (OS.WC_MENU), /* class name */ 246 246 null, /* window text */ 247 247 0, /* window style */ 248 248 0, 0, 0, 0, /* size and position */ 249 parent.handle, /* owner window */249 OS.HWND_DESKTOP, /* owner window */ 250 250 OS.HWND_TOP, /* sibling window */ 251 251 0, /* ID */ … … 298 298 info.afAttribute = 0; 299 299 info.id = (short)item.id; 300 System.out.println("Menu:createItem ID = " + info.id);301 300 info.hwndSubMenu = OS.NULLHANDLE; 302 301 info.hItem = 0; -
trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/TabFolder.java
r16 r106 3 3 /* 4 4 * OS/2 version. 5 * Copyright (c) 2002, 200 4EclipseOS2 Team.5 * Copyright (c) 2002, 2008 EclipseOS2 Team. 6 6 */ 7 7
Note:
See TracChangeset
for help on using the changeset viewer.