/programs/cmm/quark/data.h |
---|
13,7 → 13,7 |
char copied_chars[] = "ª®¯¨à®¢ ® ᨢ®«®¢: %i"; |
char about[] = "Quark Text v0.72 |
char about[] = "Quark Text v0.8 |
¢â®à: ¨à¨«« ¨¯ ⮢ aka Leency |
©â: http://aspero.pro |
52,7 → 52,7 |
char copied_chars[] = "Copied %i chars"; |
char about[] = "Quark Text v0.72 |
char about[] = "Quark Text v0.8 |
Author: Kiril Lipatov aka Leency |
Website: http://aspero.pro |
94,13 → 94,13 |
dword color_schemes[] = { |
//bg, text, scroll, selected, cursor |
0xFCF0DA, 0x171501, 0xB2ACA0, 0xD8CAA7, 0xFF0000, //Dairy |
0x282923, 0xD8D8D2, 0x555551, 0x5A574A, 0xFFFfff //Cosmos |
0xFCF0DA, 0x171501, 0xB2ACA0, 0xD8CAA7, 0xFF0000, 0xFEC53A, //Dairy |
0x282923, 0xD8D8D2, 0x555551, 0x5A574A, 0xFFFfff, 0x9D7E00 //Cosmos |
}; |
struct THEME |
{ |
dword bg, text, cursor; |
dword bg, text, cursor, found; |
} theme; |
char default_dir[] = "/rd/1"; |
/programs/cmm/quark/prepare_page.h |
---|
1,7 → 1,6 |
void ParseAndPaint() |
{ |
//search.clear(); |
list.count=0; |
selection.cancel(); |
46,7 → 45,8 |
void PaintVisible() |
{ |
int i; |
int i, ff; |
signed s1, s2; |
dword ydraw, absolute_y; |
dword line_bg; |
bool swapped_selection = false; |
68,6 → 68,18 |
selection.draw(absolute_y); |
if (search.visible) for (ff=0; ff<search.found.count; ff++) { |
s1 = search.found.get(ff) - lines.get(absolute_y); |
s2 = search.found.get(ff) - lines.get(absolute_y+1); |
if (s2 > 0) break; |
if (s1 > 0) && (s2 < 0) { |
DrawBuf.DrawBar(search.found.get(ff) - lines.get(absolute_y) * list.font_w + 3, |
ydraw, strlen(#found_text) * list.font_w, list.item_h, theme.found); |
} |
} |
if (absolute_y<list.count) DrawBuf.WriteText(3, ydraw+3, list.font_type, theme.text, |
lines.get(absolute_y), lines.len(absolute_y)); |
} |
76,4 → 88,3 |
if (swapped_selection) selection.swap_start_end(); |
} |
/programs/cmm/quark/quark.c |
---|
409,12 → 409,13 |
void EventSetColorScheme(dword _setn) |
{ |
curcol_scheme = _setn; |
theme.bg = color_schemes[curcol_scheme*5]; |
theme.text = color_schemes[curcol_scheme*5+1]; |
theme.bg = color_schemes[curcol_scheme*6]; |
theme.text = color_schemes[curcol_scheme*6+1]; |
scroll.bckg_col = theme.bg; |
scroll.frnt_col = scroll.line_col = color_schemes[curcol_scheme*5+2]; |
selection.color = color_schemes[curcol_scheme*5+3]; |
theme.cursor = color_schemes[curcol_scheme*5+4]; |
scroll.frnt_col = scroll.line_col = color_schemes[curcol_scheme*6+2]; |
selection.color = color_schemes[curcol_scheme*6+3]; |
theme.cursor = color_schemes[curcol_scheme*6+4]; |
theme.found = color_schemes[curcol_scheme*6+5]; |
if (list.count) ParseAndPaint(); |
} |
/programs/cmm/quark/search.h |
---|
6,12 → 6,13 |
{ |
bool visible; |
int found_count; |
collection_int found; |
void show(); |
void hide(); |
bool draw(); |
bool edit_key(); |
bool edit_mouse(); |
void clear(); |
int find_all(); |
int find_next(); |
} search; |
71,7 → 72,7 |
DrawCaptButton(search_box.left+search_box.width+14, search_box.top-1, 90, |
TOOLBAR_ICON_HEIGHT+1, _btn_find, sc.work_light, sc.work_text, T_FIND_NEXT); |
sprintf(#matches, T_MATCHES, found_count); |
sprintf(#matches, T_MATCHES, found.count); |
WriteTextWithBg(search_box.left+search_box.width+14+110, |
search_box.top+3, 0xD0, sc.work_text, #matches, sc.work); |
81,12 → 82,17 |
return true; |
} |
void SEARCH::clear() |
int SEARCH::find_all() |
{ |
visible = false; |
found_text[0] = '\0'; |
found_count = 0; |
dword haystack = io.buffer_data; |
int needle_len = strlen(#found_text); |
found.drop(); |
loop() { |
if (! haystack = strstri(haystack, #found_text)) break; |
found.add(haystack - needle_len); |
haystack += needle_len; |
} |
} |
int SEARCH::find_next(int _cur_pos) |
{ |
93,13 → 99,15 |
int i; |
if (!search_text[0]) return false; |
if (!streq(#found_text, #search_text)) { |
strcpy(#found_text, #search_text); |
found_count = strinum(io.buffer_data, #found_text); |
find_all(); |
} |
draw_window(); |
for (i=_cur_pos+1; i<list.count; i++) { |
if (strstri(lines.get(i),#search_text)) return i; |
} |
//for (i=_cur_pos+1; i<list.count; i++) { |
// if (strstri(lines.get(i),#search_text)) return i; |
//} |
return false; |
} |