2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
14 * DEFINITIONS ________________________________________________________________
19 #define THIS_HINST (HINSTANCE)GetModuleHandle(NULL)
27 #define limit(_a,_x,_b) min( max( (_x), (_a) ), (_b) )
31 #define inlimit(_a,_x,_b) ( (((_x)>=(_a)) && ((_x)<=(_b))) ? TRUE : FALSE )
35 #define cxRECT(_r) ((_r).right - (_r).left)
39 #define cyRECT(_r) ((_r).bottom - (_r).top)
44 * PROTOTYPES _________________________________________________________________
48 EXPORTED BOOL RegisterSpinnerClass (void);
50 // NOTE: All messages are sent to the buddy control, and all notifications
51 // come back through WM_COMMAND:LOWORD(wp)==buddy,HIWORD(wp)=SPN_code,lp=param
53 #define SPM_GETRANGE (WM_USER+301)
54 #define SPM_SETRANGE (WM_USER+302)
55 #define SPM_GETPOS (WM_USER+303)
56 #define SPM_SETPOS (WM_USER+304)
57 #define SPM_GETBASE (WM_USER+305)
58 #define SPM_SETBASE (WM_USER+306)
59 #define SPM_REATTACH (WM_USER+307)
60 #define SPM_SETRECT (WM_USER+308)
61 #define SPM_GETSPINNER (WM_USER+309)
62 #define SPM_SETFORMAT (WM_USER+310)
63 #define SPM_SETBUDDY (WM_USER+311)
65 #define SPN_CHANGE_UP 0x1001 // DWORD *pdwValue = lp;
66 #define SPN_CHANGE_DOWN 0x1002 // DWORD *pdwValue = lp;
67 #define SPN_CHANGE 0x1003 // DWORD *pdwValue = lp;
68 #define SPN_UPDATE 0x1004 // DWORD dwNew = lp;
70 #define SPVAL_UNCHANGED (DWORD)0x7FFFFFFF
72 EXPORTED BOOL CreateSpinner (HWND hBuddy,
73 WORD wBase = 10, BOOL fSigned = FALSE,
74 DWORD dwMin = 0, DWORD dwPos = 100, DWORD dwMax = 100,
75 LPRECT prTarget = NULL);
77 EXPORTED BOOL fHasSpinner (HWND hBuddy);
80 * void SP_GetRange (HWND hBuddy, DWORD *pdwMin, DWORD *pdwMax)
81 * void SP_SetRange (HWND hBuddy, DWORD dwMin, DWORD dwMax)
84 #define SP_GetRange(_hb,_pdwMin,_pdwMax) \
85 SendMessage(_hb,SPM_GETRANGE,(WPARAM)_pdwMin,(LPARAM)_pdwMax)
86 #define SP_SetRange(_hb,_dwMin,_dwMax) \
87 SendMessage(_hb,SPM_SETRANGE,(WPARAM)_dwMin,(LPARAM)_dwMax)
90 * DWORD SP_GetPos (HWND hBuddy)
91 * void SP_SetPos (HWND hBuddy, DWORD dwPos)
94 #define SP_GetPos(_hb) \
95 SendMessage(_hb,SPM_GETPOS,(WPARAM)0,(LPARAM)0)
96 #define SP_SetPos(_hb,_dwPos) \
97 SendMessage(_hb,SPM_SETPOS,(WPARAM)0,(LPARAM)_dwPos)
100 * void SP_GetBase (HWND hBuddy, WORD *pwBase, BOOL *pfSigned)
101 * void SP_SetBase (HWND hBuddy, WORD wBase, BOOL fSigned)
104 #define SP_GetBase(_hb,_pdwBase,_pfSigned) \
105 SendMessage(_hb,SPM_GETBASE,(WPARAM)_pdwBase,(LPARAM)_pfSigned)
106 #define SP_SetBase(_hb,_wBase,_fSigned) \
107 SendMessage(_hb,SPM_SETBASE,(WPARAM)_wBase,(LPARAM)_fSigned)
110 * HWND SP_GetSpinner (HWND hBuddy)
113 #define SP_GetSpinner(_hb) \
114 (HWND)SendMessage(_hb,SPM_GETSPINNER,(WPARAM)0,(LPARAM)0)
117 * void SP_SetRect (HWND hBuddy, LPRECT prTarget)
120 #define SP_SetRect(_hb,_prTarget) \
121 SendMessage(_hb,SPM_SETRECT,(WPARAM)0,(LPARAM)_prTarget)
124 * void SP_SetFormat (HWND hBuddy, LPTSTR pszFormat)
125 * (where pszFormat uses "%lu" or "%ld" as appropriate)
128 #define SP_SetFormat(_hb,_pszFormat) \
129 SendMessage(_hb,SPM_SETFORMAT,(WPARAM)0,(LPARAM)_pszFormat)
132 * void SP_SetBuddy (HWND hOld, HWND hBuddyNew, BOOL fMove)
135 #define SP_SetBuddy(_hb,_hNew,_fMove) \
136 SendMessage(_hb,SPM_SETBUDDY,(WPARAM)_hNew,(LPARAM)_fMove)