if (value > max) value = min; if (value < min) value = max; setSelection (value, true);
if ((style & SWT.WRAP) != 0) { if (newValue > max) newValue = min; if (newValue < min) newValue = max; } newValue = Math.min (Math.max (min, newValue), max); if (value != newValue) setSelection (newValue, true);
int actionProc (int theControl, int partCode) {	int value = getSelectionText ();    switch (partCode) {	    case OS.kControlUpButtonPart:			value += increment;	        break;	    case OS.kControlDownButtonPart:			value -= increment;	        break;	}	int max = OS.GetControl32BitMaximum (buttonHandle);	int min = OS.GetControl32BitMinimum (buttonHandle);	if (value > max) value = min;	if (value < min) value = max;	setSelection (value, true);	return 0;}