Rev 7941 | Rev 7960 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7941 | Rev 7945 | ||
---|---|---|---|
Line 7... | Line 7... | ||
7 | int found_count; |
7 | int found_count; |
8 | void show(); |
8 | void show(); |
9 | void hide(); |
9 | void hide(); |
10 | bool draw(); |
10 | bool draw(); |
11 | void draw_found(); |
11 | bool edit_key(); |
12 | int height(); |
- | |
13 | bool edit_key(); |
- | |
14 | bool edit_mouse(); |
12 | bool edit_mouse(); |
15 | void clear(); |
13 | void clear(); |
16 | int find_next(); |
14 | int find_next(); |
17 | } search; |
15 | } search; |
18 | 16 | ||
Line 35... | Line 33... | ||
35 | visible = false; |
33 | visible = false; |
36 | draw_window(); |
34 | draw_window(); |
37 | } |
35 | } |
38 | 36 | ||
Line 39... | Line -... | ||
39 | int SEARCH::height() |
- | |
40 | { |
- | |
41 | return visible * SEARCH_H; |
- | |
42 | } |
- | |
43 | - | ||
44 | bool SEARCH::edit_key() |
37 | bool SEARCH::edit_key() |
45 | { |
38 | { |
46 | if (visible) && (search_box.flags & ed_focus) { |
39 | if (visible) && (search_box.flags & ed_focus) { |
47 | EAX = key_editbox; |
40 | EAX = key_editbox; |
48 | edit_box_key stdcall(#search_box); |
41 | edit_box_key stdcall(#search_box); |
Line 59... | Line 52... | ||
59 | } |
52 | } |
60 | return false; |
53 | return false; |
61 | } |
54 | } |
62 | 55 | ||
Line 63... | Line -... | ||
63 | void SEARCH::draw_found() |
- | |
64 | { |
- | |
65 | char matches[30]; |
- | |
66 | sprintf(#matches, T_MATCHES, found_count); |
- | |
67 | WriteTextWithBg(search_box.left+search_box.width+14+110, |
- | |
68 | search_box.top+3, 0xD0, sc.work_text, #matches, sc.work); |
- | |
69 | } |
- | |
70 | - | ||
71 | bool SEARCH::draw(dword _btn_find, _btn_hide, _y) |
56 | bool SEARCH::draw(dword _btn_find, _btn_hide, _y) |
72 | { |
57 | { |
- | 58 | char matches[30]; |
|
73 | if (!visible) return false; |
59 | if (!visible) return false; |
74 | DrawBar(0, _y, Form.cwidth, 1, sc.work_graph); |
60 | DrawBar(0, _y, Form.cwidth, 1, sc.work_graph); |
75 | DrawBar(0, _y+1, Form.cwidth, SEARCH_H-1, sc.work); |
61 | DrawBar(0, _y+1, Form.cwidth, SEARCH_H-1, sc.work); |
Line 76... | Line 62... | ||
76 | 62 | ||
Line 83... | Line 69... | ||
83 | 69 | ||
Line 84... | Line 70... | ||
84 | DrawCaptButton(search_box.left+search_box.width+14, search_box.top-1, 90, |
70 | DrawCaptButton(search_box.left+search_box.width+14, search_box.top-1, 90, |
85 | TOOLBAR_ICON_HEIGHT+1, _btn_find, sc.work_light, sc.work_text, T_FIND_NEXT); |
71 | TOOLBAR_ICON_HEIGHT+1, _btn_find, sc.work_light, sc.work_text, T_FIND_NEXT); |
Line 86... | Line 72... | ||
86 | 72 | ||
- | 73 | sprintf(#matches, T_MATCHES, found_count); |
|
- | 74 | WriteTextWithBg(search_box.left+search_box.width+14+110, |
|
Line 87... | Line 75... | ||
87 | draw_found(); |
75 | search_box.top+3, 0xD0, sc.work_text, #matches, sc.work); |
88 | 76 | ||
89 | DefineHiddenButton(Form.cwidth-26, search_box.top-1, TOOLBAR_ICON_HEIGHT+1, |
77 | DefineHiddenButton(Form.cwidth-26, search_box.top-1, TOOLBAR_ICON_HEIGHT+1, |
90 | TOOLBAR_ICON_HEIGHT+1, _btn_hide); |
78 | TOOLBAR_ICON_HEIGHT+1, _btn_hide); |
Line 104... | Line 92... | ||
104 | int i; |
92 | int i; |
105 | if (!search_text[0]) return false; |
93 | if (!search_text[0]) return false; |
106 | 94 | ||
Line 107... | Line 95... | ||
107 | strcpy(#found_text, #search_text); |
95 | strcpy(#found_text, #search_text); |
108 | //highlight(0xFF0000, _bg_color); |
- | |
109 | found_count = strnum(io.buffer_data, #found_text); |
96 | found_count = strinum(io.buffer_data, #found_text); |
110 | draw_found(); |
97 | draw_window(); |
Line 111... | Line 98... | ||
111 | 98 | ||
112 | for (i=_cur_pos+1; i |
99 | for (i=_cur_pos+1; i |
113 | if (strstri(lines.get(i),#search_text)!=-1) return atoi(lines.get(i)); |
100 | if (strstri(lines.get(i),#search_text)) return i; |
114 | } |
101 | } |
115 | return false; |
102 | return false; |