HTMLv small update

git-svn-id: svn://kolibrios.org@2248 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2011-09-30 09:19:41 +00:00
parent a31fabebfb
commit 18daa39152
4 changed files with 37 additions and 30 deletions

View File

@ -42,10 +42,6 @@ void main()
int btn;
byte key;
IF (param) copystr(#param,#URL);
BrowserHistory.AddUrl();
copystr(#URL,#editURL);
//Asper [
mem_Init();
$or eax, eax
@ -56,6 +52,11 @@ void main()
load_dll2(libimg, #libimg_init,1);
load_dll2(boxlib, #edit_box_draw,0);
//] Asper
IF (param) copystr(#param,#URL);
BrowserHistory.AddUrl();
copystr(#URL,#editURL);
SetEventMask(0x27);
loop()
{
@ -118,11 +119,12 @@ void Draw_Window()
{
WindowRedrawStatus(1);
DefineAndDrawWindow(215,100,640,480,0x73,0x00E4DFE1,0,0,0);
WindowRedrawStatus(2);
Form.GetInfo(SelfInfo);
IF (Form.height==GetSkinWidth()+3) //åñëè ñâåðíóòî â çàãîëîâîê, íè÷åãî íå ðèñóåì
{
DrawTitle(#header);
WindowRedrawStatus(2);
return;
}
IF (Form.height<120) MoveSize(OLD,OLD,OLD,120);
@ -143,8 +145,6 @@ void Draw_Window()
WB1.width=Form.width-11;
WB1.height=onTop(43,5);
WB1.Load(#URL);
WindowRedrawStatus(2);
}
int onLeft(dword right,left) {return Form.width-right-left;}

View File

@ -58,7 +58,8 @@ char line[330],
#include "include\unicode_tags.h--"
void TWebBrowser::Scan(dword id) {
IF (id > 399) {
IF (id > 399)
{
j = 0;
FOR(i = 0; i <= id - 401; i++) {
do j++;
@ -70,10 +71,11 @@ void TWebBrowser::Scan(dword id) {
Draw_Window();
return;
}
//edit1.flags=64;
IF(count < max_kolvo_strok) SWITCH(id) {
CASE 183: CASE 184: CASE 180: CASE 181: return;
} //åñëè ìàëî ñòðîê èãíîðèðóåì íåêîòîðûå êíîïêè
IF(count < max_kolvo_strok) SWITCH(id) //åñëè ìàëî ñòðîê èãíîðèðóåì íåêîòîðûå êíîïêè
{ CASE 183: CASE 184: CASE 180: CASE 181: return; }
switch (id)
{
case 011: //Ctrk+K
@ -100,24 +102,26 @@ void TWebBrowser::Scan(dword id) {
return;
case HOME:
copystr("/sys/index.htm", #editURL);
case 052: //Íàæàòà F3
IF(edit1.flags <> 66)
IF (strcmp(get_URL_part(5),"http:")<>0) RunProgram("tinypad", #URL); ELSE RunProgram("tinypad", #download_path);
return;
case GOTOURL:
case 0x0D: //enter
copystr(#editURL, #URL);
Load(#URL);
return;
case 052: //Íàæàòà F3
IF(edit1.flags <> 66)
IF (strcmp(get_URL_part(5),"http:")<>0) RunProgram("tinypad", #URL); ELSE RunProgram("tinypad", #download_path);
break;
case 173: //ctrl+enter
case SEARCHWEB:
copystr(#search_path, #URL);
copystr(#editURL, #URL + strlen(#URL));
Load(#URL);
return;
case ID1: //ìîòàåì ââåðõ
IF(za_kadrom > 0) za_kadrom--;
ELSE return;
IF(za_kadrom <= 0) return;
za_kadrom--;
break;
case ID2: //ìîòàåì âíèç
IF(max_kolvo_strok + za_kadrom >= count) return;
@ -125,19 +129,20 @@ void TWebBrowser::Scan(dword id) {
break;
case 183: //PgDown
IF(za_kadrom == count - max_kolvo_strok) return;
za_kadrom = za_kadrom + max_kolvo_strok + 2;
za_kadrom += max_kolvo_strok + 2;
IF(max_kolvo_strok + za_kadrom > count) za_kadrom = count - max_kolvo_strok;
BREAK;
case 184: //PgUp
IF(za_kadrom == 0) RETURN;
za_kadrom = za_kadrom - max_kolvo_strok - 2;
za_kadrom -= max_kolvo_strok - 2;
IF(za_kadrom < 0) za_kadrom = 0;
BREAK;
case 180: //home
IF (za_kadrom <>0) za_kadrom = 0;
ELSE RETURN;
IF(za_kadrom == 0) RETURN;
za_kadrom = 0;
BREAK;
case 181: //end
IF (za_kadrom == count - max_kolvo_strok) RETURN;
za_kadrom = count - max_kolvo_strok;
BREAK;
default:
@ -163,7 +168,7 @@ void TWebBrowser::DrawScroller() {
IF(za_kadrom + max_kolvo_strok >= count) on_y = height - scroll_size + top - 17;
ELSE on_y = height - 32 * za_kadrom / count + top + 16;
DrawFlatButton(left + width - 15, on_y, 16, scroll_size, 0, 0xE4DFE1, ""); //ïîëçóíîê
IF(on_y > top + 17) DrawBar(left + width - 14, top + 17, 16, on_y - top - 17, 0xCED0D0); //ïîëå äî ïîëçóíêà
IF(on_y > top + 17) DrawBar(left + width - 14, top + 17, 16, on_y - top - 17, 0xCED0D0); //ïîëå äî ïîëçóíêà
IF(height - scroll_size + top - 17 > on_y)
DrawBar(left + width - 14, on_y + scroll_size + 1, 16, height - scroll_size - on_y + top - 18, 0xCED0D0); //ïîëå ïîñëå ïîëçóíêà
}
@ -212,7 +217,7 @@ void HttpLoad()
ELSE file_size stdcall (#URL);
*/
void ReadHtml(byte DO_LOAD)
void ReadHtml()
{
if (!strcmp(get_URL_part(5),"http:")))
file_size stdcall (#download_path);
@ -249,7 +254,8 @@ void TWebBrowser::Load(dword adress) {
edit1.size = edit1.pos = strlen(#editURL);
edit_box_draw stdcall(#edit1); //ðèñóåì ñòðîêó àäðåñà
ReadHtml(LETS_LOAD);
//LETS_LOAD
ReadHtml();
IF (!filesize) return; //Lee 22.09
@ -723,17 +729,17 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
IF (!strcmp(#options,"utf-8")) || (!strcmp(#options,"utf8"))
{
ReadHtml(DONT_LOAD);
ReadHtml();
utf8rutodos(buf);
}
IF(!strcmp(#options, "koi8-r")) || (!strcmp(#options, "koi8-u"))
{
ReadHtml(DONT_LOAD);
ReadHtml();
koitodos(buf);
}
IF(!strcmp(#options, "dos")) || (!strcmp(#options, "cp-866"))
{
ReadHtml(DONT_LOAD);
ReadHtml();
}
}
IF(tagparam)

View File

@ -14,9 +14,6 @@
#define KOI 2
#define UTF 3
#define DONT_LOAD 0
#define LETS_LOAD 1
dword get_URL_part(byte len) {
char temp1[1000];

View File

@ -22,6 +22,8 @@ char *unicode_tags[]={
"copy", "(c)",
"#169", "(c)",
"trade", "[TM]",
"reg", "(r)",
"#174", "(r)",
@ -38,6 +40,7 @@ char *unicode_tags[]={
"minus", "-",
"ndash", "-",
"mdash", "-", //--
"#8722", "-",
"#8211", "-",
"#151", "-",
@ -68,6 +71,7 @@ char *unicode_tags[]={
"#1031","\244",
"#8470","N",
"bull", "-", //¢®®¡é¥ §¤¥áì â®çª 
"percnt","%",
0};