Changeset 182
- Timestamp:
- Aug 26, 2009, 7:32:40 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plugins/org.eclipse.swt/Eclipse SWT PI/pm/org/eclipse/swt/internal/pm/OS.java
r178 r182 106 106 // public static final int CS_MOVENOTIFY = 0x00000001; 107 107 // public static final int CS_SIZEREDRAW = 0x00000004; 108 //public static final int CS_HITTEST = 0x00000008;108 public static final int CS_HITTEST = 0x00000008; 109 109 // public static final int CS_PUBLIC = 0x00000010; 110 110 // public static final int CS_FRAME = 0x00000020; … … 2186 2186 public static final int SDA_SLIDERARM = 0x0004; 2187 2187 2188 /*** WM_HITTEST return codes ********************************************/ 2189 public static final int HT_NORMAL = 0; 2190 public static final int HT_TRANSPARENT = -1; 2191 public static final int HT_DISCARD =-2; 2192 public static final int HT_ERROR =-3; 2193 2188 2194 2189 2195 /* PM macros */ -
trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/Control.java
r181 r182 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? … … 1782 1782 int keyState = mp2 >> 16; 1783 1783 //@@TODO(lpino): Remove debug 1784 System.out.println("Control::sendMouseEvent -> X= " + event.x + " Y= " + event.y);1785 System.out.println("Control::sendMouseEvent -> MP2= " + Integer.toHexString(keyState));1784 // System.out.println("Control::sendMouseEvent -> X= " + event.x + " Y= " + event.y); 1785 // System.out.println("Control::sendMouseEvent -> MP2= " + Integer.toHexString(keyState)); 1786 1786 // if (OS.GetKeyState (OS.VK_MENU) < 0) event.stateMask |= SWT.ALT; 1787 1787 if ((keyState & OS.KC_SHIFT) != 0) event.stateMask |= SWT.SHIFT; … … 2997 2997 // case OS.WM_MOUSEHOVER: result = WM_MOUSEHOVER (wParam, lParam); break; 2998 2998 // case OS.WM_MOUSELEAVE: result = WM_MOUSELEAVE (wParam, lParam); break; 2999 // case OS.WM_MOUSEMOVE: result = WM_MOUSEMOVE ( wParam, lParam); break;2999 // case OS.WM_MOUSEMOVE: result = WM_MOUSEMOVE (mp1, mp2); break; 3000 3000 // case OS.WM_MOUSEWHEEL: result = WM_MOUSEWHEEL (wParam, lParam); break; 3001 3001 // case OS.WM_NCACTIVATE: result = WM_NCACTIVATE (wParam, lParam); break; 3002 3002 // case OS.WM_NCCALCSIZE: result = WM_NCCALCSIZE (wParam, lParam); break; 3003 // case OS.WM_NCHITTEST: result = WM_NCHITTEST (wParam, lParam); break;3003 case OS.WM_HITTEST: result = WM_HITTEST (mp1, mp2); break; 3004 3004 // case OS.WM_NOTIFY: result = WM_NOTIFY (wParam, lParam); break; 3005 3005 case OS.WM_PAINT: result = WM_PAINT (mp1, mp2); break; … … 3326 3326 } 3327 3327 3328 //@@TODO (dmik): later3329 3328 MRESULT WM_BUTTON1DBLCLK (int mp1, int mp2) { 3330 3329 /* … … 3373 3372 int hwnd2 = OS.WinQueryWindow(handle, OS.QW_PARENT); 3374 3373 int hwnd3 = OS.WinQueryActiveWindow(OS.HWND_DESKTOP); 3375 System.out.println("Control::WM_BUTTON1DOWN -> Window = " + Integer.toHexString(handle) + " Window Activa = " + Integer.toHexString(hwnd) + " Padre = " + Integer.toHexString(hwnd2));3374 // System.out.println("Control::WM_BUTTON1DOWN -> Window = " + Integer.toHexString(handle) + " Window Activa = " + Integer.toHexString(hwnd) + " Padre = " + Integer.toHexString(hwnd2)); 3376 3375 if (OS.WinQueryCapture (OS.HWND_DESKTOP) != handle){ 3377 3376 OS.WinSetCapture (OS.HWND_DESKTOP, handle); 3378 3377 } 3379 3378 if(OS.WinQueryWindow(handle, OS.QW_PARENT) == OS.WinQueryActiveWindow(OS.HWND_DESKTOP)){ 3380 System.out.println("Control::WM_BUTTON1DOWN");3379 // System.out.println("Control::WM_BUTTON1DOWN"); 3381 3380 } 3382 3381 OS.WinSetActiveWindow (OS.HWND_DESKTOP, handle); … … 3615 3614 //} 3616 3615 // 3617 // LRESULT WM_MOUSEMOVE (int wParam, int lParam) {3616 //MRESULT WM_MOUSEMOVE (int mp1, int mp2) { 3618 3617 // if (!OS.IsWinCE) { 3619 3618 // boolean hooksEnter = hooks (SWT.MouseEnter); … … 3661 3660 // return null; 3662 3661 //} 3663 // 3664 //LRESULT WM_NCHITTEST (int wParam, int lParam) {3665 // if (!isActive ()) return new LRESULT (OS.HTTRANSPARENT);3666 //return null;3667 //}3668 // 3662 3663 MRESULT WM_HITTEST (int mp1, int mp2) { 3664 if (!isActive ()) return new MRESULT (OS.HT_TRANSPARENT ); 3665 return null; 3666 } 3667 3669 3668 //LRESULT WM_NOTIFY (int wParam, int lParam) { 3670 3669 // NMHDR hdr = new NMHDR (); -
trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/Group.java
r33 r182 206 206 public Rectangle getClientArea () { 207 207 checkWidget (); 208 if (parent != null && parent.pswp != 0) { 209 endDeferWindowPos (parent); 210 int count = parent.getChildrenCount (); 211 beginDeferWindowPos (parent, count); 212 } 208 213 //@@TODO (lpino): What to do about this? 209 214 // if (parent.hdwp != 0) { … … 287 292 288 293 int widgetStyle () { 289 return super.widgetStyle () | OS.SS_GROUPBOX ;// | OS.WS_CLIPCHILDREN | OS.WS_CLIPSIBLINGS;294 return super.widgetStyle () | OS.SS_GROUPBOX | OS.WS_TABSTOP;// | OS.WS_CLIPCHILDREN | OS.WS_CLIPSIBLINGS; 290 295 } 291 296 … … 320 325 //} 321 326 322 //LRESULT WM_NCHITTEST (int wParam, int lParam) {323 // LRESULT result = super.WM_NCHITTEST (wParam, lParam);324 //if (result != null) return result;327 MRESULT WM_HITTEST (int mp1, int mp2) { 328 MRESULT result = super.WM_HITTEST (mp1, mp2); 329 if (result != null) return result; 325 330 // /* 326 331 // * Feature in Windows. The window proc for the group box 327 // * returns HT TRANSPARENT indicating that mouse messages332 // * returns HT_TRANSPARENT indicating that mouse messages 328 333 // * should not be delivered to the receiver and any children. 329 // * Normally, group boxes in Windowsdo not have children and334 // * Normally, group boxes in OS/2 do not have children and 330 335 // * this is the correct behavior for this case. Because we 331 // * allow children, answer HT CLIENTto allow mouse messages336 // * allow children, answer HT_NORMAL to allow mouse messages 332 337 // * to be delivered to the children. 333 338 // */ 334 // int code = callWindowProc (OS.WM_NCHITTEST, wParam, lParam); 335 // if (code == OS.HTTRANSPARENT) code = OS.HTCLIENT; 336 // return new LRESULT (code); 337 //} 338 339 } 339 int code = callWindowProc (OS.WM_HITTEST, mp1, mp2); 340 if (code == OS.HT_TRANSPARENT) code = OS.HT_NORMAL; 341 return new MRESULT (code); 342 } 343 MRESULT WM_MOUSEMOVE (int mp1, int mp2) { 344 System.out.println("Group::WM_MOUSEMOVE"); 345 return null; 346 } 347 } -
trunk/tests/SWT/java/SWT009_07.java
r23 r182 32 32 void initComponents() { 33 33 shell.setText("Hello World Group"); 34 // shell.setSize(300, 300); 35 shell.setLayout(new FillLayout()); 36 shell.setText("Group Examples"); 37 Group group0 = new Group(shell, SWT.NULL); 38 group0.setLayout(new FillLayout()); 39 Label label = new Label(group0, SWT.NULL); 40 label.setAlignment(SWT.CENTER); 41 label.setText("a group without title."); 42 43 Group group1 = new Group(shell, SWT.NULL); 44 group1.setText("SWT.NULL"); 45 46 Group group2 = new Group(shell, SWT.SHADOW_ETCHED_IN); 47 group2.setText("SWT.SHADOW_ETCHED_IN"); 48 49 Group group3 = new Group(shell, SWT.SHADOW_ETCHED_OUT); 50 group3.setText("SWT.SHADOW_ETCHED_OUT"); 51 52 Group group4 = new Group(shell, SWT.SHADOW_IN); 53 group4.setText("SWT.SHADOW_IN"); 54 55 Group group5 = new Group(shell, SWT.SHADOW_OUT); 56 group5.setText("SWT.SHADOW_OUT"); 57 58 59 Group[] groups = new Group[]{group0, group1, group2, group3, group4, group5}; 60 61 for(int i=0; i<groups.length; i++) { 62 groups[i].setBounds(10, 10 + i * 50, 300, 40); 63 } 64 65 shell.pack(); 34 shell.setSize(200, 200); 35 shell.setText("A Group Example"); 36 final Group g = new Group(shell, SWT.SHADOW_ETCHED_IN); 37 g.setSize(110, 75); 38 g.setText("Options Group"); 39 final Button b1; 40 final Button b2; 41 final Button b3; 42 b1 = new Button(g, SWT.RADIO); 43 b1.setBounds(10, 20, 75, 15); 44 b1.setText("Option One"); 45 b2 = new Button(g, SWT.RADIO); 46 b2.setBounds(10, 35, 75, 15); 47 b2.setText("Option Two"); 48 b3 = new Button(g, SWT.RADIO); 49 b3.setBounds(10, 50, 80, 15); 50 b3.setText("Option Three"); 51 g.pack(); 52 g.setLocation(20, 20); 66 53 shell.open(); 67 54
Note:
See TracChangeset
for help on using the changeset viewer.