comparison dwt/widgets/ProgressBar.d @ 214:a8fed3e56433

Fix link error and added missing switch defaults
author Frank Benoit <benoit@tionex.de>
date Sat, 17 May 2008 19:23:59 +0200
parents 36f5cb12e1a2
children fd9c62a2998e
comparison
equal deleted inserted replaced
213:36f5cb12e1a2 214:a8fed3e56433
212 212
213 /** 213 /**
214 * Returns the state of the receiver. The value will be one of 214 * Returns the state of the receiver. The value will be one of
215 * <code>NORMAL</code>, <code>ERROR</code> or <code>PAUSED</code>. 215 * <code>NORMAL</code>, <code>ERROR</code> or <code>PAUSED</code>.
216 * 216 *
217 * @return the state 217 * @return the state
218 * 218 *
219 * @exception DWTException <ul> 219 * @exception DWTException <ul>
220 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 220 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
221 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 221 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
222 * </ul> 222 * </ul>
223 * 223 *
224 * @since 3.4 224 * @since 3.4
225 */ 225 */
226 public int getState () { 226 public int getState () {
227 checkWidget (); 227 checkWidget ();
228 if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) { 228 if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) {
229 int state = OS.SendMessage (handle, OS.PBM_GETSTATE, 0, 0); 229 int state = OS.SendMessage (handle, OS.PBM_GETSTATE, 0, 0);
230 switch (state) { 230 switch (state) {
231 case OS.PBST_NORMAL: return DWT.NORMAL; 231 case OS.PBST_NORMAL: return DWT.NORMAL;
232 case OS.PBST_ERROR: return DWT.ERROR; 232 case OS.PBST_ERROR: return DWT.ERROR;
233 case OS.PBST_PAUSED: return DWT.PAUSED; 233 case OS.PBST_PAUSED: return DWT.PAUSED;
234 default:
234 } 235 }
235 } 236 }
236 return DWT.NORMAL; 237 return DWT.NORMAL;
237 } 238 }
238 239
355 * 356 *
356 * @exception DWTException <ul> 357 * @exception DWTException <ul>
357 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> 358 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
358 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 359 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
359 * </ul> 360 * </ul>
360 * 361 *
361 * @since 3.4 362 * @since 3.4
362 */ 363 */
363 public void setState (int state) { 364 public void setState (int state) {
364 checkWidget (); 365 checkWidget ();
365 if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) { 366 if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) {
371 OS.SendMessage (handle, OS.PBM_SETSTATE, OS.PBST_ERROR, 0); 372 OS.SendMessage (handle, OS.PBM_SETSTATE, OS.PBST_ERROR, 0);
372 break; 373 break;
373 case DWT.PAUSED: 374 case DWT.PAUSED:
374 OS.SendMessage (handle, OS.PBM_SETSTATE, OS.PBST_PAUSED, 0); 375 OS.SendMessage (handle, OS.PBM_SETSTATE, OS.PBST_PAUSED, 0);
375 break; 376 break;
377 default:
376 } 378 }
377 } 379 }
378 } 380 }
379 381
380 override int widgetStyle () { 382 override int widgetStyle () {