- Timestamp:
- Oct 23, 2009, 8:54:00 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
r155 r214 80 80 */ 81 81 public Scale (Composite parent, int style) { 82 // super (parent, checkStyle (style));83 82 this.parent = parent; 84 this.style = style;83 this.style = checkStyle (style); 85 84 maxRange = 100; 86 85 minRange = 0; … … 90 89 sldcData.usScale1Increments = 10; 91 90 sldcData.usScale1Spacing = 0; 91 // sldcData.usScale2Increments = 10; 92 // sldcData.usScale2Spacing = 0; 92 93 93 94 handle = OS.WinCreateWindow ( … … 107 108 OS.WinSetWindowUShort (handle, OS.QWS_ID, (short)(handle & 0xFFFF)); 108 109 OS.WinSendMsg(handle, OS.SLM_SETTICKSIZE, OS.MPFROM2SHORT((short)OS.SMA_SETALLTICKS, (short)6), 0); 109 110 // OS.WinSendMsg(handle, OS.SLM_SETSLIDERINFO, OS.MPFROM2SHORT((short)OS.SMA_SHAFTDIMENSIONS, (short)0), 3); 111 // OS.WinSendMsg(handle, OS.SLM_SETSLIDERINFO, OS.MPFROM2SHORT((short)OS.SMA_SLIDERARMDIMENSIONS, (short)0), 3); 110 112 super.register (); 111 113 super.subclass (); … … 160 162 int tick = OS.WinSendMsg(handle, OS.SLM_QUERYTICKSIZE, 1, 0); 161 163 if ((style & SWT.HORIZONTAL) != 0) { 162 width += OS. SHORT1FROMMP(shaftLength) +10;163 height += OS. SHORT2FROMMP(arm) + tick;164 width += OS.WinQuerySysValue (OS.HWND_DESKTOP, OS.SV_CXHSCROLLARROW ) * 10; 165 height += OS.WinQuerySysValue (OS.HWND_DESKTOP, OS.SV_CYHSCROLL) + tick + OS.SHORT2FROMMP(arm); 164 166 } else { 165 width += OS. SHORT2FROMMP(arm) + tick;166 height += OS. SHORT1FROMMP(shaftLength) +10;167 width += OS.WinQuerySysValue (OS.HWND_DESKTOP, OS.SV_CXVSCROLL) + tick + OS.SHORT2FROMMP(arm); 168 height += OS.WinQuerySysValue (OS.HWND_DESKTOP, OS.SV_CYVSCROLLARROW ) * 10; 167 169 } 168 170 if (wHint != SWT.DEFAULT) width = wHint + (border * 2); … … 179 181 } 180 182 181 / //**182 //* Returns the amount that the receiver's value will be183 //* modified by when the up/down (or right/left) arrows184 //* are pressed.185 //*186 //* @return the increment187 //*188 //* @exception SWTException <ul>189 //* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>190 //* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>191 //* </ul>192 //*/183 /** 184 * Returns the amount that the receiver's value will be 185 * modified by when the up/down (or right/left) arrows 186 * are pressed. 187 * 188 * @return the increment 189 * 190 * @exception SWTException <ul> 191 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 192 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 193 * </ul> 194 */ 193 195 public int getIncrement () { 194 196 checkWidget (); … … 196 198 } 197 199 198 / //**199 //* Returns the maximum value which the receiver will allow.200 //*201 //* @return the maximum202 //*203 //* @exception SWTException <ul>204 //* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>205 //* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>206 //* </ul>207 //*/200 /** 201 * Returns the maximum value which the receiver will allow. 202 * 203 * @return the maximum 204 * 205 * @exception SWTException <ul> 206 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 207 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 208 * </ul> 209 */ 208 210 public int getMaximum () { 209 211 checkWidget (); … … 394 396 395 397 int widgetStyle () { 396 int bits = super.widgetStyle () | OS.SLS_CENTER | OS.SLS_ HOMELEFT | OS.SLS_PRIMARYSCALE1;397 if ((style & SWT. VERTICAL) != 0) return bits | OS.SLS_VERTICAL | OS.SLS_HOMETOP;398 return bits ;398 int bits = super.widgetStyle () | OS.SLS_CENTER | OS.SLS_PRIMARYSCALE1 | OS.WS_TABSTOP;// | OS.SLS_PRIMARYSCALE2; 399 if ((style & SWT.HORIZONTAL) != 0) return bits | OS.SLS_HORIZONTAL | OS.SLS_HOMELEFT; 400 return bits | OS.SLS_VERTICAL | OS.SLS_HOMETOP; 399 401 } 400 402 … … 410 412 int code = OS.SHORT2FROMMP(mp1); 411 413 int pos = mp2; 412 if (code == OS.SLN_KILLFOCUS || code == OS.SLN_SETFOCUS) return null;414 // if (code == OS.SLN_KILLFOCUS || code == OS.SLN_SETFOCUS) return null; 413 415 Event event = new Event (); 414 416 switch (code) { … … 426 428 // case OS.TB_PAGEDOWN: event.detail = SWT.PAGE_DOWN; break; 427 429 // case OS.TB_PAGEUP: event.detail = SWT.PAGE_UP; break; 430 case OS.SLN_SETFOCUS: 431 case OS.SLN_KILLFOCUS: 432 sendEvent(code == OS.SLN_SETFOCUS ? SWT.FocusIn : SWT.FocusOut); 433 if(isDisposed()) return MRESULT.ZERO; 434 break; 428 435 } 429 436 sendEvent (SWT.Selection, event);
Note:
See TracChangeset
for help on using the changeset viewer.