10,6 → 10,7 |
|
struct TWebBrowser { |
llist list; |
dword draw_line_height, draw_line_width, draw_list_height; |
DrawBufer DrawBuf; |
void Prepare(); |
void Parse(); |
61,7 → 62,7 |
|
void TWebBrowser::DrawPage() |
{ |
int start_x, start_y, line_length, stolbec_len, magrin_left=5; |
int start_x, start_y, zstart_x, zstart_y, line_length, zline_length, stolbec_len, magrin_left=5; |
|
if (!header) |
{ |
77,18 → 78,21 |
{ |
start_x = stolbec * 6 + list.x + magrin_left; |
start_y = stroka * list.line_h + list.y + magrin_left; |
zstart_x = stolbec * 6 + magrin_left * DrawBuf.zoomf + list.x; |
zstart_y = stroka * list.line_h * DrawBuf.zoomf + magrin_left + list.y; |
stolbec_len = strlen(#line); |
line_length = stolbec_len * 6; |
zline_length = stolbec_len * 6 * DrawBuf.zoomf; |
|
WriteBufText(start_x, 0, 0x88, text_colors[text_color_index], #line, buf_data); |
IF (b_text) WriteBufText(start_x+1, 0, 0x88, text_colors[text_color_index], #line, buf_data); |
IF (i_text) { stolbec++; DrawBuf.Skew(start_x, 0, line_length, list.line_h); } |
IF (s_text) DrawBuf.DrawBar(start_x, 4, line_length, 1, text_colors[text_color_index]); |
IF (u_text) DrawBuf.DrawBar(start_x, 8, line_length, 1, text_colors[text_color_index]); |
IF (link) { |
UnsafeDefineButton(start_x-2, start_y-1, line_length + 3, 10, PageLinks.count + 400 + BT_HIDE, 0xB5BFC9); |
if (b_text) WriteBufText(start_x+1, 0, 0x88, text_colors[text_color_index], #line, buf_data); |
if (i_text) { stolbec++; DrawBuf.Skew(start_x, 0, line_length, list.line_h); } |
if (s_text) DrawBuf.DrawBar(start_x, 4, line_length, 1, text_colors[text_color_index]); |
if (u_text) DrawBuf.DrawBar(start_x, 8, line_length, 1, text_colors[text_color_index]); |
if (link) { |
DrawBuf.DrawBar(start_x, 8, line_length, 1, text_colors[text_color_index]); |
PageLinks.AddText(#line, line_length, list.line_h, UNDERLINE); |
UnsafeDefineButton(zstart_x-2, zstart_y-1, zline_length + 3, DrawBuf.zoomf * 10, PageLinks.count + 400 + BT_HIDE, 0xB5BFC9); |
PageLinks.AddText(#line, zline_length, draw_line_height, UNDERLINE); |
} |
stolbec += stolbec_len; |
} |
145,6 → 149,10 |
stolbec = 0; |
line = 0; |
|
draw_line_height = list.line_h * DrawBuf.zoomf; |
draw_line_width = list.w * DrawBuf.zoomf; |
draw_list_height = list.h * DrawBuf.zoomf; |
|
if (pre_text<>2) |
{ |
pre_text=0; |
247,7 → 255,7 |
if (stolbec + strlen(#line) > list.column_max) Perenos(); |
DrawPage(); |
line = NULL; |
if (tag) SetTextStyle(list.x + 5, stroka * list.line_h + list.y + 5); //îáðàáîòêà òåãîâ |
if (tag) SetTextStyle(WB1.DrawBuf.zoomf * 5 + list.x, stroka * draw_line_height + list.y + 5); //îáðàáîòêà òåãîâ |
tag = parametr = tagparam = ignor_param = NULL; |
break; |
default: |
265,8 → 273,8 |
} |
DrawPage(); |
NewLine(); |
DrawBar(list.x, stroka * list.line_h + list.y + 5, list.w, -stroka * list.line_h + list.h - 5, bg_color); |
DrawBar(list.x, list.visible * list.line_h + list.y + 4, list.w, -list.visible * list.line_h + list.h - 4, bg_color); |
DrawBar(list.x, stroka * draw_line_height + list.y + 5, draw_line_width, -stroka * draw_line_height + draw_list_height - 5, bg_color); |
DrawBar(list.x, list.visible * draw_line_height + list.y + 4, draw_line_width, -list.visible * draw_line_height + draw_list_height - 4, bg_color); |
if (list.first == 0) list.count = stroka; |
if (anchor) //åñëè ïîñðåäè òåêñòà ïîÿâèòñÿ íîâûé ÿêîðü - áóäåò áåñêîíå÷íûé öèêë |
{ |
380,7 → 388,7 |
|
link = 1; |
text_colors[text_color_index] = link_color_inactive; |
PageLinks.AddLink(#options, stolbec*6+left1, top1-2); |
PageLinks.AddLink(#options, DrawBuf.zoomf * stolbec*6+left1, top1-2); |
} |
if (anchor) && (!strcmp(#parametr, "name=")) |
{ |
548,7 → 556,7 |
if (opened) |
{ |
NewLine(); |
if (stroka > -1) && (stroka - 2 < list.visible) DrawBuf.DrawBar(li_tab * 5 * 6 + left1 - 5, list.line_h/2-2, 2, 2, 0x555555); |
if (stroka > -1) && (stroka - 2 < list.visible) DrawBuf.DrawBar(li_tab * 5 * 6 + list.x, list.line_h/2-2, 2, 2, 0x555555); |
} |
return; |
} |
609,8 → 617,10 |
scroll_wv.all_redraw=0; |
scroll_wv.start_x = list.x + list.w; |
scroll_wv.start_y = list.y; |
scroll_wv.size_y=list.h; |
|
scroll_wv.size_y = list.h * DrawBuf.zoomf; |
scroll_wv.start_x = list.w * DrawBuf.zoomf + list.x; |
|
scrollbar_v_draw(#scroll_wv); |
} |
|
617,12 → 627,12 |
|
void TWebBrowser::NewLine() |
{ |
int onleft; |
int ontop; |
int onleft, ontop, zontop; |
|
onleft = list.x + 5; |
ontop = stroka * list.line_h + list.y + 5; |
if (!stroka) DrawBar(list.x, list.y, list.w, 5, bg_color); |
zontop = stroka * list.line_h * DrawBuf.zoomf + list.y + 5; |
if (!stroka) DrawBar(list.x, list.y, draw_line_width, 5, bg_color); |
if (t_html) && (!t_body) return; |
if (ontop>=list.y) && ( ontop < list.h+list.y-10) && (!anchor) |
{ |
629,6 → 639,7 |
if (text_align == ALIGN_CENTER) DrawBuf.AlignCenter(onleft,ontop,list.w,list.line_h,stolbec * 6); |
if (text_align == ALIGN_RIGHT) DrawBuf.AlignRight(onleft,ontop,list.w,list.line_h,stolbec * 6); |
DrawBuf.bufy = ontop; |
DrawBuf.zbufy = zontop; |
DrawBuf.Show(); |
DrawBuf.Fill(bg_color); |
} |