add forgotten file

git-svn-id: svn://kolibrios.org@5616 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2015-07-24 21:48:31 +00:00
parent e2f713258b
commit b583ff5953

View File

@ -10,7 +10,7 @@ struct llist
{ {
int x, y, w, h, min_h, line_h, text_y; int x, y, w, h, min_h, line_h, text_y;
int column_max; int column_max;
int count, visible, first, current; int count, visible, first, current; //visible = row_max
int active; int active;
void ClearList(); void ClearList();
int ProcessKey(dword key); int ProcessKey(dword key);
@ -22,21 +22,22 @@ struct llist
int KeyEnd(); int KeyEnd();
void SetSizes(int xx, yy, ww, hh, min_hh, line_hh); void SetSizes(int xx, yy, ww, hh, min_hh, line_hh);
int MouseScroll(dword scroll_state); int MouseScroll(dword scroll_state);
// void debug_values(); int MouseScrollNoSelection(dword scroll_state);
void debug_values();
}; };
// void llist::debug_values() void llist::debug_values()
// { {
// debug("current: "); debug("current: ");
// debugi(current); debugi(current);
// debug("first: "); debug("first: ");
// debugi(first); debugi(first);
// debug("visible: "); debug("visible: ");
// debugi(visible); debugi(visible);
// debug("count: "); debug("count: ");
// debugi(count); debugi(count);
// } }
@ -56,6 +57,7 @@ void llist::SetSizes(int xx, yy, ww, hh, min_hh, line_hh)
line_h = line_hh; line_h = line_hh;
text_y = line_hh / 2 - 4; text_y = line_hh / 2 - 4;
visible = h / line_h; visible = h / line_h;
column_max = w / 6;
//if (visible > count) visible=count; //if (visible > count) visible=count;
} }
@ -78,6 +80,24 @@ int llist::MouseScroll(dword scroll_state)
return 0; return 0;
} }
int llist::MouseScrollNoSelection(dword scroll_state)
{
if (count<=visible) return 0;
if (scroll_state == 65535)
{
if (current == 0) return 0;
if (current > 3) current -= 2; else current=0;
return 1;
}
if (scroll_state == 1)
{
if (visible + current == count) return 0;
if (visible+current+3 > count) current = count - visible; else current+=2;
return 1;
}
return 0;
}
int llist::MouseOver(int xx, yy) int llist::MouseOver(int xx, yy)
{ {
if (xx>x) && (xx<x+w) && (yy>y) && (yy<y+h) return 1; if (xx>x) && (xx<x+w) && (yy>y) && (yy<y+h) return 1;