Go to the source code of this file.
|
void | OnKeyScroll (HWND hWnd, WPARAM wParam, LPARAM lParam, LPSCROLLSTATE state) |
|
void | OnMouseScroll (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LPSCROLLSTATE state) |
|
void | OnScroll (HWND hWnd, INT nBar, WPARAM wParam, INT iDelta, LPSCROLLSTATE state) |
|
void | UpdateLinesToScroll (LPSCROLLSTATE state) |
|
void | UpdateWindowScrollState (HWND hWnd, INT nMaxWidth, INT nMaxHeight, LPSCROLLSTATE lpState) |
|
◆ LPSCROLLSTATE
◆ SCROLLSTATE
◆ OnKeyScroll()
Definition at line 11 of file scrollutils.c.
12{
13
15 {
18 break;
19
22 break;
23
26 break;
27
30 break;
31
34 break;
35
38 break;
39
41 {
45 break;
46 }
47
49 {
53 break;
54 }
55
56 default:
57 break;
58 }
59}
SHORT WINAPI GetKeyState(_In_ int)
Referenced by MainWndProc().
◆ OnMouseScroll()
Definition at line 61 of file scrollutils.c.
62{
66 UINT uLinesToScroll =
state->uLinesToScroll;
67 INT zDelta = GET_WHEEL_DELTA_WPARAM(
wParam);
69
71
73 {
75 nPage =
state->nPageY;
76
77
78 zDelta +=
state->iWheelCarryoverY;
80 }
81 else
82 {
84 nPage =
state->nPageX;
85
86
87 zDelta +=
state->iWheelCarryoverX;
89 }
90
91
92
93
94
95
96
97
98
99
100
101 if (uLinesToScroll > nPage)
102 uLinesToScroll = nPage;
103
104 else if (uLinesToScroll == 0)
105 return;
106
107
108 if (zDelta > 0)
109 {
111 }
112 else
113 {
115 zDelta = -zDelta;
116 }
117
118
120
122}
Referenced by MainWndProc().
◆ OnScroll()
Definition at line 124 of file scrollutils.c.
125{
131
133
135 {
137 {
140 }
141 else
142 {
145 }
146 return;
147 }
148
150 {
151 pCurrent = &
state->CurrentX;
152 Maximum =
state->MaxX;
153 }
154 else
155 {
156 pCurrent = &
state->CurrentY;
157 Maximum =
state->MaxY;
158 }
159
164
166 {
169 {
171 break;
172 }
173
175 {
176 NewPos = si.
nPos - iDelta;
177 break;
178 }
179
181 {
182 NewPos = si.
nPos + iDelta;
183 break;
184 }
185
187 {
189 break;
190 }
191
193 {
195 break;
196 }
197
199 {
201 break;
202 }
203
205 {
207 break;
208 }
209
210 default:
211 {
213 break;
214 }
215 }
216
217 NewPos =
min(
max(NewPos, 0), Maximum);
218
219 if (si.
nPos == NewPos)
220 return;
221
222 OldX =
state->CurrentX;
223 OldY =
state->CurrentY;
224 *pCurrent = NewPos;
225
227 OldX -
state->CurrentX,
228 OldY -
state->CurrentY,
235
239}
CLIPBOARD_GLOBALS Globals
LRESULT SendClipboardOwnerMessage(IN BOOL bUnicode, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
#define WM_VSCROLLCLIPBOARD
#define WM_HSCROLLCLIPBOARD
BOOL WINAPI UpdateWindow(_In_ HWND)
int WINAPI SetScrollInfo(_In_ HWND, _In_ int, _In_ LPCSCROLLINFO, _In_ BOOL)
BOOL WINAPI GetScrollInfo(_In_ HWND, _In_ int, _Inout_ LPSCROLLINFO)
int WINAPI ScrollWindowEx(_In_ HWND, _In_ int, _In_ int, _In_opt_ LPCRECT, _In_opt_ LPCRECT, _In_opt_ HRGN, _Out_opt_ LPRECT, _In_ UINT)
Referenced by MainWndProc(), OnKeyScroll(), and OnMouseScroll().
◆ UpdateLinesToScroll()
Definition at line 241 of file scrollutils.c.
242{
244
246 {
247
248 state->uLinesToScroll = 3;
249 }
250 else
251 {
252 state->uLinesToScroll = uLinesToScroll;
253 }
254}
#define SystemParametersInfo
Referenced by MainWndProc().
◆ UpdateWindowScrollState()
Definition at line 256 of file scrollutils.c.
257{
260
263
267
277
283 si.
nMax = nMaxHeight;
287}
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SIF_DISABLENOSCROLL
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
Referenced by MainWndProc(), and SetDisplayFormat().