Changeset 154 for trunk/src/plugins
- Timestamp:
- Jun 16, 2009, 11:33:49 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/Scale.java
r153 r154 152 152 } 153 153 154 //public Point computeSize (int wHint, int hHint, boolean changed) {155 //checkWidget ();156 //int border = getBorderWidth ();157 //int width = border * 2, height = border * 2;154 public Point computeSize (int wHint, int hHint, boolean changed) { 155 checkWidget (); 156 int border = getBorderWidth (); 157 int width = border * 2, height = border * 2; 158 158 // RECT rect = new RECT (); 159 159 // OS.SendMessage (handle, OS.TBM_GETTHUMBRECT, 0, rect); 160 OS.WinSendMsg(handle, OS.SLM_QUERYSLIDERINFO, OS.MPFROM2SHORT((short)OS.SMA_SHAFTDIMENSIONS, (short)OS.SMA_RANGEVALUE), 0); 161 OS.WinSendMsg(handle, OS.SLM_QUERYSLIDERINFO, OS.MPFROM2SHORT((short)OS.SMA_SLIDERARMDIMENSIONS, (short)OS.SMA_RANGEVALUE), 0); 162 OS.WinSendMsg(handle, OS.SLM_QUERYTICKSIZE, 1, 0); 160 163 // if ((style & SWT.HORIZONTAL) != 0) { 161 164 // width += OS.GetSystemMetrics (OS.SM_CXHSCROLL) * 10; … … 169 172 // if (wHint != SWT.DEFAULT) width = wHint + (border * 2); 170 173 // if (hHint != SWT.DEFAULT) height = hHint + (border * 2); 171 //return new Point (width, height);172 //}174 return new Point (width, height); 175 } 173 176 174 177 void createHandle () { … … 195 198 checkWidget (); 196 199 return 1; 197 // return OS.WinSendMsg(handle, OS.SLM_QUERYSLIDERINFO, OS.MPFROM2SHORT((short)OS.SMA_SLIDERARMPOSITION, (short)OS.SMA_INCREMENTVALUE), 0);198 200 // return OS.SendMessage (handle, OS.TBM_GETLINESIZE, 0, 0); 199 201 } … … 416 418 int code = OS.SHORT2FROMMP(mp1); 417 419 int pos = mp2; 418 System.out.println("Pos = " + pos);420 if (code == OS.SLN_KILLFOCUS || code == OS.SLN_SETFOCUS) return null; 419 421 Event event = new Event (); 420 //switch (code) {422 switch (code) { 421 423 // /* 422 424 // * This line is intentionally commented. Do not set the detail … … 425 427 // */ 426 428 //// case OS.TB_THUMBPOSITION: break; 427 // case OS.TB_THUMBTRACK: event.detail = SWT.DRAG; break;429 case OS.SLN_SLIDERTRACK: event.detail = SWT.DRAG; break; 428 430 // case OS.TB_TOP: event.detail = SWT.HOME; break; 429 431 // case OS.TB_BOTTOM: event.detail = SWT.END; break; … … 432 434 // case OS.TB_PAGEDOWN: event.detail = SWT.PAGE_DOWN; break; 433 435 // case OS.TB_PAGEUP: event.detail = SWT.PAGE_UP; break; 434 // } 436 } 437 sendEvent (SWT.Selection, event); 435 438 return null; 436 439 } 437 440 438 //MRESULT wmScrollChild (int mp1, int mp2) { 439 // 440 // /* Do nothing when scrolling is ending */ 441 //// int code = wParam & 0xFFFF; 442 //// if (code == OS.TB_ENDTRACK) return null; 443 // System.out.println("test"); 444 // /* 445 // * This code is intentionally commented. The event 446 // * detail field is not currently supported on all 447 // * platforms. 448 // */ 449 // Event event = new Event (); 450 // 451 // /* 452 // * Send the event because WM_HSCROLL and WM_VSCROLL 453 // * are sent from a modal message loop in windows that 454 // * is active when the user is scrolling. 455 // */ 456 // sendEvent (SWT.Selection, event); 457 // // widget could be disposed at this point 458 // return null; 459 //} 460 461 } 441 }
Note:
See TracChangeset
for help on using the changeset viewer.