- Timestamp:
- Jul 31, 2009, 1:44:01 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/TabFolder.java
r170 r172 12 12 * http://www.eclipse.org/legal/cpl-v10.html 13 13 */ 14 14 15 15 import org.eclipse.swt.internal.*; 16 16 import org.eclipse.swt.internal.pm.*; … … 50 50 static final PSZ TabFolderClass = PSZ.getAtom (OS.WC_NOTEBOOK); 51 51 static { 52 52 53 53 /* 54 54 * Feature in Windows. The tab control window class … … 87 87 * The style value is either one of the style constants defined in 88 88 * 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 90 90 * (that is, using the <code>int</code> "|" operator) two or more 91 91 * of those <code>SWT</code> style constants. The class description … … 244 244 itemsID[index] = pageID; 245 245 items [index] = item; 246 246 247 247 /* 248 248 * Send a selection event when the item that is added becomes … … 314 314 beginDeferWindowPos (parent, count); 315 315 } 316 316 317 317 RECTL rect = new RECTL (); 318 318 319 319 SWP swp = new SWP (); 320 320 OS.WinQueryWindowPos (handle, swp); 321 321 322 322 rect.yBottom = rect.xLeft = 0; 323 323 rect.xRight = swp.cx; … … 325 325 326 326 OS.WinSendMsg(handle, OS.BKM_CALCPAGERECT, rect, true); 327 327 328 328 int width = rect.xRight - rect.xLeft; 329 329 int height = rect.yTop - rect.yBottom; 330 330 int y = swp.cy-height; 331 331 332 332 // System.out.println("XLEFT = " + rect.xLeft); 333 333 // System.out.println("YTOP = " + rect.yTop); … … 380 380 /** 381 381 * Returns an array of <code>TabItem</code>s which are the items 382 * in the receiver. 382 * in the receiver. 383 383 * <p> 384 384 * Note: This is not the actual structure used by the receiver 385 385 * to maintain its list of items, so modifying the array will 386 * not affect the receiver. 386 * not affect the receiver. 387 387 * </p> 388 388 * … … 409 409 * Note: This is not the actual structure used by the receiver 410 410 * to maintain its selection, so modifying the array will 411 * not affect the receiver. 411 * not affect the receiver. 412 412 * </p> 413 413 * @return an array representing the selection … … 461 461 /** 462 462 * 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 464 464 * argument, and returns the index of that item. If no item 465 465 * is found, returns -1. … … 491 491 if (item != null) { 492 492 char ch = findMnemonic (item.getText ()); 493 if (Character.toUpperCase (key) == Character.toUpperCase (ch)) { 493 if (Character.toUpperCase (key) == Character.toUpperCase (ch)) { 494 494 if (setFocus ()) { 495 495 setSelection (i, true); … … 507 507 if (item != null) { 508 508 char ch = findMnemonic (item.getText ()); 509 if (Character.toUpperCase (key) == Character.toUpperCase (ch)) { 509 if (Character.toUpperCase (key) == Character.toUpperCase (ch)) { 510 510 return true; 511 511 } … … 554 554 if (eventTable == null) return; 555 555 eventTable.unhook (SWT.Selection, listener); 556 eventTable.unhook (SWT.DefaultSelection,listener); 556 eventTable.unhook (SWT.DefaultSelection,listener); 557 557 } 558 558 … … 583 583 584 584 /** 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. 586 586 * If the item at the index was already selected, it remains selected. 587 587 * The current selected is first cleared, then the new items are … … 675 675 676 676 int 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; 678 678 return bits; 679 679 } … … 744 744 // * to display the tool tip. The fix is to call the 745 745 // * default window proc that returns HTCLIENT when 746 // * the mouse is in the client area. 746 // * the mouse is in the client area. 747 747 // */ 748 748 // int hittest = OS.DefWindowProc (handle, OS.WM_NCHITTEST, wParam, lParam); … … 758 758 // * Windows message by returning the result of the 759 759 // * 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 } 770 771 return result; 771 772 } … … 818 819 int code = mp1 >> 16; 819 820 switch (code) { 820 case OS.BKN_PAGESELECTED: 821 case OS.BKN_PAGESELECTED: 821 822 case OS.BKN_PAGESELECTEDPENDING: 822 823 TabItem item = null; … … 842 843 // System.out.println("resize"); 843 844 // 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 // }853 845 854 846 }
Note:
See TracChangeset
for help on using the changeset viewer.