/programs/cmm/aelia/aelia.c |
---|
88,7 → 88,7 |
InitDlls(); |
OpenDialog_init stdcall (#o_dialog); |
CursorPointer.Load(#CursorFile); |
label.init(DEFAULT_FONT); |
kfont.init(DEFAULT_FONT); |
Libimg_LoadImage(#skin, abspath("toolbar.png")); |
LoadIniSettings(); |
list.no_selection = true; |
328,9 → 328,9 |
void EventMagnifyPlus() |
{ |
label.size.pt++; |
if(!label.changeSIZE()) |
label.size.pt--; |
kfont.size.pt++; |
if(!kfont.changeSIZE()) |
kfont.size.pt--; |
else |
PreparePage(); |
} |
337,9 → 337,9 |
void EventMagnifyMinus() |
{ |
label.size.pt--; |
if(!label.changeSIZE()) |
label.size.pt++; |
kfont.size.pt--; |
if(!kfont.changeSIZE()) |
kfont.size.pt++; |
else |
PreparePage(); |
} |
435,7 → 435,7 |
} |
else |
{ |
if (!label.raw) { //this code need to be run |
if (!kfont.raw) { //this code need to be run |
if (param) EventOpenAddress(#param); //only once at browser sturtup |
else EventOpenAddress("aelia:home"); |
} |
448,7 → 448,7 |
void DrawPage() |
{ |
list.CheckDoesValuesOkey(); |
if (list.count) _PutImage(list.x,list.y,list.w,list.h,list.first*list.item_h*list.w*3 + label.raw); |
if (list.count) _PutImage(list.x,list.y,list.w,list.h,list.first*list.item_h*list.w*3 + kfont.raw); |
DrawScroller(); |
} |
/programs/cmm/aelia/ini.h |
---|
4,7 → 4,7 |
void LoadIniSettings() |
{ |
label.size.pt = 14; |
kfont.size.pt = 14; |
encoding = CH_CP866; |
Form.left = 150; |
Form.top = 50; |
12,7 → 12,7 |
Form.height = 560; |
/* |
strcpy(#ini_path, "/sys/settings/treader.ini"); |
ini_get_int stdcall (#ini_path, #config_section, "FontSize", 14); label.size.pt = EAX; |
ini_get_int stdcall (#ini_path, #config_section, "FontSize", 14); kfont.size.pt = EAX; |
ini_get_int stdcall (#ini_path, #config_section, "Encoding", CH_CP866); encoding = EAX; |
ini_get_int stdcall (#ini_path, #config_section, "WinX", 150); Form.left = EAX; |
ini_get_int stdcall (#ini_path, #config_section, "WinY", 50); Form.top = EAX; |
24,7 → 24,7 |
void SaveIniSettings() |
{ |
/* |
ini_set_int stdcall (#ini_path, #config_section, "FontSize", label.size.pt); |
ini_set_int stdcall (#ini_path, #config_section, "FontSize", kfont.size.pt); |
ini_set_int stdcall (#ini_path, #config_section, "Encoding", encoding); |
ini_set_int stdcall (#ini_path, #config_section, "WinX", Form.left); |
ini_set_int stdcall (#ini_path, #config_section, "WinY", Form.top); |
/programs/cmm/aelia/label.h |
---|
3,8 → 3,8 |
void get_label_symbols_size() |
{ |
int i; |
label.changeSIZE(); |
for (i=0; i<256; i++) char_width[i] = label.symbol_size(i); |
kfont.changeSIZE(); |
for (i=0; i<256; i++) char_width[i] = kfont.symbol_size(i); |
} |
int get_label_len(dword _text) |
23,15 → 23,15 |
{ |
char error_message[128]; |
if (_x > list.w) { |
sprintf(#error_message, "'WriteTextIntoBuf _x overflow: H %d X %d' -A", label.size.height, _x); |
sprintf(#error_message, "'WriteTextIntoBuf _x overflow: H %d X %d' -A", kfont.size.height, _x); |
notify(#error_message); |
} |
if (_y+label.size.pt > label.size.height) { |
sprintf(#error_message, "'WriteTextIntoBuf _y overflow: H %d Y %d' -A", label.size.height, _y); |
if (_y+kfont.size.pt > kfont.size.height) { |
sprintf(#error_message, "'WriteTextIntoBuf _y overflow: H %d Y %d' -A", kfont.size.height, _y); |
notify(#error_message); |
return; |
} |
label.WriteIntoBuffer(_x, _y, list.w, label.size.height, 0xFFFFFF, _text_col, label.size.pt, _text_off); |
kfont.WriteIntoBuffer(_x, _y, list.w, kfont.size.height, 0xFFFFFF, _text_col, kfont.size.pt, _text_off); |
if (_y/list.item_h-list.first==list.visible) DrawPage(); |
} |
39,5 → 39,5 |
void label_draw_bar(dword _x, _y, _w, _color) |
{ |
int i; |
for (i = _y*list.w+_x*3+label.raw ; i<_y*list.w+_x+_w*3+label.raw ; i+=3) ESDWORD[i] = _color; |
for (i = _y*list.w+_x*3+kfont.raw ; i<_y*list.w+_x+_w*3+kfont.raw ; i+=3) ESDWORD[i] = _color; |
} |
/programs/cmm/aelia/prepare_page.h |
---|
1,7 → 1,7 |
void PreparePage() |
{ |
list.SetSizes(0, TOOLBAR_H, Form.cwidth-scroll.size_x-1, Form.cheight-TOOLBAR_H, label.size.pt+2); |
list.SetSizes(0, TOOLBAR_H, Form.cwidth-scroll.size_x-1, Form.cheight-TOOLBAR_H, kfont.size.pt+2); |
strcpy(#title, history.current()+strrchr(history.current(),'/')); |
//get font chars width, need to increase performance |
get_label_symbols_size(); |
20,7 → 20,7 |
} |
strcat(#title, " - Aelia"); |
DrawTitle(#title); |
DrawProgress(STEP_4_SMOOTH_FONT); label.ApplySmooth(); |
DrawProgress(STEP_4_SMOOTH_FONT); kfont.ApplySmooth(); |
DrawProgress(STEP_5_STOP); DrawPage(); |
} |
57,8 → 57,8 |
if (draw==false) { |
list.count = stroka_y/list.item_h+3; |
if (list.count < list.visible) list.count = list.visible; |
label.size.height = list.count+5*list.item_h; |
label.raw_size = 0; |
kfont.size.height = list.count+5*list.item_h; |
kfont.raw_size = 0; |
} |
if (draw==true) WriteTextIntoBuf(8, stroka_y, 0x000000, line_start); |
} |
124,7 → 124,7 |
if (draw==true) { |
if (style.a) { |
link.add(stroka_x,stroka_y + size_pt_change,get_label_len(text.start),list.item_h,text.start," "); |
label_draw_bar(stroka_x, stroka_y+label.size.pt+1, get_label_len(text.start), style.color); |
label_draw_bar(stroka_x, stroka_y+kfont.size.pt+1, get_label_len(text.start), style.color); |
} |
WriteTextIntoBuf(stroka_x, stroka_y, style.color, text.start); |
} |
137,7 → 137,7 |
if (draw==true) { |
if (style.a) { |
link.add(stroka_x,stroka_y + size_pt_change,get_label_len(text.start),list.item_h,text.start," "); |
label_draw_bar(stroka_x, stroka_y+label.size.pt+1, get_label_len(text.start), style.color); |
label_draw_bar(stroka_x, stroka_y+kfont.size.pt+1, get_label_len(text.start), style.color); |
} |
WriteTextIntoBuf(stroka_x, stroka_y, style.color, text.start); |
} |
172,7 → 172,7 |
} else if (tag.nameis("/h3")) { |
size_pt_change = -4; |
} |
label.size.pt += size_pt_change; |
kfont.size.pt += size_pt_change; |
get_label_symbols_size(); |
if (size_pt_change > 0) { |
stroka_y+= list.item_h;//что если будет очень длинная строка в теге? |
192,8 → 192,8 |
if (draw==false) { |
list.count = stroka_y/list.item_h+3; |
if (list.count < list.visible) list.count = list.visible; |
label.size.height = list.count+5*list.item_h; |
label.raw_size = 0; |
kfont.size.height = list.count+5*list.item_h; |
kfont.raw_size = 0; |
} |
free(DOM_start); |
} |