From 72bcc9e95df47f901939b4dca6481053f110e647 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sat, 20 Apr 2013 21:31:47 +0000 Subject: [PATCH] HTMLv 0.99.02: scroll bug fixed git-svn-id: svn://kolibrios.org@3477 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/browser/HTMLv.c | 26 +++++++++++++++----------- programs/cmm/browser/TWB.h | 2 +- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/programs/cmm/browser/HTMLv.c b/programs/cmm/browser/HTMLv.c index 43ffc57bf0..d471013027 100644 --- a/programs/cmm/browser/HTMLv.c +++ b/programs/cmm/browser/HTMLv.c @@ -88,7 +88,7 @@ void main() };*/ btn=GetProcessSlot(Form.ID); - IF (btn<>GetActiveProcess()) break; //если окно не активно на события мыши не реагируем + if (btn<>GetActiveProcess()) break; //если окно не активно на события мыши не реагируем edit_box_mouse stdcall (#address_box); @@ -97,19 +97,20 @@ void main() if (m.pkm) && (m.y>WB1.top) && (m.y3) lines.first-=2; ELSE lines.first=1; + if (lines.first==0) break; + if (lines.first>3) lines.first-=2; ELSE lines.first=1; WB1.Scan(ID1); break; } - IF (m.vert==1) + if (m.vert==1) { - IF(lines.visible+lines.first+3>=lines.all) WB1.Scan(181); + if(lines.visible+lines.first+3>=lines.all) WB1.Scan(181); ELSE { lines.first+=2; WB1.Scan(ID2); @@ -118,14 +119,17 @@ void main() } if (!m.lkm) scroll_used=0; - if (m.x>=WB1.width-14) && (m.x<=WB1.width+6) && (m.y>WB1.top+16) - && (m.ylines.visible) && (m.lkm) - scroll_used=1; + if (m.x>=scroll1.start_x) && (m.x<=scroll1.start_x+scroll1.size_x) + && (m.y>=scroll1.start_y+scroll1.btn_height) && (-scroll1.btn_height+scroll1.start_y+scroll1.size_y>m.y) + && (lines.all>lines.visible) && (m.lkm) + { + scroll_used=1; + } if (scroll_used) { half_scroll_size = WB1.height - 16 * lines.visible / lines.all - 3 /2; - IF (half_scroll_size+WB1.top>m.y) || (m.y<0) || (m.y>4000) m.y=half_scroll_size+WB1.top; //если курсор над окном + if (half_scroll_size+WB1.top>m.y) || (m.y<0) || (m.y>4000) m.y=half_scroll_size+WB1.top; //если курсор над окном btn=lines.first; //сохраняем старое количество lines.first = m.y -half_scroll_size -WB1.top * lines.all / WB1.height; if (lines.visible+lines.first>lines.all) lines.first=lines.all-lines.visible; diff --git a/programs/cmm/browser/TWB.h b/programs/cmm/browser/TWB.h index 137b2cb8eb..ee696f3466 100644 --- a/programs/cmm/browser/TWB.h +++ b/programs/cmm/browser/TWB.h @@ -8,7 +8,7 @@ dword char download_path[]="/rd/1/.download"; char search_path[]="http://nigma.ru/index.php?s="; -char version[]=" Text-based Browser 0.99.01"; +char version[]=" Text-based Browser 0.99.02"; struct TWebBrowser {