Changeset 172 for trunk/src/plugins


Ignore:
Timestamp:
Jul 31, 2009, 1:44:01 AM (16 years ago)
Author:
lpino
Message:
  • Fix initial display of the notebook
File:
1 edited

Legend:

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

    r170 r172  
    1212 * http://www.eclipse.org/legal/cpl-v10.html
    1313 */
    14  
     14
    1515import org.eclipse.swt.internal.*;
    1616import org.eclipse.swt.internal.pm.*;
     
    5050        static final PSZ TabFolderClass = PSZ.getAtom (OS.WC_NOTEBOOK);
    5151        static {
    52                
     52
    5353                /*
    5454                * Feature in Windows.  The tab control window class
     
    8787 * The style value is either one of the style constants defined in
    8888 * class <code>SWT</code> which is applicable to instances of this
    89  * class, or must be built by <em>bitwise OR</em>'ing together 
     89 * class, or must be built by <em>bitwise OR</em>'ing together
    9090 * (that is, using the <code>int</code> "|" operator) two or more
    9191 * of those <code>SWT</code> style constants. The class description
     
    244244        itemsID[index] = pageID;
    245245        items [index] = item;
    246        
     246
    247247        /*
    248248        * Send a selection event when the item that is added becomes
     
    314314            beginDeferWindowPos (parent, count);
    315315        }
    316        
     316
    317317        RECTL rect = new RECTL ();
    318        
     318
    319319        SWP swp = new SWP ();
    320320        OS.WinQueryWindowPos (handle, swp);
    321                
     321
    322322        rect.yBottom = rect.xLeft = 0;
    323323        rect.xRight = swp.cx;
     
    325325
    326326        OS.WinSendMsg(handle, OS.BKM_CALCPAGERECT, rect, true);
    327        
     327
    328328        int width = rect.xRight - rect.xLeft;
    329329        int height = rect.yTop - rect.yBottom;
    330330        int y = swp.cy-height;
    331        
     331
    332332//        System.out.println("XLEFT = " + rect.xLeft);
    333333//        System.out.println("YTOP = " + rect.yTop);
     
    380380/**
    381381 * Returns an array of <code>TabItem</code>s which are the items
    382  * in the receiver. 
     382 * in the receiver.
    383383 * <p>
    384384 * Note: This is not the actual structure used by the receiver
    385385 * to maintain its list of items, so modifying the array will
    386  * not affect the receiver. 
     386 * not affect the receiver.
    387387 * </p>
    388388 *
     
    409409 * Note: This is not the actual structure used by the receiver
    410410 * to maintain its selection, so modifying the array will
    411  * not affect the receiver. 
     411 * not affect the receiver.
    412412 * </p>
    413413 * @return an array representing the selection
     
    461461/**
    462462 * Searches the receiver's list starting at the first item
    463  * (index 0) until an item is found that is equal to the 
     463 * (index 0) until an item is found that is equal to the
    464464 * argument, and returns the index of that item. If no item
    465465 * is found, returns -1.
     
    491491                if (item != null) {
    492492                        char ch = findMnemonic (item.getText ());
    493                         if (Character.toUpperCase (key) == Character.toUpperCase (ch)) {               
     493                        if (Character.toUpperCase (key) == Character.toUpperCase (ch)) {
    494494                                if (setFocus ()) {
    495495                                        setSelection (i, true);
     
    507507                if (item != null) {
    508508                        char ch = findMnemonic (item.getText ());
    509                         if (Character.toUpperCase (key) == Character.toUpperCase (ch)) {               
     509                        if (Character.toUpperCase (key) == Character.toUpperCase (ch)) {
    510510                                return true;
    511511                        }
     
    554554        if (eventTable == null) return;
    555555        eventTable.unhook (SWT.Selection, listener);
    556         eventTable.unhook (SWT.DefaultSelection,listener);     
     556        eventTable.unhook (SWT.DefaultSelection,listener);
    557557}
    558558
     
    583583
    584584/**
    585  * Selects the item at the given zero-relative index in the receiver. 
     585 * Selects the item at the given zero-relative index in the receiver.
    586586 * If the item at the index was already selected, it remains selected.
    587587 * The current selected is first cleared, then the new items are
     
    675675
    676676int widgetStyle () {
    677         int bits = super.widgetStyle () | OS.WS_VISIBLE | OS.WS_CLIPCHILDREN | OS.BKS_TABBEDDIALOG | OS.BKS_MAJORTABTOP | OS.WS_CLIPSIBLINGS;   
     677        int bits = super.widgetStyle () | OS.WS_VISIBLE | OS.WS_CLIPCHILDREN | OS.BKS_TABBEDDIALOG | OS.BKS_MAJORTABTOP | OS.WS_CLIPSIBLINGS;
    678678        return bits;
    679679}
     
    744744//      * to display the tool tip.  The fix is to call the
    745745//      * default window proc that returns HTCLIENT when
    746 //      * the mouse is in the client area.     
     746//      * the mouse is in the client area.
    747747//      */
    748748//      int hittest = OS.DefWindowProc (handle, OS.WM_NCHITTEST, wParam, lParam);
     
    758758//      * Windows message by returning the result of the
    759759//      * WM_SIZE message.
    760 //      */
    761 //      if (isDisposed ()) return result;
    762 //      int index = OS.SendMessage (handle, OS.TCM_GETCURSEL, 0, 0);
    763 //      if (index != -1) {
    764 //              TabItem item = items [index];
    765 //              Control control = item.control;
    766 //              if (control != null && !control.isDisposed ()) {
    767 //                      control.setBounds (getClientArea ());
    768 //              }
    769 //      }
     760        //      */
     761        if (isDisposed ()) return result;
     762        int pageID = OS.WinSendMsg (handle, OS.BKM_QUERYPAGEID, 0, OS.MPFROM2SHORT((short)OS.BKA_TOP,(short)OS.BKA_MAJOR));
     763        int index = getTabIndex(pageID);
     764        if (index != -1) {
     765                TabItem item = items [index];
     766                Control control = item.control;
     767                if (control != null && !control.isDisposed ()) {
     768                        control.setBounds (getClientArea ());
     769                }
     770        }
    770771        return result;
    771772}
     
    818819        int code = mp1 >> 16;
    819820        switch (code) {
    820                 case OS.BKN_PAGESELECTED:                   
     821                case OS.BKN_PAGESELECTED:
    821822                case OS.BKN_PAGESELECTEDPENDING:
    822823                        TabItem item = null;
     
    842843//                System.out.println("resize");
    843844//                break;
    844          //     if (isDisposed ()) return result;
    845         //      int index = OS.SendMessage (handle, OS.TCM_GETCURSEL, 0, 0);
    846         //      if (index != -1) {
    847         //              TabItem item = items [index];
    848         //              Control control = item.control;
    849         //              if (control != null && !control.isDisposed ()) {
    850         //                      control.setBounds (getClientArea ());
    851         //              }
    852         //      }
    853845
    854846        }
Note: See TracChangeset for help on using the changeset viewer.