comctl32: Set updown control value to min or max in out of range case.
This commit is contained in:
parent
a8ebda9801
commit
e6fce2de4a
|
@ -150,11 +150,16 @@ static BOOL UPDOWN_OffsetVal(UPDOWN_INFO *infoPtr, int delta)
|
|||
(infoPtr->MaxVal < infoPtr->MinVal ? -1 : 1) *
|
||||
(infoPtr->MinVal - infoPtr->MaxVal) +
|
||||
(delta < 0 ? 1 : -1);
|
||||
} else return FALSE;
|
||||
} if ((infoPtr->MaxVal > infoPtr->MinVal && infoPtr->CurVal+delta > infoPtr->MaxVal)
|
||||
|| (infoPtr->MaxVal < infoPtr->MinVal && infoPtr->CurVal+delta < infoPtr->MaxVal)) {
|
||||
delta = infoPtr->MaxVal - infoPtr->CurVal;
|
||||
} else {
|
||||
delta = infoPtr->MinVal - infoPtr->CurVal;
|
||||
}
|
||||
}
|
||||
|
||||
infoPtr->CurVal += delta;
|
||||
return TRUE;
|
||||
return delta != 0;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
|
Loading…
Reference in New Issue