Rev 7921 | Rev 7941 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7921 | Rev 7924 | ||
---|---|---|---|
Line 22... | Line 22... | ||
22 | } |
22 | } |
23 | } |
23 | } |
Line 24... | Line 24... | ||
24 | 24 | ||
25 | void SELECTION::draw_line(dword x,y,w) |
25 | void SELECTION::draw_line(dword x,y,w) |
26 | { |
26 | { |
27 | DrawBuf.DrawBar(x, y, w, list.item_h, color); |
27 | DrawBuf.DrawBar(x, y - list.first * list.item_h, w, list.item_h, color); |
Line 28... | Line 28... | ||
28 | } |
28 | } |
29 | 29 | ||
30 | void SELECTION::draw(int i) |
30 | void SELECTION::draw(int i) |
31 | { |
31 | { |
32 | if (is_active()) { |
32 | if (is_active()) { |
33 | if (start_y == i) && (end_y == i) draw_line(start_x * list.font_w+2, start_y * list.item_h, end_x - start_x * list.font_w); |
33 | if (start_y == i) && (end_y == i) draw_line(start_x * list.font_w+2, start_y, end_x - start_x * list.font_w); |
34 | else if (start_y == i) draw_line(start_x * list.font_w+2, start_y * list.item_h, list.w -2- calc(start_x * list.font_w)); |
34 | else if (start_y == i) draw_line(start_x * list.font_w+2, start_y, list.w -2- calc(start_x * list.font_w)); |
35 | else if (end_y == i) draw_line(0, end_y * list.item_h, end_x * list.font_w+2); |
35 | else if (end_y == i) draw_line(0, end_y, end_x * list.font_w+2); |
36 | //DrawBuf.DrawBar(start_x * list.font_w + 2, start_y * list.item_h, 2, list.item_h, 0x00FF00); |
36 | //DrawBuf.DrawBar(start_x * list.font_w + 2, start_y * list.item_h, 2, list.item_h, 0x00FF00); |
- | 37 | //DrawBuf.DrawBar(end_x * list.font_w + 0, end_y * list.item_h, 2, list.item_h, 0xFF00FF); |
|
- | 38 | } |
|
37 | //DrawBuf.DrawBar(end_x * list.font_w + 0, end_y * list.item_h, 2, list.item_h, 0xFF00FF); |
39 | //DrawCursor |
- | 40 | if (list.cur_y >= list.first) && (list.cur_y <= list.first+list.visible) { |
|
38 | } |
41 | DrawBuf.DrawBar(list.cur_x * list.font_w + 2, list.cur_y - list.first * list.item_h, 2, list.item_h, theme.cursor); |
Line 39... | Line 42... | ||
39 | DrawBuf.DrawBar(list.cur_x * list.font_w + 2, list.cur_y * list.item_h, 2, list.item_h, theme.cursor); //DrawCursor |
42 | } |
40 | } |
43 | } |
41 | 44 | ||
Line 47... | Line 50... | ||
47 | normalize(); |
50 | normalize(); |
48 | } |
51 | } |
Line 49... | Line 52... | ||
49 | 52 | ||
50 | void SELECTION::set_start() |
53 | void SELECTION::set_start() |
- | 54 | { |
|
51 | { |
55 | if (selection.is_active()) return; |
52 | start_x = list.cur_x; |
56 | start_x = list.cur_x; |
53 | start_y = list.cur_y; |
57 | start_y = list.cur_y; |
54 | normalize(); |
58 | normalize(); |
55 | start_offset = lines.get(start_y) + start_x; |
59 | start_offset = lines.get(start_y) + start_x; |
Line 59... | Line 63... | ||
59 | { |
63 | { |
60 | end_x = list.cur_x; |
64 | end_x = list.cur_x; |
61 | end_y = list.cur_y; |
65 | end_y = list.cur_y; |
62 | normalize(); |
66 | normalize(); |
63 | end_offset = lines.get(end_y) + end_x; |
67 | end_offset = lines.get(end_y) + end_x; |
64 | debugval("end_x", end_x); |
68 | //debugval("end_x", end_x); |
65 | debugval("end_y", end_y); |
69 | //debugval("end_y", end_y); |
66 | } |
70 | } |
Line 67... | Line 71... | ||
67 | 71 | ||
68 | 72 | ||
Line 76... | Line 80... | ||
76 | { |
80 | { |
77 | start_y = 0; |
81 | start_y = 0; |
78 | start_x = 0; |
82 | start_x = 0; |
79 | end_y = lines.count-2; |
83 | end_y = lines.count-2; |
80 | end_x = lines.get(end_y+1) - lines.get(end_y); |
84 | end_x = lines.get(end_y+1) - lines.get(end_y); |
81 | //normalize(); |
- | |
82 | start_offset = lines.get(start_y) + start_x; |
85 | start_offset = lines.get(start_y) + start_x; |
83 | end_offset = lines.get(end_y) + end_x; |
86 | end_offset = lines.get(end_y) + end_x; |
84 | debugval("end_x__", end_x); |
87 | //debugval("end_x__", end_x); |
85 | debugval("end_y__", end_y); |
88 | //debugval("end_y__", end_y); |
86 | } |
89 | } |
Line 87... | Line 90... | ||
87 | 90 | ||
88 | bool SELECTION::swap_start_end() |
91 | bool SELECTION::swap_start_end() |
89 | { |
92 | { |