From 93bb33137f96b85cece46e126bbddb1ad01a1008 Mon Sep 17 00:00:00 2001
From: "Kirill Lipatov (Leency)"
Date: Thu, 13 Aug 2015 12:23:35 +0000
Subject: [PATCH] WebView 1.21 stable
git-svn-id: svn://kolibrios.org@5718 a494cfbc-eb01-0410-851d-a64ba20cac60
---
programs/cmm/TWB/TWB.c | 6 +-
programs/cmm/TWB/acid_0.1.htm | 50 ++++-----
programs/cmm/TWB/img_cache.h | 25 +++--
programs/cmm/TWB/links.h | 38 +++++--
programs/cmm/browser/WebView.c | 181 ++++++++++++++++---------------
programs/cmm/browser/menu_rmb.h | 59 +++++-----
programs/cmm/browser/wv_skin.png | Bin 2004 -> 1976 bytes
programs/cmm/lib/io.h | 1 +
8 files changed, 189 insertions(+), 171 deletions(-)
diff --git a/programs/cmm/TWB/TWB.c b/programs/cmm/TWB/TWB.c
index e4a0320e8f..e317973532 100644
--- a/programs/cmm/TWB/TWB.c
+++ b/programs/cmm/TWB/TWB.c
@@ -64,6 +64,7 @@ void TWebBrowser::DrawPage()
if (!header)
{
+ ChangeCharset("UTF-8", "CP866", #line);
strcpy(#header, #line);
strcat(#header, " -");
strcat(#header, #version);
@@ -585,7 +586,10 @@ void BufEncode(int set_new_encoding)
{
strcpy(bufpointer, o_bufpointer);
}
- //bufpointer = ChangeCharset(charsets[set_new_encoding], "CP866", bufpointer);
+ if (set_new_encoding == CH_CP1251)
+ {
+ bufpointer = ChangeCharset("CP1251", "UTF-8", bufpointer);
+ }
}
diff --git a/programs/cmm/TWB/acid_0.1.htm b/programs/cmm/TWB/acid_0.1.htm
index 0cb817d8e0..936e62d97e 100644
--- a/programs/cmm/TWB/acid_0.1.htm
+++ b/programs/cmm/TWB/acid_0.1.htm
@@ -1,14 +1,14 @@
-
- Acid 0.1
+
+ Тест Acid 0.1
- WebViewer
+Это тестовая страница для проверки WebViewer
-WebViewer (cp1251, koi-8, cp866, unicode)
- . (<table>), CSS, Javascript'a :)
+
WebViewer является текстовым браузером и поддерживает все популярные кодировки (cp1251, koi-8, cp866, unicode)
+и некоторые теги. Поддержка таблииц (<table>), CSS, Javascript'a и Контактика пока не реализована :)
@@ -34,33 +34,33 @@
- :
-
--
-
--
--
-
+Небольшой список:
+Этот текст в кавычках
+- Это подчеркнутый текст
+Это перечеркнутый текст
+- Это наклонный текст
+- Это текст с усиленным выделением
+Много тегов
-" !"-
- ,
- .
+"Осень уже пришла!"-
+ Шепнул мне на ухо ветер,
+ Подкравшись к подушке моей.
-
+ Басе
-
+
-
+
Открыть
./index.htm
- - index.htm
+Незакрытый тег а - index.htm
kernel.mnt
#2.1.4
http://bash.im
@@ -68,20 +68,20 @@
- ,
- . .
- . - : " & < >
- © ® „ “ . ' .
+В этом тексте есть переход на следующую строку, но браузер
+его должен проигнорировать. Еще много пробелов. А тут есть
+ табы. Кое-какие символы: " & < >
+ © ® „ “ Їжачок іншого боку р. Євфрат з'їв ґрунт та єврейський ґербалайф.
61055, г.
Харьков, ул. Краснознаменная, 16, радиофизический
- корпус на территории НТУ ХПИ
+ корпус на территории НТУ «ХПИ»
-Zhitomyr 2008-2014
+Zhitomyr 2008-2015
diff --git a/programs/cmm/TWB/img_cache.h b/programs/cmm/TWB/img_cache.h
index 60f22b9602..abe3809681 100644
--- a/programs/cmm/TWB/img_cache.h
+++ b/programs/cmm/TWB/img_cache.h
@@ -9,7 +9,7 @@ s_image pics[100]; //pics = mem_Alloc( 100*sizeof(s_image) );
struct ImageCache {
int pics_count;
void Free();
- int GetImageNumber();
+ int GetImage();
void Images();
};
@@ -22,7 +22,7 @@ void ImageCache::Free()
}
}
-int ImageCache::GetImageNumber(dword i_path)
+int ImageCache::GetImage(dword i_path)
{
int i;
for (i=0; i<=pics_count; i++) if (!strcmp(#pics[i].path, i_path)) return i; //image exists
@@ -43,10 +43,15 @@ void ImageCache::Images(int left1, top1, width1)
do{
if (!strcmp(#parametr,"src=")) // GetNewUrl()
{
- if (http_transfer<>0) strcpy(#img_path, #history_list[BrowserHistory.current-1].Item); else
- strcpy(#img_path, #options);
+ if (http_transfer!=0)
+ strcpy(#img_path, #history_list[BrowserHistory.current-1].Item);
+ else
+ {
+ //if (strcmp(#options))
+ strcpy(#img_path, #options);
+ }
PageLinks.GetAbsoluteURL(#img_path);
- cur_pic = GetImageNumber(#img_path);
+ cur_pic = GetImage(#img_path);
}
if (!strcmp(#parametr,"alt="))
{
@@ -67,17 +72,17 @@ void ImageCache::Images(int left1, top1, width1)
imgh = DSWORD[pics[cur_pic].image+8];
if (imgw > width1) imgw = width1;
- if (stroka==0) DrawBar(WB1.list.x, WB1.list.y, WB1.list.w-15, 5, bg_color); //
+ if (stroka==0) DrawBar(WB1.list.x, WB1.list.y, WB1.list.w-15, 5, bg_color); //fill first line
stroka += imgh / WB1.list.line_h;
if (imgh % WB1.list.line_h) stroka++;
- if (top1+imghWB1.list.y+WB1.list.h-10) return; // Ѩ
- if (top1WB1.list.y+WB1.list.h-10) return; //if all image is out of visible area
+ if (top1WB1.list.y+WB1.list.h-imgh-5) //
+ if (top1>WB1.list.y+WB1.list.h-imgh-5) //if image partly visible (at the bottom)
{
imgh=WB1.list.y+WB1.list.h-top1-5;
}
@@ -87,7 +92,7 @@ void ImageCache::Images(int left1, top1, width1)
img_draw stdcall (pics[cur_pic].image, left1-5, top1, imgw, imgh,0,img_lines_first);
DrawBar(left1+imgw - 5, top1, WB1.list.w-imgw, imgh, bg_color);
DrawBar(WB1.list.x, top1+imgh, WB1.list.w, -imgh % WB1.list.line_h + WB1.list.line_h, bg_color);
- IF (link)
+ if (link)
{
UnsafeDefineButton(left1 - 5, top1, imgw, imgh-1, PageLinks.count + 400 + BT_HIDE, 0xB5BFC9);
PageLinks.AddText(0, imgw, imgh-1, NOLINE);
diff --git a/programs/cmm/TWB/links.h b/programs/cmm/TWB/links.h
index 0343cb2237..b215ae6264 100644
--- a/programs/cmm/TWB/links.h
+++ b/programs/cmm/TWB/links.h
@@ -24,7 +24,8 @@ struct LinksArray
dword GetURL();
void Clear();
void GetAbsoluteURL();
-};
+ int UrlAbsolute();
+} PageLinks;
void LinksArray::AddLink(dword new_link, int link_x, link_y)
{
@@ -98,18 +99,33 @@ void LinksArray::Hover(dword mx, my, link_col_in, link_col_a, bg_col)
}
}
-char *ABSOLUTE_LINKS[]={ "http:", "mailto:", "ftp:", "/sys/",
-"/kolibrios/", "/rd/", "/bd", "/hd", "/cd", "/tmp", "/usbhd", "WebView:", 0};
-void LinksArray::GetAbsoluteURL(dword in_URL){
- int i, len;
+int LinksArray::UrlAbsolute(dword in_URL)
+{
+ if(!strncmp(in_URL,"http:",5)) return 1;
+ if(!strncmp(in_URL,"https:",6)) return 1;
+ if(!strncmp(in_URL,"mailto:",7)) return 1;
+ if(!strncmp(in_URL,"ftp:",4)) return 1;
+ if(!strncmp(in_URL,"WebView:",8)) return 1;
+ if(!strncmp(in_URL,"/sys/",5)) return 1;
+ if(!strncmp(in_URL,"/hd/",4)) return 1;
+ if(!strncmp(in_URL,"/fd/",4)) return 1;
+ if(!strncmp(in_URL,"/rd/",4)) return 1;
+ if(!strncmp(in_URL,"/tmp/",5)) return 1;
+ if(!strncmp(in_URL,"/cd/",4)) return 1;
+ if(!strncmp(in_URL,"/bd/",4)) return 1;
+ if(!strncmp(in_URL,"/usbhd/",7)) return 1;
+ if(!strncmp(in_URL,"/kolibrios/",11)) return 1;
+ return 0;
+}
+
+void LinksArray::GetAbsoluteURL(dword in_URL)
+{
+ int i;
dword orig_URL = in_URL;
char newurl[sizeof(URL)];
+
+ if (UrlAbsolute(in_URL)) return;
- for (i=0; ABSOLUTE_LINKS[i]; i++)
- {
- len=strlen(ABSOLUTE_LINKS[i]);
- if (!strcmpn(in_URL, ABSOLUTE_LINKS[i], len)) return;
- }
IF (!strcmpn(in_URL,"./", 2)) in_URL+=2;
strcpy(#newurl, BrowserHistory.CurrentUrl());
@@ -141,5 +157,3 @@ void LinksArray::GetAbsoluteURL(dword in_URL){
}
-
-LinksArray PageLinks;
diff --git a/programs/cmm/browser/WebView.c b/programs/cmm/browser/WebView.c
index 990c447c0e..1f45539ef7 100644
--- a/programs/cmm/browser/WebView.c
+++ b/programs/cmm/browser/WebView.c
@@ -30,14 +30,14 @@
char homepage[] = FROM "html\\homepage.htm";
#ifdef LANG_RUS
- char version[]=" ⮢ 㧥 1.2";
+ char version[]=" ⮢ 㧥 1.21";
?define IMAGES_CACHE_CLEARED " ⨭ 饭"
?define T_LAST_SLIDE " "
char loading[] = "㧪 ࠭...
";
char page_not_found[] = FROM "html\page_not_found_ru.htm";
char accept_language[]= "Accept-Language: ru\n";
#else
- char version[]=" Text-based Browser 1.2";
+ char version[]=" Text-based Browser 1.21";
?define IMAGES_CACHE_CLEARED "Images cache cleared"
?define T_LAST_SLIDE "This slide is the last"
char loading[] = "Loading...
";
@@ -70,9 +70,27 @@ dword col_bg;
dword panel_color;
dword border_color;
-progress_bar wv_progress_bar = {0, 10, 83, 150, 12, 0, 0, 100, 0xeeeEEE, 8072B7EBh, 0x9F9F9F};
+progress_bar wv_progress_bar;
byte souce_mode = false;
+enum {
+ BACK_BUTTON=1000,
+ FORWARD_BUTTON,
+ REFRESH_BUTTON,
+ GOTOURL_BUTTON,
+ SEARCHWEB_BUTTON,
+ SANDWICH_BUTTON
+};
+
+enum {
+ ZOOM2x=1100,
+ VIEW_SOURCE,
+ EDIT_SOURCE,
+ VIEW_HISTORY,
+ FREE_IMG_CACHE,
+ DOWNLOAD_MANAGER
+};
+
#include "..\TWB\TWB.c"
#include "menu_rmb.h"
#include "history.h"
@@ -88,7 +106,6 @@ edit_box address_box = {250,55,34,0xffffff,0x94AECE,0xffffff,0xffffff,0,sizeof(U
#define URL_SERVICE_HOME "WebView://home"
#define URL_SERVICE_SOURCE "WebView://source:"
-enum { BUTTON_BACK=1000, FORWARD, REFRESH, HOME, NEWTAB, GOTOURL, SEARCHWEB, INPUT_CH, INPUT_BT };
libimg_image skin;
@@ -109,11 +126,9 @@ int SetSkinColors()
void DrawProgress()
{
unsigned long btn;
- //progressbar_draw stdcall(#wv_progress_bar);
- wv_progress_bar.width = wv_progress_bar.left = 0;
if (http_transfer == 0) return;
if (wv_progress_bar.max) btn = address_box.width*wv_progress_bar.value/wv_progress_bar.max; else btn = 30;
- DrawBar(address_box.left-1, address_box.top+14, btn, 2, wv_progress_bar.progress_color);
+ DrawBar(address_box.left-1, address_box.top+15, btn, 2, wv_progress_bar.progress_color);
}
@@ -122,13 +137,14 @@ void main()
dword btn;
int half_scroll_size;
int scroll_used=0, show_menu;
-
+
CursorPointer.Load(#CursorFile);
load_dll(boxlib, #box_lib_init,0);
load_dll(libio, #libio_init,1);
load_dll(libimg, #libimg_init,1);
load_dll(libHTTP, #http_lib_init,1);
load_dll(iconv_lib, #iconv_open,0);
+ //load_dll(kmenu, #akmenu_init,0);
Libimg_LoadImage(#skin, abspath("wv_skin.png"));
SetSkinColors();
@@ -159,7 +175,6 @@ void main()
{
if (mouse.pkm) && (mouse.up)
{
- SwitchToAnotherThread();
CreateThread(#menu_rmb,#stak+4092);
break;
}
@@ -267,6 +282,7 @@ void main()
PageLinks.GetAbsoluteURL(#URL);
BrowserHistory.current--;
strcpy(#editURL, #URL);
+ DrawEditBox();
OpenPage();
}
else
@@ -313,26 +329,26 @@ void Draw_Window()
else DrawBar(0,0, Form.cwidth,1, col_bg);
// }
DrawBar(0,TAB_H+1, Form.cwidth,TOOLBAR_H-TAB_H-3, panel_color);
- DrawBar(0,TOOLBAR_H-2, Form.cwidth,1, 0xe9e9e9);
+ DrawBar(0,TOOLBAR_H-2, Form.cwidth,1, 0xD7D0D3);
DrawBar(0,TOOLBAR_H-1, Form.cwidth,1, border_color);
SetElementSizes();
+ DrawRectangle(address_box.left-2, address_box.top-3, address_box.width+4, 20,border_color);
+ DrawRectangle(address_box.left-1, address_box.top-2, address_box.width+2, 18,address_box.color);
DrawRectangle(address_box.left-1, address_box.top-1, address_box.width+2, 16,address_box.color);
- DrawRectangle(address_box.left-2, address_box.top-2, address_box.width+4, 18,border_color);
// < / >
- DefineButton(address_box.left-49, address_box.top-1, 23, skin.h-2, BUTTON_BACK+BT_HIDE, 0);
- DefineButton(address_box.left-25, address_box.top-1, 23, skin.h-2, FORWARD+BT_HIDE, 0);
- img_draw stdcall(skin.image, address_box.left-50, address_box.top-2, 48, skin.h, 3, 0);
- // refrash
- DefineButton(address_box.left+address_box.width+1, address_box.top-2, 16, skin.h-1, REFRESH+BT_HIDE+BT_NOFRAME, 0);
+ DefineButton(address_box.left-49, address_box.top-2, 23, skin.h-2, BACK_BUTTON+BT_HIDE, 0);
+ DefineButton(address_box.left-25, address_box.top-2, 23, skin.h-2, FORWARD_BUTTON+BT_HIDE, 0);
+ img_draw stdcall(skin.image, address_box.left-50, address_box.top-3, 48, skin.h, 3, 0);
+ // refresh_BUTTON
+ DefineButton(address_box.left+address_box.width+1, address_box.top-3, 16, skin.h-1, REFRESH_BUTTON+BT_HIDE+BT_NOFRAME, 0);
if (http_transfer > 0) img_off = 131; else img_off = 52;
- img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-2, 17, skin.h, img_off, 0);
+ img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-3, 17, skin.h, img_off, 0);
// config
- DefineButton(Form.cwidth-23, address_box.top-2, 17, skin.h-1, 312+BT_HIDE, 0);
- img_draw stdcall(skin.image, Form.cwidth-22, address_box.top-2, 16, skin.h, 85, 0);
+ DefineButton(Form.cwidth-24, address_box.top-3, 19, skin.h-1, SANDWICH_BUTTON+BT_HIDE, 0);
+ img_draw stdcall(skin.image, Form.cwidth-22, address_box.top-3, 16, skin.h, 85, 0);
//status bar
DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,STATUSBAR_H, col_bg);
DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,1, border_color);
- wv_progress_bar.top = Form.cheight - STATUSBAR_H + 4;
ShowPage();
DrawRectangle(scroll_wv.start_x, scroll_wv.start_y, scroll_wv.size_x, scroll_wv.size_y-1, scroll_wv.bckg_col);
DrawProgress();
@@ -342,7 +358,7 @@ void Draw_Window()
void Scan(dword id__)
{
action_buf=0;
- if (id__ >= 400)
+ if (id__ >= 400) && (id__ < 1000)
{
ProcessLinks(id__);
return;
@@ -350,12 +366,12 @@ void Scan(dword id__)
switch (id__)
{
case SCAN_CODE_BS:
- case BUTTON_BACK:
+ case BACK_BUTTON:
if (!BrowserHistory.GoBack()) return;
OpenPage();
return;
- case FORWARD:
+ case FORWARD_BUTTON:
if (!BrowserHistory.GoForward()) return;
OpenPage();
return;
@@ -379,7 +395,34 @@ void Scan(dword id__)
WB1.Parse();
return;
- case 44: //Z-key down
+ case GOTOURL_BUTTON:
+ case SCAN_CODE_ENTER: //enter
+ if (!editURL[0]) return;
+ if (strncmp(#editURL,"http:",5)) && (editURL[0]!='/') && (strncmp(#editURL,"WebView:",9)) strncpy(#URL,"http://",7);
+ else
+ URL[0] = 0;
+ strcat(#URL, #editURL);
+ OpenPage();
+ return;
+
+ case 063: //F5
+ IF(address_box.flags & 0b10) return;
+ case REFRESH_BUTTON:
+ if (http_transfer > 0)
+ {
+ StopLoading();
+ Draw_Window();
+ }
+ else OpenPage();
+ return;
+
+ case SANDWICH_BUTTON:
+ mouse.y = TOOLBAR_H-6;
+ mouse.x = Form.cwidth - 167;
+ CreateThread(#menu_rmb,#stak+4092);
+ return;
+
+ case ZOOM2x:
if (WB1.DrawBuf.zoom==2)
{
WB1.DrawBuf.zoom=1;
@@ -393,64 +436,13 @@ void Scan(dword id__)
Draw_Window();
return;
- case GOTOURL:
- case SCAN_CODE_ENTER: //enter
- if (!editURL[0]) return;
- if (strncmp(#editURL,"http:",5)) && (editURL[0]!='/') && (strncmp(#editURL,"WebView:",9)) strncpy(#URL,"http://",7);
- else
- URL[0] = 0;
- strcat(#URL, #editURL);
- OpenPage();
- return;
-
- case REFRESH:
- if (http_transfer > 0)
- {
- StopLoading();
- Draw_Window();
- }
- else OpenPage();
- return;
-
-/*
- case 011: //Ctrk+K
- BufEncode(CH_KOI8);
- WB1.Parse();
- return;
- case 021: //Ctrl+U
- BufEncode(CH_UTF8);
- WB1.Parse();
- return;
- case 004: //Ctrl+D
- BufEncode(CH_CP866);
- WB1.Parse();
- return;
- case 005: //Win encoding
- BufEncode(CH_CP1251);
- WB1.Parse();
- return;
- case 009: //free img cache
- ImgCache.Free();
- notify(IMAGES_CACHE_CLEARED);
- WB1.Parse();
- return;
- case 003: //history
- strcpy(#URL, URL_SERVICE_HISTORY);
- OpenPage();
- return;
- case 006: //download manager
- if (!downloader_opened) {
- strncpy(#DL_URL, "http://",7);
- CreateThread(#Downloader,#downloader_stak+4092);
- }
- return;
-
- case 052: //F3
+ case VIEW_SOURCE:
WB1.list.first = 0;
ShowSource();
WB1.Parse();
break;
- case 053: //F4
+
+ case EDIT_SOURCE:
if (!strncmp(#URL,"http:",5))
{
WriteFile(bufsize, bufpointer, "/tmp0/1/WebView_tmp.htm");
@@ -458,26 +450,35 @@ void Scan(dword id__)
}
else RunProgram("/rd/1/tinypad", #URL);
return;
- case 054: //F5
- IF(address_box.flags & 0b10) return;
+ case FREE_IMG_CACHE:
+ ImgCache.Free();
+ notify(IMAGES_CACHE_CLEARED);
+ WB1.Parse();
+ return;
+
+ case VIEW_HISTORY:
+ strcpy(#URL, URL_SERVICE_HISTORY);
+ OpenPage();
+ return;
+
+ case DOWNLOAD_MANAGER:
+ if (!downloader_opened) {
+ strncpy(#DL_URL, "http://",7);
+ CreateThread(#Downloader,#downloader_stak+4092);
+ }
+ return;
+/*
case 020:
case NEWTAB:
MoveSize(190,80,OLD,OLD);
RunProgram(#program_path, #URL);
return;
- case SEARCHWEB:
+ case SEARCHWEB_BUTTON:
sprintf(#URL,"%s%s",#search_path,#editURL);
OpenPage();
return;
-
- case 312:
- SwitchToAnotherThread();
- mouse.y = TOOLBAR_H-6;
- mouse.x = Form.cwidth - 167;
- CreateThread(#menu_rmb,#stak+4092);
- return;
*/
}
}
@@ -564,7 +565,7 @@ void StopLoading()
bufpointer = free(bufpointer);
}
wv_progress_bar.value = 0;
- img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-2, 17, skin.h, 52, 0);
+ img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-3, 17, skin.h, 52, 0);
}
void SetPageDefaults()
@@ -594,7 +595,7 @@ void OpenPage()
}
if (!strncmp(#URL,"http:",5))
{
- img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-2, 17, skin.h, 131, 0);
+ img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-3, 17, skin.h, 131, 0);
http_get stdcall (#URL, 0, 0, #accept_language);
http_transfer = EAX;
if (!http_transfer)
diff --git a/programs/cmm/browser/menu_rmb.h b/programs/cmm/browser/menu_rmb.h
index db073840f0..582b2a96ca 100644
--- a/programs/cmm/browser/menu_rmb.h
+++ b/programs/cmm/browser/menu_rmb.h
@@ -1,26 +1,22 @@
//Leency - 2012-2013
char *ITEMS_LIST[]={
-"WIN Ctrl+E",05,
-"DOS Ctrl+D",04,
-"KOI Ctrl+K",11,
-"UTF Ctrl+U",21,
#ifdef LANG_RUS
-"Zoom 2x Z",122,
-"ᬮ 室 F3",52,
-" 室 F4",53,
-" ⨭" ,02,
-"" ,03,
-" 㧮" ,06,
+"Zoom 2x",
+"ᬮ 室",
+" 室",
+"",
+" ⨭",
+" 㧮",
#else
-"Zoom 2x Z",122,
-"View source F3",52,
-"Edit source F4",53,
-"Free image cache" ,09,
-"History" ,03,
-"Download Manager" ,06,
+"Zoom 2x",
+"View source",
+"Edit source",
+"History",
+"Free image cache",
+"Download Manager",
#endif
-0};
+0};
llist menu;
@@ -29,8 +25,8 @@ void menu_rmb()
proc_info MenuForm;
int key;
- menu.first = menu.current = 0;
- while (ITEMS_LIST[menu.count*2]) menu.count++;
+ menu.ClearList();
+ while (ITEMS_LIST[menu.count]) menu.count++;
menu.SetSizes(2,2,177,menu.count*19,19);
SetEventMask(100111b);
@@ -43,18 +39,14 @@ void menu_rmb()
mouse.get();
if (menu.ProcessMouse(mouse.x, mouse.y)) DrawMenuList();
- if (mouse.lkm)&&(mouse.up) { action_buf = ITEMS_LIST[menu.current*2+1]; ExitProcess(); }
+ if (mouse.lkm)&&(mouse.up) ItemClick();
break;
case evKey:
key = GetKey();
if (key==27) ExitProcess();
+ if (key==13) ItemClick();
if (menu.ProcessKey(key)) DrawMenuList();
- if (key==13)
- {
- action_buf = ITEMS_LIST[menu.current*2+1];
- ExitProcess();
- }
break;
case evReDraw:
@@ -76,14 +68,15 @@ void DrawMenuList()
else
{
DrawBar(menu.x, N*menu.line_h+menu.y, menu.w-3, menu.line_h, col_bg);
- WriteText(19,N*menu.line_h+9,0x80,0xf2f2f2,ITEMS_LIST[N*2]);
+ WriteText(19,N*menu.line_h+9,0x80,0xf2f2f2,ITEMS_LIST[N]);
}
- WriteText(18,N*menu.line_h+8,0x80,0x000000,ITEMS_LIST[N*2]);
+ WriteText(18,N*menu.line_h+8,0x80,0x000000,ITEMS_LIST[N]);
}
- if (cur_encoding!=CH_NULL)
- WriteText(5, cur_encoding*menu.line_h+7, 0x80, 0x777777, "\x10"); //show current encoding
- else
- WriteText(5, CH_CP866*menu.line_h+7, 0x80, 0x777777, "\x10"); //show current encoding
-
- if (WB1.DrawBuf.zoom == 2) DrawBar(6, 4*menu.line_h+8, 6, 6, 0x777777);
+ if (WB1.DrawBuf.zoom == 2) DrawBar(6, 8, 6, 6, 0x777777);
}
+
+void ItemClick()
+{
+ action_buf = ZOOM2x + menu.current;
+ ExitProcess();
+}
\ No newline at end of file
diff --git a/programs/cmm/browser/wv_skin.png b/programs/cmm/browser/wv_skin.png
index 91adf4cd33315e16c032e07734ba76458bb36206..439810a148bf02a9d9c72fd187e92aef221ee047 100644
GIT binary patch
delta 1975
zcmV;o2T1tT54aDI7k?E91^@s6pwP#u000MnNklG-3Mdi*VJuLK!sbIJlR+kN
zEN#TVzyNCKtKSdPMr!TCnt?TA)tDCdVi3gpAUuN4wPM8u(q~>pRX^L
zE?tUoZD1N4ECbr!Mt4EC5?GwfFc7dm&uG=F|P+FI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