Rev 7160 | Rev 7447 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7160 | Rev 7227 | ||
---|---|---|---|
Line 31... | Line 31... | ||
31 | int KeyPgDown(); |
31 | int KeyPgDown(); |
32 | int KeyPgUp(); |
32 | int KeyPgUp(); |
33 | int KeyLeft(); |
33 | int KeyLeft(); |
34 | int KeyRight(); |
34 | int KeyRight(); |
35 | void CheckDoesValuesOkey(); |
35 | void CheckDoesValuesOkey(); |
36 | //void debug(); |
36 | void debug(); |
37 | }; |
37 | }; |
Line 38... | Line -... | ||
38 | - | ||
39 | /* |
38 | |
40 | void llist::debug() |
39 | :void llist::debug() |
41 | { |
40 | { |
42 | char yi[128]; |
41 | char yi[128]; |
43 | sprintf(#yi, "%s %d %s %d %s %d %s %d %s %d %s %d", "first:", first, "visible:", visible, "count:", count, "col_max:", column_max, "cur_y:", cur_y, "cur_x:", cur_x); |
42 | sprintf(#yi, "%s %d %s %d %s %d %s %d %s %d %s %d", "first:", first, "visible:", visible, "count:", count, "col_max:", column_max, "cur_y:", cur_y, "cur_x:", cur_x); |
44 | debugln(#yi); |
43 | debugln(#yi); |
Line 45... | Line 44... | ||
45 | }*/ |
44 | } |
46 | 45 | ||
47 | 46 | ||
48 | void llist::ClearList() |
47 | :void llist::ClearList() |
Line 49... | Line 48... | ||
49 | { |
48 | { |
50 | count = visible = first = cur_y = cur_x = 0; |
49 | count = visible = first = cur_y = cur_x = 0; |
51 | } |
50 | } |
52 | 51 | ||
53 | 52 | ||
54 | void llist::SetSizes(int xx, yy, ww, hh, item_hh) |
53 | :void llist::SetSizes(int xx, yy, ww, hh, item_hh) |
Line 62... | Line 61... | ||
62 | visible = h / item_h; |
61 | visible = h / item_h; |
63 | wheel_size = 3; |
62 | wheel_size = 3; |
64 | CheckDoesValuesOkey(); |
63 | CheckDoesValuesOkey(); |
65 | } |
64 | } |
Line -... | Line 65... | ||
- | 65 | ||
66 | 66 | ||
67 | void llist::SetFont(dword font_ww, font_hh, font_tt) |
67 | :void llist::SetFont(dword font_ww, font_hh, font_tt) |
68 | { |
68 | { |
69 | font_w = font_ww; |
69 | font_w = font_ww; |
70 | font_h = font_hh; |
70 | font_h = font_hh; |
71 | font_type = font_tt; |
71 | font_type = font_tt; |
Line 72... | Line 72... | ||
72 | } |
72 | } |
73 | 73 | ||
74 | 74 | ||
75 | int llist::MouseScroll(dword scroll_state) |
75 | :int llist::MouseScroll(dword scroll_state) |
76 | { |
76 | { |
77 | if (count<=visible) return 0; |
77 | if (count<=visible) return 0; |
Line 89... | Line 89... | ||
89 | } |
89 | } |
90 | return 0; |
90 | return 0; |
91 | } |
91 | } |
Line 92... | Line 92... | ||
92 | 92 | ||
93 | 93 | ||
94 | int llist::MouseOver(int xx, yy) |
94 | :int llist::MouseOver(int xx, yy) |
95 | { |
95 | { |
96 | if (xx>x) && (xx |
96 | if (xx>x) && (xx |
Line 97... | Line 97... | ||
97 | return 0; |
97 | return 0; |
98 | } |
98 | } |
99 | 99 | ||
100 | int llist::ProcessMouse(int xx, yy) |
100 | :int llist::ProcessMouse(int xx, yy) |
101 | { |
101 | { |
102 | int cur_y_temp, cur_x_temp, ret=0; |
102 | int cur_y_temp, cur_x_temp, ret=0; |
Line 119... | Line 119... | ||
119 | } |
119 | } |
120 | } |
120 | } |
121 | return ret; |
121 | return ret; |
122 | } |
122 | } |
Line 123... | Line 123... | ||
123 | 123 | ||
124 | int llist::ProcessKey(dword key) |
124 | :int llist::ProcessKey(dword key) |
125 | { |
125 | { |
126 | switch(key) |
126 | switch(key) |
127 | { |
127 | { |
128 | case SCAN_CODE_DOWN: return KeyDown(); |
128 | case SCAN_CODE_DOWN: return KeyDown(); |
Line 138... | Line 138... | ||
138 | case SCAN_CODE_RIGHT: return KeyRight(); |
138 | case SCAN_CODE_RIGHT: return KeyRight(); |
139 | } |
139 | } |
140 | return 0; |
140 | return 0; |
141 | } |
141 | } |
Line 142... | Line 142... | ||
142 | 142 | ||
143 | int llist::KeyDown() |
143 | :int llist::KeyDown() |
144 | { |
144 | { |
145 | if (no_selection) |
145 | if (no_selection) |
146 | { |
146 | { |
147 | if (visible + first >= count) return 0; |
147 | if (visible + first >= count) return 0; |
Line 166... | Line 166... | ||
166 | CheckDoesValuesOkey(); |
166 | CheckDoesValuesOkey(); |
167 | } |
167 | } |
168 | return 1; |
168 | return 1; |
169 | } |
169 | } |
Line 170... | Line 170... | ||
170 | 170 | ||
171 | int llist::KeyUp() |
171 | :int llist::KeyUp() |
172 | { |
172 | { |
173 | if (no_selection) |
173 | if (no_selection) |
174 | { |
174 | { |
175 | if (first == 0) return 0; |
175 | if (first == 0) return 0; |
Line 193... | Line 193... | ||
193 | CheckDoesValuesOkey(); |
193 | CheckDoesValuesOkey(); |
194 | } |
194 | } |
195 | return 1; |
195 | return 1; |
196 | } |
196 | } |
Line 197... | Line 197... | ||
197 | 197 | ||
198 | int llist::KeyHome() |
198 | :int llist::KeyHome() |
199 | { |
199 | { |
200 | if (cur_y==0) && (first==0) return 0; |
200 | if (cur_y==0) && (first==0) return 0; |
201 | cur_y = first = 0; |
201 | cur_y = first = 0; |
202 | return 1; |
202 | return 1; |
Line 203... | Line 203... | ||
203 | } |
203 | } |
204 | 204 | ||
205 | int llist::KeyEnd() |
205 | :int llist::KeyEnd() |
206 | { |
206 | { |
207 | if (cur_y==count-1) && (first==count-visible) return 0; |
207 | if (cur_y==count-1) && (first==count-visible) return 0; |
208 | cur_y = count-1; |
208 | cur_y = count-1; |
209 | first = count - visible; |
209 | first = count - visible; |
Line 210... | Line 210... | ||
210 | return 1; |
210 | return 1; |
211 | } |
211 | } |
212 | 212 | ||
213 | int llist::KeyPgUp() |
213 | :int llist::KeyPgUp() |
214 | { |
214 | { |
215 | if (count <= visible) return KeyHome(); |
215 | if (count <= visible) return KeyHome(); |
216 | if (first == 0) return 0; |
216 | if (first == 0) return 0; |
217 | first -= visible; |
217 | first -= visible; |
218 | cur_y = first; |
218 | cur_y = first; |
Line 219... | Line 219... | ||
219 | CheckDoesValuesOkey(); |
219 | CheckDoesValuesOkey(); |
220 | return 1; |
220 | return 1; |
221 | } |
221 | } |
222 | 222 | ||
223 | int llist::KeyPgDown() |
223 | :int llist::KeyPgDown() |
224 | { |
224 | { |
225 | if (count <= visible) return KeyEnd(); |
225 | if (count <= visible) return KeyEnd(); |
226 | if (first == count - visible) return 0; |
226 | if (first == count - visible) return 0; |
227 | first += visible; |
227 | first += visible; |
Line 228... | Line 228... | ||
228 | cur_y = first + visible - 1; |
228 | cur_y = first + visible - 1; |
229 | CheckDoesValuesOkey(); |
229 | CheckDoesValuesOkey(); |
230 | return 1; |
230 | return 1; |
231 | } |
231 | } |
232 | 232 | ||
233 | void llist::CheckDoesValuesOkey() |
233 | :void llist::CheckDoesValuesOkey() |
234 | { |
234 | { |
235 | if (visible + first > count) first = count - visible; |
235 | if (visible + first > count) first = count - visible; |
Line 236... | Line 236... | ||
236 | if (first < 0) first = 0; |
236 | if (first < 0) first = 0; |
237 | if (cur_y >= count) cur_y = count - 1; |
237 | if (cur_y >= count) cur_y = count - 1; |
238 | if (cur_y < 0) cur_y = 0; |
238 | if (cur_y < 0) cur_y = 0; |
239 | if (cur_x < 0) cur_x = 0; |
239 | if (cur_x < 0) cur_x = 0; |
240 | } |
240 | } |
241 | 241 | ||
Line 251... | Line 251... | ||
251 | cur_x = 0; |
251 | cur_x = 0; |
252 | } |
252 | } |
253 | return 1; |
253 | return 1; |
254 | } |
254 | } |
Line 255... | Line 255... | ||
255 | 255 | ||
256 | int llist::KeyLeft() |
256 | :int llist::KeyLeft() |
257 | { |
257 | { |
258 | if (cur_x > 0) |
258 | if (cur_x > 0) |
259 | { |
259 | { |
260 | cur_x--; |
260 | cur_x--; |
Line 266... | Line 266... | ||
266 | } |
266 | } |
267 | return 1; |
267 | return 1; |
268 | } |
268 | } |
Line 269... | Line 269... | ||
269 | 269 | ||
270 | 270 | ||
271 | void llist_copy(dword dest, src) |
271 | :void llist_copy(dword dest, src) |
272 | { |
272 | { |
273 | EDI = dest; |
273 | EDI = dest; |
274 | ESI = src; |
274 | ESI = src; |