Changeset 182 for trunk/src/plugins


Ignore:
Timestamp:
Aug 26, 2009, 7:32:40 PM (16 years ago)
Author:
lpino
Message:
  • Fix the mouse click inside groups
Location:
trunk/src/plugins/org.eclipse.swt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plugins/org.eclipse.swt/Eclipse SWT PI/pm/org/eclipse/swt/internal/pm/OS.java

    r178 r182  
    106106//    public static final int CS_MOVENOTIFY =     0x00000001;
    107107//    public static final int CS_SIZEREDRAW =     0x00000004;
    108 //    public static final int CS_HITTEST =        0x00000008;
     108    public static final int CS_HITTEST =        0x00000008;
    109109//    public static final int CS_PUBLIC =         0x00000010;
    110110//    public static final int CS_FRAME =          0x00000020;
     
    21862186   public static final int SDA_SLIDERARM            = 0x0004;
    21872187   
     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
    21882194
    21892195/* PM macros */
  • trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/Control.java

    r181 r182  
    472472
    473473//@@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//);
    481481
    482482//@@TODO(dmik): DBCS handling?
     
    17821782    int keyState = mp2 >> 16;
    17831783    //@@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));
    17861786//    if (OS.GetKeyState (OS.VK_MENU) < 0) event.stateMask |= SWT.ALT;
    17871787    if ((keyState & OS.KC_SHIFT) != 0) event.stateMask |= SWT.SHIFT;
     
    29972997//        case OS.WM_MOUSEHOVER: result = WM_MOUSEHOVER (wParam, lParam); break;
    29982998//        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;
    30003000//        case OS.WM_MOUSEWHEEL: result = WM_MOUSEWHEEL (wParam, lParam); break;
    30013001//        case OS.WM_NCACTIVATE: result = WM_NCACTIVATE (wParam, lParam); break;
    30023002//        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;
    30043004//        case OS.WM_NOTIFY: result = WM_NOTIFY (wParam, lParam); break;
    30053005        case OS.WM_PAINT: result = WM_PAINT (mp1, mp2); break;
     
    33263326}
    33273327
    3328 //@@TODO (dmik): later
    33293328MRESULT WM_BUTTON1DBLCLK (int mp1, int mp2) {
    33303329      /*
     
    33733372          int hwnd2 = OS.WinQueryWindow(handle, OS.QW_PARENT);
    33743373          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));
    33763375              if (OS.WinQueryCapture (OS.HWND_DESKTOP) != handle){
    33773376                  OS.WinSetCapture (OS.HWND_DESKTOP, handle);
    33783377              }
    33793378              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");
    33813380              }
    33823381              OS.WinSetActiveWindow (OS.HWND_DESKTOP, handle);
     
    36153614//}
    36163615//
    3617 //LRESULT WM_MOUSEMOVE (int wParam, int lParam) {
     3616//MRESULT WM_MOUSEMOVE (int mp1, int mp2) {
    36183617//      if (!OS.IsWinCE) {
    36193618//              boolean hooksEnter = hooks (SWT.MouseEnter);
     
    36613660//      return null;
    36623661//}
    3663 //
    3664 //LRESULT WM_NCHITTEST (int wParam, int lParam) {
    3665 //      if (!isActive ()) return new LRESULT (OS.HTTRANSPARENT);
    3666 //      return null;
    3667 //}
    3668 //
     3662
     3663MRESULT WM_HITTEST (int mp1, int mp2) {
     3664      if (!isActive ()) return new MRESULT (OS.HT_TRANSPARENT );
     3665      return null;
     3666}
     3667
    36693668//LRESULT WM_NOTIFY (int wParam, int lParam) {
    36703669//      NMHDR hdr = new NMHDR ();
  • trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/Group.java

    r33 r182  
    206206public Rectangle getClientArea () {
    207207        checkWidget ();
     208        if (parent != null && parent.pswp != 0) {
     209            endDeferWindowPos (parent);
     210            int count = parent.getChildrenCount ();
     211            beginDeferWindowPos (parent, count);
     212        }
    208213//@@TODO (lpino): What to do about this?
    209214//      if (parent.hdwp != 0) {
     
    287292
    288293int 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;
    290295}
    291296
     
    320325//}
    321326
    322 //LRESULT WM_NCHITTEST (int wParam, int lParam) {
    323 //      LRESULT result = super.WM_NCHITTEST (wParam, lParam);
    324 //      if (result != null) return result;
     327MRESULT WM_HITTEST (int mp1, int mp2) {
     328        MRESULT result = super.WM_HITTEST (mp1, mp2);
     329        if (result != null) return result;
    325330//      /*
    326331//      * Feature in Windows.  The window proc for the group box
    327 //      * returns HTTRANSPARENT indicating that mouse messages
     332//      * returns HT_TRANSPARENT indicating that mouse messages
    328333//      * should not be delivered to the receiver and any children.
    329 //      * Normally, group boxes in Windows do not have children and
     334//      * Normally, group boxes in OS/2 do not have children and
    330335//      * this is the correct behavior for this case.  Because we
    331 //      * allow children, answer HTCLIENT to allow mouse messages
     336//      * allow children, answer HT_NORMAL to allow mouse messages
    332337//      * to be delivered to the children.
    333338//      */
    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}
     343MRESULT WM_MOUSEMOVE (int mp1, int mp2) {
     344    System.out.println("Group::WM_MOUSEMOVE");
     345    return null;
     346}
     347}
Note: See TracChangeset for help on using the changeset viewer.