comparison os2/dw.c @ 1190:76262040ed5f

Added DW_PERCENT_INDETERMINATE which can be passed to dw_percent_set_pos() to show a rotating or otherwise indeterminate percent bar on supported platforms. Platforms which don't support it will either show no progress or potentially growing and contracting progress in the future if that doesn't look too weird. Committed from Windows so may be fixes coming for the other platforms soon.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 28 Sep 2011 08:22:48 +0000
parents 0f85796c6988
children 9b021f787ad1
comparison
equal deleted inserted replaced
1189:c5419ef79a77 1190:76262040ed5f
6723 * position: Position of the percent bar withing the range. 6723 * position: Position of the percent bar withing the range.
6724 */ 6724 */
6725 void API dw_percent_set_pos(HWND handle, unsigned int position) 6725 void API dw_percent_set_pos(HWND handle, unsigned int position)
6726 { 6726 {
6727 int range = _dw_percent_get_range(handle); 6727 int range = _dw_percent_get_range(handle);
6728 int mypos = ((float)position/100)*range; 6728
6729 6729 /* OS/2 doesn't really support indeterminate... */
6730 if(range) 6730 if(position == DW_PERCENT_INDETERMINATE)
6731 { 6731 {
6732 /* So set the position to 0 */
6733 WinSendMsg(handle, SLM_SETSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_RANGEVALUE), (MPARAM)0);
6734 }
6735 else if(range)
6736 {
6737 /* Otherwise set the position as usual */
6738 int mypos = ((float)position/100)*range;
6739
6732 _dw_int_set(handle, mypos); 6740 _dw_int_set(handle, mypos);
6733 WinSendMsg(handle, SLM_SETSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_RANGEVALUE), (MPARAM)mypos); 6741 WinSendMsg(handle, SLM_SETSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_RANGEVALUE), (MPARAM)mypos);
6734 } 6742 }
6735 } 6743 }
6736 6744