Changeset 191 for trunk/src


Ignore:
Timestamp:
Sep 25, 2009, 3:25:38 PM (16 years ago)
Author:
lpino
Message:
  • Little changes
Location:
trunk/src/plugins/org.eclipse.swt
Files:
5 edited

Legend:

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

    r185 r191  
    150150    public static final int WS_CLIPCHILDREN =   0x20000000;
    151151    public static final int WS_CLIPSIBLINGS =   0x10000000;
    152 //    public static final int WS_PARENTCLIP =     0x08000000;
     152    public static final int WS_PARENTCLIP =     0x08000000;
    153153//    public static final int WS_SAVEBITS =       0x04000000;
    154154    public static final int WS_SYNCPAINT =      0x02000000;
  • trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/Composite.java

    r188 r191  
    308308        int count = getChildrenCount ();
    309309        if (count == 0) return;
    310 //@@TODO(dmik): remove   
    311 //      if (count > 1 && hdwp == 0) {
    312 //              hdwp = OS.BeginDeferWindowPos (count);
    313 //      }
    314310    if (count > 1 && pswp == 0) {
    315311        beginDeferWindowPos (this, count);
    316312        }
    317313        layout.layout (this, changed);
    318 //@@TODO(dmik): remove
    319 //      int oldHdwp = hdwp;
    320 //      hdwp = 0;
    321 //      if (oldHdwp != 0) OS.EndDeferWindowPos (oldHdwp);
    322314    if (pswp != 0) {
    323315        endDeferWindowPos (this);
     
    348340
    349341void releaseWidget () {
    350 //@@TODO (dmik): remove   
    351 //      int oldHdwp = hdwp;
    352 //      hdwp = 0;
    353 //      if (oldHdwp != 0) OS.EndDeferWindowPos (oldHdwp);
    354342    if (pswp != 0) {
    355343        endDeferWindowPos (this);
     
    505493int widgetStyle () {
    506494        /* Temporary code to force SWT.CLIP_SIBLINGS */
    507         return super.widgetStyle (); // | OS.WS_CLIPCHILDREN;
     495        return super.widgetStyle ();// | OS.WS_CLIPCHILDREN | OS.WS_CLIPSIBLINGS;
    508496}
    509497
     
    513501                if ((style & SWT.NO_REDRAW_RESIZE) == 0) {
    514502                        if (hooks (SWT.Paint)) {
    515                 OS.WinInvalidateRect (handle, null, false);
     503                            OS.WinInvalidateRect (handle, null, false);
    516504                        }
    517505                }
     
    523511//  And may be better to move this code to Decorations class...
    524512MRESULT WM_ERASEBACKGROUND (int mp1, int mp2) {
     513//@@TODO (lpino): Remove log
    525514//    System.out.println("Composite::WM_ERASEBACKGROUND -> HANDLE = " + Integer.toHexString(handle));
    526515    if ((state & CANVAS) != 0) {
    527         //@@TODO(lpino): This invalidation forces a whole window repaint to prevent clipping errors when window is partially obscure
    528         //it has a negative impact on performance. As my understanding improves maybe this problem can be solved
    529         OS.WinInvalidateRect(handle, null, true);
    530 //        OS.WinUpdateWindow(handle);
    531         return super.WM_ERASEBACKGROUND (mp1, mp2);
     516        return MRESULT.FALSE;
     517//        return super.WM_ERASEBACKGROUND (mp1, mp2);
    532518    }
    533519    RECTL rcl = new RECTL();
     
    633619                return super.WM_PAINT (mp1, mp2);
    634620    }
     621
    635622    /*
    636623        * This code is intentionally commented.  Don't exit
     
    643630//      if (!hooks (SWT.Paint)) return null;
    644631    /* lazily obtain a long-term cached micro presentation space */
    645 //    System.out.println("Composite::WM_PAINT -> HANDLE  =  " + Integer.toHexString(handle));
     632   
    646633    GCData data = new GCData ();
    647634    if (hps == 0) {
     
    650637        data.doInit = true;
    651638    }
     639
    652640//      /* Get the damage */
    653641        int [] rgnRects = null;
     
    671659        }
    672660
    673 //      /* Set the clipping bits */
     661        /* Set the clipping bits */
     662//@@TODO (lpino): Remove log
     663//    System.out.println("Composite::WM_PAINT -> HANDLE  =  " + Integer.toHexString(handle));
    674664    int oldBits = 0;
    675665    oldBits = OS.WinQueryWindowULong (handle, OS.QWL_STYLE);
     
    677667    OS.WinSetWindowULong (handle, OS.QWL_STYLE, newBits);
    678668
    679 //      /* Create the paint GC */
     669        /* Create the paint GC */
    680670    data.rcl = new RECTL ();
    681671    data.hps = hps;
     
    711701                rcl.xRight = rgnRects [(i << 2) + 2];
    712702                rcl.yTop = rgnRects [(i << 2) + 3];
    713 //     System.out.println("Control::drawBackground -> xLeft = " + rcl.xLeft);
    714 //     System.out.println("Control::drawBackground -> xRight = " + rcl.xRight);
    715 //     System.out.println("Control::drawBackground -> yBottom = " + rcl.yBottom);
    716 //     System.out.println("Control::drawBackground -> yTop = " + rcl.yTop);
    717703               drawBackground (0, rcl);
    718704                event.x = rcl.xLeft;
  • trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/Decorations.java

    r142 r191  
    9494public class Decorations extends Canvas {
    9595//@@TODO(dmik)   
    96 //      Image image;
     96        Image image;
    9797        Menu menuBar;
    9898        Menu [] menus;
     
    262262        checkWidget ();
    263263        RECTL rcl = new RECTL ();
    264     rcl.xLeft = x; rcl.yBottom = y;
    265      rcl.xRight = x + width; rcl.yTop = y + height;
     264        rcl.xLeft = x; rcl.yBottom = y;
     265        rcl.xRight = x + width; rcl.yTop = y + height;
    266266     
    267267     /* 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);
     268    if (horizontalBar != null) rcl.yTop += OS.WinQuerySysValue (OS.HWND_DESKTOP, OS.SV_CYHSCROLL);
     269    if (verticalBar != null) rcl.xRight += OS.WinQuerySysValue (OS.HWND_DESKTOP, OS.SV_CXVSCROLL);
    270270    /* Get the height of the menu bar */
    271271    //@@TEMP(lpino): I'm not sure if we need to calculate the height of the menu using SV_CYMENU'
    272272//      if (hasMenu) {
    273 //              RECT testRect = new RECT ();
    274 //              OS.SetRect (testRect, 0, 0, rect.right - rect.left, rect.bottom - rect.top);
     273//              RECTL testRect = new RECTL ();
     274//              OS.WinSetRect (testRect, 0, 0, rcl.xRight - rcl.xLeft, rcl.yTop - rcl.yBottom);
    275275//              OS.SendMessage (handle, OS.WM_NCCALCSIZE, 0, testRect);
    276276//              while ((testRect.bottom - testRect.top) < height) {
    277 //                      rect.top -= OS.GetSystemMetrics (OS.SM_CYMENU) - OS.GetSystemMetrics (OS.SM_CYBORDER);
     277//                      rect.top -= OS.WinQuerySysValue (handleFrame, OS.SV_CYMENU) - OS.WinQuerySysValue (handleFrame, OS.SV_CYBORDER);
    278278//                      OS.SetRect(testRect, 0, 0, rect.right - rect.left, rect.bottom - rect.top);
    279279//                      OS.SendMessage (handle, OS.WM_NCCALCSIZE, 0, testRect);
     
    396396    OS.WinSendMsg (frameHandle, OS.WM_UPDATEFRAME, fcdata.flCreateFlags, 0);
    397397    /*
    398      *  Create a cliend window.
     398     *  Create a client window.
    399399     */
    400400    handle = OS.WinCreateWindow (
     
    423423    if (parent == null) return;
    424424    setParent ();
    425 //    setSystemMenu ();
     425    setSystemMenu ();
    426426}
    427427
     
    10261026}
    10271027
    1028 //@@TODO (dmik): later
    10291028///**
    10301029// * Sets the receiver's menu bar to the argument, which
     
    12811280
    12821281int windowProc (int msg, int mp1, int mp2) {
    1283 //@@TODO (dmik): remove
    12841282    switch (msg) {
    1285 //@@TODO(dmik)
    12861283        case OS.WM_USER:
    12871284        case OS.WM_USER+1:
     
    15041501}
    15051502
     1503//MRESULT WM_ERASEBACKGROUND (int mp1, int mp2) {
     1504//    System.out.println("Decorations::WM_ERASEBACKGROUND -> HANDLE = " + Integer.toHexString(handle));
     1505//    if ((state & CANVAS) != 0) {
     1506//        return super.WM_ERASEBACKGROUND (mp1, mp2);
     1507//    }
     1508//    RECTL rcl = new RECTL();
     1509//    OS.objcpy (rcl, mp2);
     1510//    drawBackground (mp1, rcl);
     1511//    return MRESULT.FALSE;
     1512//}
     1513
    15061514MRESULT WM_SETFOCUS (int mp1, int mp2) {
    15071515    MRESULT result  = super.WM_SETFOCUS (mp1, mp2);
  • trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/Group.java

    r186 r191  
    294294}
    295295
    296 //LRESULT WM_PRINTCLIENT (int wParam, int lParam) {
    297 //      LRESULT result = super.WM_PRINTCLIENT (wParam, lParam);
    298 //      if (result != null) return result;
    299 //      /*
    300 //      * Feature in Windows.  In version 6.00 of COMCTL32.DLL,
    301 //      * when WM_PRINTCLIENT is sent from a child BS_GROUP
    302 //      * control to a parent BS_GROUP, the parent BS_GROUP
    303 //      * clears the font from the HDC.  Normally, group boxes
    304 //      * in Windows do not have children so this behavior is
    305 //      * undefined.  When the parent of a BS_GROUP is not a
    306 //      * BS_GROUP, there is no problem.  The fix is to save
    307 //      * and restore the current font.
    308 //      */
    309 //      if (COMCTL32_MAJOR >= 6) {
    310 //              int hFont = OS.GetCurrentObject (wParam, OS.OBJ_FONT);
    311 //              int code = callWindowProc (OS.WM_PRINTCLIENT, wParam, lParam);
    312 //              OS.SelectObject (wParam, hFont);
    313 //              return new LRESULT (code);
    314 //      }
    315 //      return result;
     296//MRESULT WM_ERASEBACKGROUND (int mp1, int mp2) {
     297//    System.out.println("Group::WM_ERASEBACKGROUND -> HANDLE = " + Integer.toHexString(handle));
     298////    if ((state & CANVAS) != 0) {
     299////        //@@TODO(lpino): This invalidation forces a whole window repaint to prevent clipping errors when window is partially obscure
     300////        //it has a negative impact on performance. As my understanding improves maybe this problem can be solved
     301//////        OS.WinInvalidateRect(handle, null, true);
     302//////        OS.WinUpdateWindow(handle);
     303//////        OS.WinFillRect(mp1, mp2, getBackgroundPixel ());
     304////        return MRESULT.TRUE;
     305//////        return super.WM_ERASEBACKGROUND (mp1, mp2);
     306////    }
     307////    RECTL rcl = new RECTL();
     308////    OS.objcpy (rcl, mp2);
     309////    drawBackground (mp1, rcl);
     310//    return MRESULT.TRUE;
    316311//}
    317312
     
    332327        return new MRESULT (code);
    333328}
    334 
    335 }
     329//MRESULT WM_PAINT (int mp1, int mp2) {
     330//    System.out.println("Group::WM_PAINT -> HANDLE  =  " + Integer.toHexString(handle));
     331//    GCData data = new GCData ();
     332//    if (hps == 0) {
     333//        hps = internal_new_GC (data);
     334//        if (hps == 0) SWT.error(SWT.ERROR_NO_HANDLES);
     335//        data.doInit = true;
     336//    }
     337//   
     338//    /* Create the paint GC */
     339//    data.rcl = new RECTL ();
     340//    data.hps = hps;
     341//
     342//    drawBackground(hps);
     343//    /* Dispose the paint GC */
     344//    System.out.println("Group::WM_PAINT -> HPS = " + Integer.toHexString(hps));
     345//    callWindowProc(OS.WM_PAINT, mp1, mp2);
     346//    return MRESULT.ZERO;
     347//}
     348}
  • trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/TabItem.java

    r170 r191  
    206206        this.control = control;
    207207        int index = parent.indexOf (this);
    208         OS.WinSendMsg (parent.handle, OS.BKM_SETPAGEWINDOWHWND, this.parent.itemsID[index], control.handle);       
     208        OS.WinSendMsg (parent.handle, OS.BKM_SETPAGEWINDOWHWND, this.parent.itemsID[index], control.handle);
    209209        if (index != parent.getSelectionIndex ()) {
    210210                if (newControl != null) newControl.setVisible (false);
Note: See TracChangeset for help on using the changeset viewer.