Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5499 → Rev 5519

/programs/cmm/TWB/TWB.c
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);
}
/programs/cmm/TWB/links.h
76,10 → 76,10
{
if (active==i) return;
CursorPointer.Set();
if (links[active].underline) DrawBar(links[active].x,links[active].y+10,links[active].w,1, link_col_in);
if (links[i].underline) DrawBar(links[i].x,links[i].y+10,links[i].w,1, bg_col);
if (links[active].underline) DrawBar(links[active].x, WB1.list.line_h - WB1.DrawBuf.zoomf * WB1.DrawBuf.zoomf + links[active].y,links[active].w, WB1.DrawBuf.zoomf, link_col_in);
if (links[i].underline) DrawBar(links[i].x, WB1.list.line_h - WB1.DrawBuf.zoomf * WB1.DrawBuf.zoomf + links[i].y,links[i].w, WB1.DrawBuf.zoomf, bg_col);
active = i;
status_text.start_x = progress_bar.left+progress_bar.width+10;
status_text.start_x = wv_progress_bar.left + wv_progress_bar.width + 10;
status_text.start_y = Form.cheight-STATUSBAR_H+3;
status_text.area_size_x = Form.cwidth - status_text.start_x -3;
DrawBar(status_text.start_x, status_text.start_y, status_text.area_size_x, 9, col_bg);
92,7 → 92,7
if (active!=-1)
{
CursorPointer.Restore();
if (links[active].underline) DrawBar(links[active].x,links[active].y+10,links[active].w,1, link_col_in);
if (links[active].underline) DrawBar(links[active].x, WB1.list.line_h - WB1.DrawBuf.zoomf * WB1.DrawBuf.zoomf + links[active].y,links[active].w, WB1.DrawBuf.zoomf, link_col_in);
DrawBar(status_text.start_x, status_text.start_y, status_text.area_size_x, 9, col_bg);
active = -1;
}