Changeset 173 for trunk/src


Ignore:
Timestamp:
Jul 31, 2009, 3:39:08 AM (16 years ago)
Author:
lpino
Message:
  • Minor update
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/Control.java

    r119 r173  
    471471    OS.WinSetWindowUShort (handle, OS.QWS_ID, (short)(handle & 0xFFFF));
    472472
    473 //@@TODO (dmik): debug code, remove when no more necessary 
     473//@@TODO (dmik): debug code, remove when no more necessary
    474474//System.out.println (
    475475//    "Control.createHandle(): Window has been created:\n" +
     
    519519    releaseHandle ();
    520520    if (hwnd != 0) {
    521 //@@TODO (dmik): debug code, remove when no more necessary 
     521//@@TODO (dmik): debug code, remove when no more necessary
    522522//System.out.println (
    523523//    "Control.destroyWidget(): Window is being derstroyed:\n    hwnd = " +
     
    612612    if (isFocusControl ()) return true;
    613613    shell.bringToTop ();
    614 //@@TODO (dmik): does it relate to OS/2?   
     614//@@TODO (dmik): does it relate to OS/2?
    615615//    /*
    616616//    * This code is intentionally commented.
     
    780780    String fontNameSize = len != 0 ? new PSZ (fontBytes).toString() : null;
    781781    Display display = getDisplay ();
    782     FATTRS hFont = display.matchFont (fontNameSize); 
     782    FATTRS hFont = display.matchFont (fontNameSize);
    783783    return Font.pm_new (display, hFont);
    784784}
     
    10391039            hwnd, OS.PP_FONTNAMESIZE, 0, null, fontBytes.length, fontBytes, 0);
    10401040        String fontNameSize = len >= 0 ? new PSZ (fontBytes).toString() : null;
    1041         data.hFont = display.matchFont (fontNameSize); 
     1041        data.hFont = display.matchFont (fontNameSize);
    10421042        data.hwnd = hwnd;
    10431043    }
     
    12081208    int bits = OS.WinQueryWindowULong (handle, OS.QWL_STYLE);
    12091209    if ((bits & OS.WS_TABSTOP) != 0) return false;
    1210    
     1210
    12111211    int code = OS.WinSendMsg (handle, OS.WM_QUERYDLGCODE, 0, 0);
    12121212    if ((code & OS.DLGC_STATIC) != 0) return false;
     
    14791479//    }
    14801480    toolTipText = null;
    1481 //@@TODO(dmik)
    1482 //    if (menu != null && !menu.isDisposed ()) {
    1483 //            menu.dispose ();
    1484 //    }
    1485 //    menu = null;
     1481
     1482    if (menu != null && !menu.isDisposed ()) {
     1483            menu.dispose ();
     1484    }
     1485    menu = null;
    14861486    deregister ();
    14871487    unsubclass ();
     
    17201720boolean sendKeyEvent (int type, int msg, int mp1, int mp2) {
    17211721    Event event = new Event ();
    1722    
     1722
    17231723    switch (msg) {
    17241724        case OS.WM_CHAR: {
     
    17261726            short usch = OS.SHORT1FROMMP (mp2);
    17271727            short usvk = OS.SHORT2FROMMP (mp2);
    1728            
     1728
    17291729            /* Ignore repeating modifier keys by testing key prev. down state */
    17301730            if (
     
    17361736                if ((fsflags & OS.KC_PREVDOWN) != 0) return true;
    17371737            }
    1738 //@@TODO (dmik): getting a character for DBCS charsets below will not work...           
    1739             /* Use the character encoding for the default locale */               
     1738//@@TODO (dmik): getting a character for DBCS charsets below will not work...
     1739            /* Use the character encoding for the default locale */
    17401740            event.character = new String (new byte[] {(byte) usch}).charAt (0);
    1741            
     1741
    17421742            if ((fsflags & OS.KC_VIRTUALKEY) != 0) {
    17431743                if (usvk == OS.VK_DELETE) {
    1744                     /* 
     1744                    /*
    17451745                     * A special case: map VK_DELETE to an ASCII char (127)
    17461746                     * instead of treating it as a virtual key.
     
    17491749                } else {
    17501750                    event.keyCode = Display.translateKey (usvk);
    1751                     /* 
     1751                    /*
    17521752                     * Feature in OS/2. The character for cursor move, edit
    17531753                     * and some other virtual keys actually equals to
     
    17661766
    17671767    if (!setInputState (event, type)) return true;
    1768    
     1768
    17691769    return sendKeyEvent (type, msg, mp1, mp2, event);
    17701770}
     
    20842084    String fontName = display.composeFontNameSize (display.systemFont());
    20852085    byte[] fontBytes = new PSZ (fontName).getBytes();
    2086     OS.WinSetPresParam (handle, OS.PP_FONTNAMESIZE, fontBytes.length, fontBytes); 
     2086    OS.WinSetPresParam (handle, OS.PP_FONTNAMESIZE, fontBytes.length, fontBytes);
    20872087}
    20882088
     
    21642164    String fontName = display.composeFontNameSize (hFont);
    21652165    byte[] fontBytes = new PSZ (fontName).getBytes();
    2166     OS.WinSetPresParam (handle, OS.PP_FONTNAMESIZE, fontBytes.length, fontBytes); 
     2166    OS.WinSetPresParam (handle, OS.PP_FONTNAMESIZE, fontBytes.length, fontBytes);
    21672167}
    21682168
     
    23532353    //  this won't be necessary when we will draw these types of buttons
    23542354    //  ourselves.
    2355     if (index == OS.PP_BACKGROUNDCOLORINDEX) 
     2355    if (index == OS.PP_BACKGROUNDCOLORINDEX)
    23562356        OS.WinSetPresParam (handle, OS.PP_BACKGROUNDCOLOR, 4,
    23572357            new int[] {OS.WinQuerySysColor (OS.HWND_DESKTOP, value [0], 0)});
    2358    
     2358
    23592359    index = index == OS.PP_BACKGROUNDCOLORINDEX ?
    23602360        OS.PP_DISABLEDBACKGROUNDCOLORINDEX : OS.PP_DISABLEDBACKGROUNDCOLOR;
     
    25862586//    POINT pt = new POINT ();
    25872587//    pt.x = point.x;  pt.y = point.y;
     2588//    WinMapWindowPoints
    25882589//    OS.ScreenToClient (handle, pt);
    25892590//    return new Point (pt.x, pt.y);
     
    26432644    if (shell.isVisible () && shell.isEnabled ()) {
    26442645        short usch = OS.SHORT1FROMMP (qmsg.mp2);
    2645         /* Use the character encoding for the default locale */               
     2646        /* Use the character encoding for the default locale */
    26462647        char ch = new String (new byte[] {(byte) usch}).charAt (0);
    26472648        return ch != 0 && shell.translateMnemonic (ch);
     
    26562657    int detail = SWT.TRAVERSE_NONE;
    26572658    boolean doit = true, all = false;
    2658     int keyCode = 0; 
     2659    int keyCode = 0;
    26592660    char character = 0;
    26602661    int code = OS.WinSendMsg (hwnd, OS.WM_QUERYDLGCODE, 0, 0);
     
    26842685            */
    26852686            character = '\t';
    2686             boolean next = (usvk == OS.VK_TAB) && ((fsflags & OS.KC_SHIFT) == 0); 
     2687            boolean next = (usvk == OS.VK_TAB) && ((fsflags & OS.KC_SHIFT) == 0);
    26872688            if ((code & OS.DLGC_MLE) != 0) {
    26882689                  if (next && (fsflags & OS.KC_CTRL) == 0)
     
    29462947        case OS.WM_CALCVALIDRECTS: result = WM_CALCVALIDRECTS (mp1, mp2); break;
    29472948        case OS.WM_CHAR: result = WM_CHAR (mp1, mp2); break;
    2948 //@@TODO (dmik): later       
     2949//@@TODO (dmik): later
    29492950//        case OS.WM_CLEAR: result = WM_CLEAR (wParam, lParam); break;
    29502951        case OS.WM_CLOSE: result = WM_CLOSE (mp1, mp2); break;
     
    29532954        case OS.WM_CONTEXTMENU: result = WM_CONTEXTMENU (mp1, mp2); break;
    29542955        case OS.WM_CONTROL: result = WM_CONTROL (mp1, mp2); break;
    2955 //@@TODO (dmik): later       
     2956//@@TODO (dmik): later
    29562957//        case OS.WM_CTLCOLORBTN:
    29572958//        case OS.WM_CTLCOLORDLG:
     
    30063007//        case OS.WM_SETCURSOR: result = WM_SETCURSOR (wParam, lParam); break;
    30073008        case OS.WM_SETFOCUS: result = WM_SETFOCUS (mp1, mp2); break;
    3008 //@@TODO (dmik): later       
     3009//@@TODO (dmik): later
    30093010//        case OS.WM_SETFONT: result = WM_SETFONT (wParam, lParam); break;
    30103011//        case OS.WM_SETTINGCHANGE: result = WM_SETTINGCHANGE (wParam, lParam); break;
     
    30123013//        case OS.WM_SHOWWINDOW: result = WM_SHOWWINDOW (wParam, lParam); break;
    30133014        case OS.WM_SIZE: result = WM_SIZE (mp1, mp2); break;
    3014 //@@TODO (dmik): later       
     3015//@@TODO (dmik): later
    30153016//        case OS.WM_SYSCHAR: result = WM_SYSCHAR (wParam, lParam); break;
    30163017//        case OS.WM_SYSCOLORCHANGE: result = WM_SYSCOLORCHANGE (wParam, lParam); break;
     
    30403041MRESULT WM_CHAR (int mp1, int mp2) {
    30413042    boolean keyUp = (OS.SHORT1FROMMP (mp1) & OS.KC_KEYUP) != 0;
    3042 //@@TODO (dmik): debug, remove   
     3043//@@TODO (dmik): debug, remove
    30433044//System.out.println("WM_CHAR ("+this+"): vk="+OS.SHORT2FROMMP (mp2)+" keyup="+keyUp);
    30443045    sendKeyEvent (keyUp ? SWT.KeyUp : SWT.KeyDown, OS.WM_CHAR, mp1, mp2);
     
    31013102      * have been destroyed but not removed from the control.
    31023103      */
    3103     //@@TODO(lpino) First check if this validation applies to OS/2 implementation and then validate using the coordinates of the mouse 
     3104    //@@TODO(lpino) First check if this validation applies to OS/2 implementation and then validate using the coordinates of the mouse
    31043105//      if (mp2 != handle) return null;
    31053106      short flOptions = OS.PU_HCONSTRAIN | OS.PU_VCONSTRAIN | OS.PU_KEYBOARD | OS.PU_MOUSEBUTTON1;
     
    31613162        if (item == null) return null;
    31623163        return item.wmDrawChild (mp1, mp2);
    3163     }   
     3164    }
    31643165//        System.out.println("Control:WM_DRAWITEM - HANDLE ATOM TABLE = " + Integer.toHexString(OS.WinFindAtom(OS.WinQuerySystemAtomTable(), PSZ.getAtom (OS.WC_MENU))));
    31653166      return null;
     
    36723673    int hrgn = OS.GpiCreateRegion (hps, 0, null);
    36733674    OS.WinQueryUpdateRegion (handle, hrgn);
    3674    
     3675
    36753676    callWindowProc (OS.WM_PAINT, mp1, mp2);
    36763677
     
    36903691    data.hps = hps;
    36913692    GC gc = GC.pm_new (this, data);
    3692    
     3693
    36933694    /* Send the paint event */
    36943695    Event event = new Event ();
     
    37833784    callWindowProc (OS.WM_SETFOCUS, mp1, mp2);
    37843785    Shell shell = getShell ();
    3785    
     3786
    37863787    boolean gotFocus = OS.SHORT1FROMMP (mp2) > 0;
    3787    
     3788
    37883789    /*
    37893790    * It is possible (but unlikely), that application
     
    37973798        sendEvent (SWT.FocusOut);
    37983799    // widget could be disposed at this point
    3799    
     3800
    38003801    /*
    38013802    * It is possible that the shell may be
     
    38153816        }
    38163817    }
    3817    
     3818
    38183819    return MRESULT.ZERO;
    38193820}
     
    40694070}
    40704071
    4071 //@@TODO (dmik): 
     4072//@@TODO (dmik):
    40724073//LRESULT wmMeasureChild (int wParam, int lParam) {
    40734074//      return null;
Note: See TracChangeset for help on using the changeset viewer.