14,13 → 14,16 |
int count, visible, first, current; //visible = row_max |
int active; |
void ClearList(); |
int ProcessKey(dword key); |
int MouseOver(int xx, yy); |
int ProcessMouse(int xx, yy); |
int ProcessKey(dword key); |
int KeyDown(); |
int KeyUp(); |
int KeyHome(); |
int KeyEnd(); |
int KeyPgDown(); |
int KeyPgUp(); |
void CheckDoesValuesOkey(); |
void SetSizes(int xx, yy, ww, hh, min_hh, line_hh); |
int MouseScroll(dword scroll_state); |
int MouseScrollNoSelection(dword scroll_state); |
30,14 → 33,10 |
|
void llist::debug_values() |
{ |
debug("current: "); |
debugi(current); |
debug("first: "); |
debugi(first); |
debug("visible: "); |
debugi(visible); |
debug("count: "); |
debugi(count); |
char yi[128]; |
sprintf(#yi, "%s %d %s %d %s %d %s %d", "current:", current, "first:", first, |
"visible:", visible, "count:", count); |
debugln(#yi); |
} |
|
|
56,7 → 55,7 |
h = hh; |
min_h = min_hh; |
line_h = line_hh; |
text_y = line_hh / 2 - 4; |
text_y = line_h / 2 - 4; |
visible = h / line_h; |
column_max = w / 6; |
//if (visible > count) visible=count; |
128,6 → 127,8 |
case ASCII_KEY_UP: return KeyUp(); |
case ASCII_KEY_HOME: return KeyHome(); |
case ASCII_KEY_END: return KeyEnd(); |
case ASCII_KEY_PGUP: return KeyPgUp(); |
case ASCII_KEY_PGDN: return KeyPgDown(); |
} |
return 0; |
} |
145,6 → 146,11 |
first++; |
current++; |
} |
if (current < first) || (current > first + visible) |
{ |
first = current; |
CheckDoesValuesOkey(); |
} |
return 1; |
} |
|
160,6 → 166,11 |
first--; |
current--; |
} |
if (current < first) || (current > first + visible) |
{ |
first = current; |
CheckDoesValuesOkey(); |
} |
return 1; |
} |
|
166,8 → 177,7 |
int llist::KeyHome() |
{ |
if (current==0) && (first==0) return 0; |
current=0; |
first=0; |
current = first = 0; |
return 1; |
} |
|
179,4 → 189,30 |
return 1; |
} |
|
int llist::KeyPgUp() |
{ |
if (count <= visible) return KeyHome(); |
if (first == 0) return 0; |
first -= visible; |
CheckDoesValuesOkey(); |
return 1; |
} |
|
int llist::KeyPgDown() |
{ |
if (count <= visible) return KeyEnd(); |
if (first == count - visible) return 0; |
first += visible; |
CheckDoesValuesOkey(); |
return 1; |
} |
|
void llist::CheckDoesValuesOkey() |
{ |
if (first < 0) first = 0; |
if (visible + first > count) first = count - visible; |
if (current >= count) current = count - 1; |
if (current < 0) current = 0; |
} |
|
#endif |