29 #include "../../idlib/precompiled.h"
36 SetWindowLong ( hWnd, GWL_USERDATA, (
long)(inc * 100.0
f) );
41 SendMessage ( hWnd, UDM_SETRANGE32, (
LONG)(minRange*100.0
f), (
LONG)(maxRange*100.0f) );
47 NM_UPDOWN* udhdr= (NM_UPDOWN*)hdr;
52 GetWindowText ( (HWND)SendMessage ( hdr->hwndFrom, UDM_GETBUDDY, 0, 0 ), strValue, 63 );
54 float inc = (
float)GetWindowLong ( hdr->hwndFrom, GWL_USERDATA );
58 SetWindowLong ( hdr->hwndFrom, GWL_USERDATA, 100 );
62 if ( GetAsyncKeyState ( VK_SHIFT ) & 0x8000 )
67 value = atof(strValue);
68 value += (udhdr->iDelta)*(inc);
71 value = floor(value*1e3+0.5)/1e3;
75 SendMessage ( hdr->hwndFrom, UDM_GETRANGE32, (
LONG)&minRange, (
LONG)&maxRange );
76 if ( minRange != 0 || maxRange != 0 )
78 float minRangef = (
float)(
long)minRange / 100.0f;
79 float maxRangef = (
float)maxRange / 100.0
f;
80 if ( value > maxRangef )
84 if ( value < minRangef )
90 SetWindowText ( (HWND)SendMessage ( hdr->hwndFrom, UDM_GETBUDDY, 0, 0 ),
va(
"%g",value) );
GLsizei const GLfloat * value
char * va(const char *fmt,...)