From d3628091dcac633b459ce99928ee1c7845d6a191 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Wed, 9 Oct 2013 19:12:03 +0000 Subject: [PATCH] HTMLv 0.99.07: update menu, multilingual git-svn-id: svn://kolibrios.org@3992 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/browser/TWB.h | 17 +++++-- .../browser/{compile.bat => compile_en.bat} | 4 ++ programs/cmm/browser/compile_ru.bat | 9 ++++ programs/cmm/browser/include/menu_rmb.h | 46 +++++++++++-------- programs/cmm/lib/figures.h | 5 +- 5 files changed, 54 insertions(+), 27 deletions(-) rename programs/cmm/browser/{compile.bat => compile_en.bat} (51%) create mode 100644 programs/cmm/browser/compile_ru.bat diff --git a/programs/cmm/browser/TWB.h b/programs/cmm/browser/TWB.h index 695fc488b7..c9321073ec 100644 --- a/programs/cmm/browser/TWB.h +++ b/programs/cmm/browser/TWB.h @@ -8,7 +8,18 @@ dword char download_path[]="/rd/1/.download"; char search_path[]="http://nigma.ru/index.php?s="; -char version[]=" Text-based Browser 0.99.05"; + +#ifndef AUTOBUILD + #include "lang.h--" +#endif + +#ifdef LANG_RUS + char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 0.99.07"; +#else + char version[]=" Text-based Browser 0.99.07"; +#endif + + struct TWebBrowser { @@ -203,10 +214,6 @@ void TWebBrowser::Scan(int id) break; case 002: //free img cache FreeImgCache(); - break; - case 003: - if (!pre_text) pre_text=2; - else pre_text=0; break; case 005: //truetype if (use_truetype == 2) diff --git a/programs/cmm/browser/compile.bat b/programs/cmm/browser/compile_en.bat similarity index 51% rename from programs/cmm/browser/compile.bat rename to programs/cmm/browser/compile_en.bat index c3b325c807..5f548f0691 100644 --- a/programs/cmm/browser/compile.bat +++ b/programs/cmm/browser/compile_en.bat @@ -1,5 +1,9 @@ +@del lang.h-- +@echo #define LANG_ENG 1 >lang.h-- + ..\C--\c-- HTMLv.c @del HTMLv @rename HTMLv.com HTMLv @del warning.txt +@del lang.h-- @pause \ No newline at end of file diff --git a/programs/cmm/browser/compile_ru.bat b/programs/cmm/browser/compile_ru.bat new file mode 100644 index 0000000000..a0d91dd4c1 --- /dev/null +++ b/programs/cmm/browser/compile_ru.bat @@ -0,0 +1,9 @@ +@del lang.h-- +@echo #define LANG_RUS 1 >lang.h-- + +..\C--\c-- HTMLv.c +@del HTMLv +@rename HTMLv.com HTMLv +@del warning.txt +@del lang.h-- +@pause \ No newline at end of file diff --git a/programs/cmm/browser/include/menu_rmb.h b/programs/cmm/browser/include/menu_rmb.h index 64fefd3d51..6920f7036d 100644 --- a/programs/cmm/browser/include/menu_rmb.h +++ b/programs/cmm/browser/include/menu_rmb.h @@ -1,23 +1,29 @@ -//Leency - 2012 +//Leency - 2012-2013 -#define ITEM_HEIGHT 18 -#define ITEM_WIDTH 138 +#define ITEM_HEIGHT 19 +#define ITEM_WIDTH 165 +dword col_work = 0xE4DFE1; +dword col_border = 0x9098B0; char *ITEMS_LIST[]={ -//"Old HTMLv F12",255, -"View in Tinypad F3",52, -"WIN F5",54, -"DOS Ctrl+D",04, -"KOI Ctrl+K",11, -"UTF Ctrl+U",21, -"Line breaks ON" ,03, -"Free image cache" ,02, +"WIN F5",54, +"DOS Ctrl+D",04, +"KOI Ctrl+K",11, +"UTF Ctrl+U",21, +#ifdef LANG_RUS +"ˆá室­¨ª áâà ­¨æë F3",52, +"Žç¨áâ¨âì ªíè ª à⨭®ª" ,02, +//"TrueType fonts" ,05, +#else +"View source F3",52, +"Free image cache" ,02, +#endif //"TrueType fonts" ,05, 0}; -proc_info MenuForm; +proc_info MenuForm; void menu_rmb() { @@ -77,19 +83,19 @@ void menu_rmb() case evReDraw: while (ITEMS_LIST[items_num*2]) items_num++; - DefineAndDrawWindow(Form.left+m.x,Form.top+m.y+GetSkinHeight()+3,ITEM_WIDTH,items_num*ITEM_HEIGHT+1,0x01,0x10FFFFFF,0,0x01fffFFF); + DefineAndDrawWindow(Form.left+m.x,Form.top+m.y+GetSkinHeight()+3,ITEM_WIDTH+2,items_num*ITEM_HEIGHT+4,0x01, 0, 0, 0x01fffFFF); + DrawPopup(0,0,ITEM_WIDTH,items_num*ITEM_HEIGHT+2,0, -1,col_border); - DrawRectangle(0,0,ITEM_WIDTH,items_num*ITEM_HEIGHT+1,0x777777); //îáîäîê _ITEMS_DRAW: for (i=0; iitems_cur) EDX=0xFFFFFF; else EDX=0x94AECE; - DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, EDX); - WriteText(8,i*ITEM_HEIGHT+6,0x80,0x000000,ITEMS_LIST[i*2]); - if (ITEMS_LIST[i*2+1]==3) && (pre_text==2) DrawBar(ITEM_WIDTH-18, i*ITEM_HEIGHT+8, 4, 4, 0x444444); - if (ITEMS_LIST[i*2+1]==5) && (use_truetype==1) DrawBar(ITEM_WIDTH-18, i*ITEM_HEIGHT+8, 4, 4, 0x444444); + if (i<>items_cur) EDX=col_work; else EDX=0x94AECE; + DrawBar(2, i*ITEM_HEIGHT+2, ITEM_WIDTH-2, ITEM_HEIGHT, EDX); + if (i<>items_cur) WriteText(19,i*ITEM_HEIGHT+9,0x80,0xf2f2f2,ITEMS_LIST[i*2]); + WriteText(18,i*ITEM_HEIGHT+8,0x80,0x000000,ITEMS_LIST[i*2]); + //if (ITEMS_LIST[i*2+1]==5) && (use_truetype==1) DrawBar(ITEM_WIDTH-18, i*ITEM_HEIGHT+9, 4, 4, 0x444444); } - DrawBar(33, cur_encoding+1*ITEM_HEIGHT+8, 4, 4, 0x444444); //ïîêàçûâàåò âûáðàíóþ êîäèðîâêó + DrawBar(7, cur_encoding*ITEM_HEIGHT+9, 4, 4, 0x444444); //ïîêàçûâàåò âûáðàíóþ êîäèðîâêó } } diff --git a/programs/cmm/lib/figures.h b/programs/cmm/lib/figures.h index c31533243e..21cf90bcd5 100644 --- a/programs/cmm/lib/figures.h +++ b/programs/cmm/lib/figures.h @@ -119,8 +119,9 @@ void DrawCaptButton(dword x,y,w,h,id,color_b, color_t,text) :void DrawPopup(dword x,y,w,h,skinned, col_work,col_border) { DrawRectangle(x,y,w,h,col_border); - DrawRectangle3D(x+1,y+1,w-2,h-2,0xFFFfff,col_work); - DrawBar(x+2,y+2,w-3,h-3,col_work); + DrawBar(x+1,y+1,w-1,1,0xFFFfff); + DrawBar(x+1,y+2,1,h-3,0xFFFfff); + if (col_work!=-1) DrawBar(x+2,y+2,w-2,h-2,col_work); DrawPopupShadow(x,y,w,h-1,skinned); }