From 228094c871a05e049acc7f55151d7912228dc289 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Thu, 14 Jan 2016 23:51:52 +0000 Subject: [PATCH] Aelia 0.33: add cursor pointer git-svn-id: svn://kolibrios.org@6059 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/aelia/aelia.c | 5 +++++ programs/cmm/aelia/buidin_pages/about.htm | Bin 554 -> 579 bytes programs/cmm/aelia/label.h | 4 ++-- programs/cmm/aelia/link.h | 17 +++++++++++------ programs/cmm/aelia/pointer.cur | Bin 0 -> 3262 bytes programs/cmm/aelia/prepare_page.h | 22 +++++++++++++++++----- 6 files changed, 35 insertions(+), 13 deletions(-) create mode 100644 programs/cmm/aelia/pointer.cur diff --git a/programs/cmm/aelia/aelia.c b/programs/cmm/aelia/aelia.c index 672c101c16..4d62abaed4 100644 --- a/programs/cmm/aelia/aelia.c +++ b/programs/cmm/aelia/aelia.c @@ -10,6 +10,7 @@ #include "../lib/obj/iconv.h" #include "../lib/obj/proc_lib.h" #include "../lib/obj/http.h" +#include "../lib/cursor.h" #include "../lib/patterns/libimg_load_skin.h" #include "../lib/patterns/simple_open_dialog.h" #include "../lib/patterns/history.h" @@ -55,6 +56,9 @@ char address[UML]="http://"; int mouse_address_box; edit_box address_box = {250,56,34,0xffffff,0x94AECE,0xffffff,0xffffff,0,UML,#address,#mouse_address_box,2,19,19}; +CustomCursor CursorPointer; +dword CursorFile = FROM "pointer.cur"; + #include "ini.h" #include "gui.h" #include "label.h" @@ -80,6 +84,7 @@ void main() { InitDlls(); OpenDialog_init stdcall (#o_dialog); + CursorPointer.Load(#CursorFile); label.init(DEFAULT_FONT); Libimg_LoadImage(#skin, abspath("toolbar.png")); LoadIniSettings(); diff --git a/programs/cmm/aelia/buidin_pages/about.htm b/programs/cmm/aelia/buidin_pages/about.htm index 0d53678a211180316c64155206daa495d68ca3af..6c156cf532b25457e8ff528bac4212f5c138e8ba 100644 GIT binary patch delta 118 zcmZ3*a+qa8(#AvsMi!f-BD={G8O0qz3|=nhlA;`Km;CZP1zm;W+{B!m)FOqn{Jat* x*^tB}kYs93YI2D}az8K%LSzMlk!t4flM3yjFQ|OAcFw_H02tl diff --git a/programs/cmm/aelia/label.h b/programs/cmm/aelia/label.h index 04245eefd3..7298cdcd25 100644 --- a/programs/cmm/aelia/label.h +++ b/programs/cmm/aelia/label.h @@ -23,11 +23,11 @@ void WriteTextIntoBuf(int _x, _y; dword _text_col, _text_off) { char error_message[128]; if (_x > list.w) { - sprintf(#error_message, "\nWriteTextIntoBuf _x overflow: H %d X %d \n", label.size.height, _x); + sprintf(#error_message, "'WriteTextIntoBuf _x overflow: H %d X %d' -A", label.size.height, _x); notify(#error_message); } if (_y+label.size.pt > label.size.height) { - sprintf(#error_message, "\nWriteTextIntoBuf _y overflow: H %d Y %d \n", label.size.height, _y); + sprintf(#error_message, "'WriteTextIntoBuf _y overflow: H %d Y %d' -A", label.size.height, _y); notify(#error_message); return; } diff --git a/programs/cmm/aelia/link.h b/programs/cmm/aelia/link.h index 831c848226..4bf8110660 100644 --- a/programs/cmm/aelia/link.h +++ b/programs/cmm/aelia/link.h @@ -34,7 +34,7 @@ int _link::hover() //char tempp[4096]; dword color; int i; - active = 0; + active = -1; mouse.x = mouse.x - list.x; mouse.y = mouse.y - list.y; for (i=0; ilink.x[i]) && (-list.first*list.item_h+link.y[i]mouse.y) - color = 0xFF0000; - else - color = 0xCCCccc; - DrawRectangle(link.x[i]+list.x+1, -list.first*list.item_h+link.y[i]+list.y, link.w[i], link.h[i], color); + && (-list.first*list.item_h+link.y[i]+link.h[i]>mouse.y) { + color = 0xFFFfff; + CursorPointer.Set(); + active = i; + } + else { + color = 0x0000FF; + } + DrawBar(link.x[i]+list.x, -list.first*list.item_h+link.y[i]+list.y+link.h[i]-1, link.w[i], 1, color); } } + if (active==-1) CursorPointer.Restore(); return false; } \ No newline at end of file diff --git a/programs/cmm/aelia/pointer.cur b/programs/cmm/aelia/pointer.cur new file mode 100644 index 0000000000000000000000000000000000000000..580bb75fa8942453b6e7b250e6f7351823c47b3d GIT binary patch literal 3262 zcmeH`F>ZrE5JiVrmYYcFtdtgw({lkAT!Hi0C1s9bafLKF09QatLyIUVoNE2-kw<6~ z7uhvcSZRh~7v9YL-4%I~L^d0drHCA#MbeDFbqc4)b?3$V0;MNS!*g7=>0h6$E)GNc^&hAuEx(y&F7qO zc-YqXQtuH+ac?PX-fqwzg45Qy)5^IX`&u~nd9g(8z*9!{PTaHJzhHZeJU9C$J_B^J B+LizS literal 0 HcmV?d00001 diff --git a/programs/cmm/aelia/prepare_page.h b/programs/cmm/aelia/prepare_page.h index 77f9c4d66f..415a11d35f 100644 --- a/programs/cmm/aelia/prepare_page.h +++ b/programs/cmm/aelia/prepare_page.h @@ -53,9 +53,9 @@ int stroka_y=5, line_length=0; } } if (draw==false) { - list.count = stroka_y/list.item_h+2; + list.count = stroka_y/list.item_h+3; if (list.count < list.visible) list.count = list.visible; - label.size.height = list.count+1*list.item_h; + label.size.height = list.count+5*list.item_h; label.raw_size = 0; } if (draw==true) WriteTextIntoBuf(8, stroka_y, 0x000000, line_start); @@ -171,6 +171,7 @@ dword DOM_pos; strcpy(#title, text.start); continue; } + strtrim(text.start); while (get_label_len(text.start) + stroka_x + 30 > list.w) { zeroch = 0; @@ -186,6 +187,7 @@ dword DOM_pos; label_draw_bar(stroka_x, stroka_y+label.size.pt+1, get_label_len(text.start), style.color); } WriteTextIntoBuf(stroka_x, stroka_y, style.color, text.start); + stroka_x+=char_width[' ']; } ESBYTE[line_break] >< zeroch; //restore line text.start = line_break; @@ -198,6 +200,7 @@ dword DOM_pos; label_draw_bar(stroka_x, stroka_y+label.size.pt+1, get_label_len(text.start), style.color); } WriteTextIntoBuf(stroka_x, stroka_y, style.color, text.start); + stroka_x+=char_width[' ']; } stroka_x += get_label_len(text.start); } @@ -205,11 +208,20 @@ dword DOM_pos; ESBYTE[DOM_pos] = '\0'; text.start = DOM_pos + 1; tag.parce(); - if (tag.nameis("br")) || (tag.nameis("p")) || (tag.nameis("div")) || (tag.nameis("h1")) || (tag.nameis("h2")) { + if (tag.nameis("br")) + || (tag.nameis("p")) + || (tag.nameis("div")) + || (tag.nameis("tr")) { stroka_y+= list.item_h; stroka_x = HTML_PADDING_X; continue; } + if (tag.nameis("h1")) || (tag.nameis("/h1")) + || (tag.nameis("h2")) || (tag.nameis("/h2")) { + stroka_y+= list.item_h; + stroka_x = HTML_PADDING_X; + continue; + } if (tag.nameis("script")) || (tag.nameis("style")) style.ignore = true; if (tag.nameis("/script")) || (tag.nameis("/style")) style.ignore = false; if (tag.nameis("a")) { style.a = true; style.color=0x0000FF; } @@ -217,9 +229,9 @@ dword DOM_pos; } } if (draw==false) { - list.count = stroka_y/list.item_h+2; + list.count = stroka_y/list.item_h+3; if (list.count < list.visible) list.count = list.visible; - label.size.height = list.count+1*list.item_h; + label.size.height = list.count+5*list.item_h; label.raw_size = 0; } free(DOM.start);