Changeset 169 for trunk/src


Ignore:
Timestamp:
Jul 14, 2009, 9:09:16 PM (16 years ago)
Author:
lpino
Message:
  • Fix display problems
Location:
trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets
Files:
2 edited

Legend:

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

    r165 r169  
    184184
    185185//      RECT insetRect = new RECT (), itemRect = new RECT ();
    186 //      OS.WinSendMsg (handle, OS.BKM_CALCPAGERECT, rcl, false);
    187186//      OS.SendMessage (handle, OS.TCM_ADJUSTRECT, 0, insetRect);
    188187//      int width = insetRect.left - insetRect.right, height = 0;
     
    192191//              width = Math.max (width, itemRect.right - insetRect.right);
    193192//      }
    194 //      Point size;
     193        Point size;
    195194//      if (layout != null) {
    196195//              size = layout.computeSize (this, wHint, hHint, changed);
     
    208207//      return new Point (width, height);
    209208//}
    210 //
     209
    211210//public Rectangle computeTrim (int x, int y, int width, int height) {
    212211//      checkWidget ();
     
    234233        }
    235234//        PSZ tabText = new PSZ("Hello");
    236          int pageID = OS.WinSendMsg (handle, OS.BKM_INSERTPAGE, 0, OS.MPFROM2SHORT((short)(OS.BKA_AUTOPAGESIZE | OS.BKA_MAJOR | OS.BKA_STATUSTEXTON),(short)OS.BKA_LAST));
     235         int pageID = OS.WinSendMsg (handle, OS.BKM_INSERTPAGE, 0, OS.MPFROM2SHORT((short)(OS.BKA_AUTOPAGESIZE | OS.BKA_MAJOR),(short)OS.BKA_LAST));
    237236         //@@INFO(lpino): All tabs are gray to keep a consistent look with the rests of the platforms
    238237         OS.WinSendMsg (handle, OS.BKM_SETTABCOLOR, pageID , 0x00C0C0C0);
     
    308307}
    309308
    310 //public Rectangle getClientArea () {
    311 //      checkWidget ();
     309public Rectangle getClientArea () {
     310        checkWidget ();
    312311//      if (parent.hdwp != 0) {
    313312//              int oldHdwp = parent.hdwp;
     
    317316//              parent.hdwp = OS.BeginDeferWindowPos (count);
    318317//      }
    319 //      RECT rect = new RECT ();
    320 //      OS.GetClientRect (handle, rect);
    321 //      OS.SendMessage (handle, OS.TCM_ADJUSTRECT, 0, rect);
    322 //      int width = rect.right - rect.left;
    323 //      int height = rect.bottom - rect.top;
    324 //      return new Rectangle (rect.left, rect.top, width, height);
    325 //}
     318        RECTL rect = new RECTL ();
     319       
     320        SWP swp = new SWP ();
     321        OS.WinQueryWindowPos (handle, swp);
     322       
     323        rect.yBottom = rect.xLeft = 0;
     324        rect.xRight = swp.cx;
     325        rect.yTop = swp.cy;
     326
     327        OS.WinSendMsg(handle, OS.BKM_CALCPAGERECT, rect, true);
     328       
     329        int width = rect.xRight - rect.xLeft;
     330        int height = rect.yTop - rect.yBottom;
     331//        System.out.println("XLEFT = " + rect.xLeft);
     332//        System.out.println("YTOP = " + rect.yTop);
     333//        System.out.println("XRIGHT = " + rect.xRight);
     334//        System.out.println("YBOTTOM = " + rect.yBottom);
     335//        System.out.println("width = " + width);
     336//        System.out.println("height = " + height);
     337//
     338        return new Rectangle (rect.xLeft, rect.yTop, width, height);
     339}
    326340
    327341/**
     
    692706                  (short)OS.BKA_MAJORTAB);
    693707
    694        OS.WinSendMsg(handle, OS.BKM_SETDIMENSIONS,
    695                  OS.MPFROM2SHORT((short)0, (short)0),
    696                  (short)OS.BKA_MINORTAB);
     708       OS.WinSendMsg(handle, OS.BKM_SETDIMENSIONS, OS.MPFROM2SHORT((short)0, (short)0),(short)OS.BKA_MINORTAB);
    697709  return true;
    698710}
     
    736748//}
    737749//
    738 //LRESULT WM_SIZE (int wParam, int lParam) {
    739 //      LRESULT result = super.WM_SIZE (wParam, lParam);
     750MRESULT WM_SIZE (int mp1, int mp2) {
     751        MRESULT result = super.WM_SIZE (mp1, mp2);
    740752//      /*
    741753//      * It is possible (but unlikely), that application
     
    754766//              }
    755767//      }
    756 //      return result;
    757 //}
    758 //
     768        return result;
     769}
     770
    759771//LRESULT WM_WINDOWPOSCHANGING (int wParam, int lParam) {
    760772//      LRESULT result = super.WM_WINDOWPOSCHANGING (wParam, lParam);
     
    804816        int code = mp1 >> 16;
    805817        switch (code) {
    806                 case OS.BKN_PAGESELECTED:
     818                case OS.BKN_PAGESELECTED:                   
     819//                    break;
    807820                case OS.BKN_PAGESELECTEDPENDING:
    808821                        TabItem item = null;
     
    824837                                postEvent (SWT.Selection, event);
    825838                        }
     839                        break;
    826840            case OS.BKN_NEWPAGESIZE:
     841//                System.out.println("resize");
     842                break;
    827843         //     if (isDisposed ()) return result;
    828844        //      int index = OS.SendMessage (handle, OS.TCM_GETCURSEL, 0, 0);
  • trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/TabItem.java

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