Changeset 320:da968414c383 for dwt/widgets/ProgressBar.d
- Timestamp:
- 11/03/08 15:58:40 (2 months ago)
- Files:
-
- dwt/widgets/ProgressBar.d (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dwt/widgets/ProgressBar.d
r246 r320 341 341 /* 342 342 * Feature in Vista. When the progress bar is not in 343 * a normal state, PBM_SETPOS does not set the position. 343 * a normal state, PBM_SETPOS does not set the position 344 * of the bar when the selection is equal to the minimum. 344 345 * This is undocumented. The fix is to temporarily 345 346 * set the state to PBST_NORMAL, set the position, then … … 347 348 */ 348 349 int /*long*/ state = 0; 350 bool fixSelection = false; 349 351 if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) { 350 state = OS.SendMessage (handle, OS.PBM_GETSTATE, 0, 0); 351 OS.SendMessage (handle, OS.PBM_SETSTATE, OS.PBST_NORMAL, 0); 352 int /*long*/ minumum = OS.SendMessage (handle, OS.PBM_GETRANGE, 1, 0); 353 int /*long*/ selection = OS.SendMessage (handle, OS.PBM_GETPOS, 0, 0); 354 if (selection is minumum) { 355 fixSelection = true; 356 state = OS.SendMessage (handle, OS.PBM_GETSTATE, 0, 0); 357 OS.SendMessage (handle, OS.PBM_SETSTATE, OS.PBST_NORMAL, 0); 358 } 352 359 } 353 360 OS.SendMessage (handle, OS.PBM_SETPOS, value, 0); 354 361 if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) { 355 OS.SendMessage (handle, OS.PBM_SETSTATE, state, 0);362 if (fixSelection) OS.SendMessage (handle, OS.PBM_SETSTATE, state, 0); 356 363 } 357 364 }
