fix menu component (found by tsdima), apps size decrease a bit, improve Appearance preview

git-svn-id: svn://kolibrios.org@7252 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2018-04-21 12:28:00 +00:00
parent 330d103dec
commit 72a2097e37
14 changed files with 75 additions and 68 deletions

View File

@ -53,6 +53,9 @@ block skp;
_tabs tabs = { LP, LP, NULL, NULL, SKINS }; _tabs tabs = { LP, LP, NULL, NULL, SKINS };
checkbox checkbox1 = { "Checkbox", true }; checkbox checkbox1 = { "Checkbox", true };
more_less_box spinbox1 = { 23, 0, 999, "SpinBox" };
edit_box edit1 = {180,NULL,NULL,0xffffff,0x94AECE,0xFFFfff,0xffffff,
0x10000000,sizeof(param),#param,0, 0b};
#define MENU_LIST "Open file Enter\nDelete Del" #define MENU_LIST "Open file Enter\nDelete Del"
@ -74,6 +77,7 @@ void main()
case evMouse: case evMouse:
if (!CheckActiveProcess(Form.ID)) break; if (!CheckActiveProcess(Form.ID)) break;
SelectList_ProcessMouse(); SelectList_ProcessMouse();
edit_box_mouse stdcall (#edit1);
if (mouse.pkm)&&(select_list.MouseOver(mouse.x, mouse.y)) { if (mouse.pkm)&&(select_list.MouseOver(mouse.x, mouse.y)) {
select_list.ProcessMouse(mouse.x, mouse.y); select_list.ProcessMouse(mouse.x, mouse.y);
@ -88,6 +92,7 @@ void main()
if (id==SKINS) EventTabClick(SKINS); if (id==SKINS) EventTabClick(SKINS);
if (id==WALLPAPERS) EventTabClick(WALLPAPERS); if (id==WALLPAPERS) EventTabClick(WALLPAPERS);
checkbox1.click(id); checkbox1.click(id);
spinbox1.click(id);
break; break;
case evKey: case evKey:
@ -109,11 +114,13 @@ void main()
break; break;
} }
} }
EAX= key_ascii << 8;
edit_box_key stdcall (#edit1);
break; break;
case evReDraw: case evReDraw:
system.color.get(); system.color.get();
DefineAndDrawWindow(screen.width-600/2,80,600,404+skin_height,0x73,0xE4DFE1,WINDOW_HEADER,0); DefineAndDrawWindow(screen.width-600/2,80,630,404+skin_height,0x74,0xE4DFE1,WINDOW_HEADER,0);
GetProcessInfo(#Form, SelfInfo); GetProcessInfo(#Form, SelfInfo);
IF (Form.status_window>=2) break; IF (Form.status_window>=2) break;
DrawWindowContent(); DrawWindowContent();
@ -129,6 +136,7 @@ void main()
void DrawWindowContent() void DrawWindowContent()
{ {
int id; int id;
incn y;
DrawWideRectangle(0, 0, Form.cwidth, Form.cheight, LP, system.color.work); DrawWideRectangle(0, 0, Form.cwidth, Form.cheight, LP, system.color.work);
@ -150,10 +158,10 @@ void DrawWindowContent()
select_list.cur_y = id; select_list.cur_y = id;
skp.set_size( skp.set_size(
select_list.x + select_list.w + TAB_PADDING + scroll1.size_x, select_list.x + select_list.w + TAB_PADDING + scroll1.size_x + 20,
select_list.y, select_list.y + 30,
250, 250,
250 select_list.h - 50
); );
SelectList_Draw(); SelectList_Draw();
@ -161,12 +169,16 @@ void DrawWindowContent()
if (tabs.active_tab == SKINS) if (tabs.active_tab == SKINS)
{ {
DrawBar(skp.x, skp.y, skp.w, skp.h, system.color.work); DrawBar(skp.x-20, select_list.y, skp.w+40, select_list.h, system.color.work);
DrawRectangle(skp.x-20, select_list.y, skp.w+40, select_list.h, system.color.work_graph);
y.n = skp.y;
DrawFrame(skp.x, skp.y, skp.w, skp.h, " Components Preview "); DrawFrame(skp.x, skp.y, skp.w, skp.h, " Components Preview ");
WriteText(skp.x+20, skp.y+30, 0x90, system.color.work_text, "Lorem ipsum"); checkbox1.draw(skp.x+20, y.inc(30));
checkbox1.draw(skp.x+20, skp.y+70); spinbox1.draw(skp.x+20, y.inc(30));
DrawStandartCaptButton(skp.x+20, skp.y+skp.h-40, GetFreeButtonId(), "Apply"); WriteText(skp.x+20, y.inc(30), 0x90, system.color.work_text, "Edit box");
DrawStandartCaptButton(skp.x+120, skp.y+skp.h-40, GetFreeButtonId(), "Close"); DrawEditBoxPos(skp.x+20, y.inc(20), #edit1);
DrawStandartCaptButton(skp.x+20, skp.y+skp.h-40, GetFreeButtonId(), "Button1");
DrawStandartCaptButton(skp.x+120, skp.y+skp.h-40, GetFreeButtonId(), "Button2");
} }
} }

View File

@ -36,8 +36,7 @@ dword io_buffer_data;
#define BUTTON_CHANGE_LANGUAGE 10 #define BUTTON_CHANGE_LANGUAGE 10
int active_dict=2; int active_dict=2;
int mouse_dd; edit_box edit1= {200,13,13,0xffffff,0x94AECE,0xffffff,0x94AECE,0x10000000,248,#edit_text,0,100000000000010b};
edit_box edit1= {200,13,13,0xffffff,0x94AECE,0xffffff,0x94AECE,0x10000000,248,#edit_text,#mouse_dd,100000000000010b};

View File

@ -6,11 +6,10 @@
char default_dir[] = "/rd/1"; char default_dir[] = "/rd/1";
od_filter filter2 = {0,0}; od_filter filter2 = {0,0};
int mouse_dd1, mouse_dd2;
char src_box_text[4096]; char src_box_text[4096];
char dst_box_text[4096]; char dst_box_text[4096];
edit_box src_box = {340,20,35,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,sizeof(src_box_text),#src_box_text,#mouse_dd1, 10b}; edit_box src_box = {340,20,35,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,sizeof(src_box_text),#src_box_text,0, 10b};
edit_box dst_box = {340,20,95,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,sizeof(dst_box_text),#dst_box_text,#mouse_dd2, 0b}; edit_box dst_box = {340,20,95,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,sizeof(dst_box_text),#dst_box_text,0, 0b};
#define BID_EXIT_PRC 01 #define BID_EXIT_PRC 01
#define BID_SRC_OPEN 10 #define BID_SRC_OPEN 10

View File

@ -53,9 +53,8 @@ char save_path[4096];
char save_path_stable[4096]; char save_path_stable[4096];
char open_dir[4096]; char open_dir[4096];
dword mouse_dd1;
edit_box edit_save = {250,25,100,0xffffff,0x94AECE,0xFFFfff,0xffffff, edit_box edit_save = {250,25,100,0xffffff,0x94AECE,0xFFFfff,0xffffff,
0x10000000,sizeof(save_path),#save_path,#mouse_dd1, 0b}; 0x10000000,sizeof(save_path),#save_path,0, 0b};
more_less_box delay = { 1, 0, 64, T_DELAY }; more_less_box delay = { 1, 0, 64, T_DELAY };
checkbox minimize = { T_MINIMIZE, true }; checkbox minimize = { T_MINIMIZE, true };

View File

@ -91,7 +91,7 @@ char scroll_used=false;
dword menu_stak,about_stak,properties_stak,settings_stak,copy_stak,delete_stak; dword menu_stak,about_stak,properties_stak,settings_stak,copy_stak,delete_stak;
proc_info Form; proc_info Form;
int mouse_dd, sc_slider_h; int sc_slider_h;
int j, i; int j, i;
int action_buf; int action_buf;
int rand_n; int rand_n;
@ -110,7 +110,8 @@ int status_bar_h = 0;
int icon_size = 16; int icon_size = 16;
edit_box new_file_ed = {200,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0x10000000,248,#new_element_name,#mouse_dd,100000000000010b,6,0}; edit_box new_file_ed = {200,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0x10000000,
248,#new_element_name,0,100000000000010b,6,0};
PathShow_data FileShow = {0, 56,215, 8, 100, 1, 0, 0x0, 0xFFFfff, #file_name, #temp, 0}; PathShow_data FileShow = {0, 56,215, 8, 100, 1, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
byte cmd_free=0; byte cmd_free=0;
#include "include\translations.h" #include "include\translations.h"

View File

@ -33,10 +33,9 @@
int WinX, WinY, WinW, WinH; int WinX, WinY, WinW, WinH;
dword set_mouse_dd; char path_start[4096];
char path_start[4096]="\0";
edit_box path_start_ed = {290,50,57,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,4098, edit_box path_start_ed = {290,50,57,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,4098,
#path_start,#set_mouse_dd, 100000000000010b,0,0}; #path_start,0, 100000000000010b,0,0};
more_less_box font_size = { NULL, 9, 22, FONT_SIZE_LABEL }; more_less_box font_size = { NULL, 9, 22, FONT_SIZE_LABEL };
more_less_box line_height = { NULL, 16, 64, LIST_LINE_HEIGHT }; more_less_box line_height = { NULL, 16, 64, LIST_LINE_HEIGHT };
@ -168,8 +167,7 @@ void LoadIniSettings()
WinH = ini.GetInt("WinH", 506); WinH = ini.GetInt("WinH", 506);
ini.GetString("DefaultPath", #path, 4096, "/rd/1"); ini.GetString("DefaultPath", #path, 4096, "/rd/1");
ini.GetString("DefaultPath", #path_start, 4096, "/rd/1"); ini.GetString("DefaultPath", #path_start, 4096, "/rd/1");
path_start_ed.size = strlen(#path_start); path_start_ed.size = path_start_ed.pos = strlen(#path_start);
path_start_ed.pos = strlen(#path_start);
ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font file",#temp,4096,DEFAULT_FONT); ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font file",#temp,4096,DEFAULT_FONT);
kfont.init(#temp); kfont.init(#temp);

View File

@ -1,4 +1,4 @@
dword menu_process_id;
struct _menu struct _menu
{ {
@ -20,7 +20,7 @@ void _menu::show(dword _appear_x, _appear_y, _menu_width, _text, _identifier)
list.count = chrnum(text, '\n')+1; list.count = chrnum(text, '\n')+1;
list.SetSizes(2,2,_menu_width,list.count*24,24); list.SetSizes(2,2,_menu_width,list.count*24,24);
CreateThread(#_menu_thread,#stak+4092); menu_process_id = CreateThread(#_menu_thread,#stak+4092);
} }
void _menu_thread() void _menu_thread()
@ -64,11 +64,11 @@ void _menu_draw_list()
void _menu_item_click() void _menu_item_click()
{ {
menu.list.cur_y = menu.identifier + menu.list.cur_y; menu.list.cur_y = menu.identifier + menu.list.cur_y;
ExitProcess(); KillProcess(menu_process_id);
} }
void _menu_no_item_click() void _menu_no_item_click()
{ {
menu.list.cur_y = 0; menu.list.cur_y = 0;
ExitProcess(); KillProcess(menu_process_id);
} }

View File

@ -7,14 +7,14 @@
#endif #endif
dword iconv_lib = #a_iconv_lib; dword iconv_lib = #a_iconv_lib;
char a_iconv_lib[19]="/sys/lib/iconv.obj\0"; char a_iconv_lib[]="/sys/lib/iconv.obj";
dword iconv_open = #aIconv_open; dword iconv_open = #aIconv_open;
dword iconv = #aIconv; dword iconv = #aIconv;
$DD 2 dup 0 $DD 2 dup 0
char aIconv_open[11] = "iconv_open\0"; char aIconv_open[] = "iconv_open";
char aIconv[6] = "iconv\0"; char aIconv[] = "iconv";
dword ChangeCharset(dword from_chs, to_chs, conv_buf) dword ChangeCharset(dword from_chs, to_chs, conv_buf)

View File

@ -20,7 +20,7 @@
//library //library
dword libimg = #alibimg; dword libimg = #alibimg;
char alibimg[21] = "/sys/lib/libimg.obj\0"; char alibimg[] = "/sys/lib/libimg.obj";
dword libimg_init = #alibimg_init; dword libimg_init = #alibimg_init;
dword img_is_img = #aimg_is_img; dword img_is_img = #aimg_is_img;
@ -36,16 +36,16 @@ dword img_encode = #aimg_encode;
$DD 2 dup 0 $DD 2 dup 0
//import libimg , \ //import libimg , \
char alibimg_init[9] = "lib_init\0"; char alibimg_init[] = "lib_init";
char aimg_is_img[11] = "img_is_img\0"; char aimg_is_img[] = "img_is_img";
char aimg_to_rgb2[12] = "img_to_rgb2\0"; char aimg_to_rgb2[] = "img_to_rgb2";
char aimg_decode[11] = "img_decode\0"; char aimg_decode[] = "img_decode";
char aimg_destroy[12] = "img_destroy\0"; char aimg_destroy[] = "img_destroy";
char aimg_draw[9] = "img_draw\0"; char aimg_draw[] = "img_draw";
char aimg_create[11] = "img_create\0"; char aimg_create[] = "img_create";
char aimg_encode[11] = "img_encode\0"; char aimg_encode[] = "img_encode";
//char aimg_flip[9] = "img_flip\0"; //char aimg_flip[] = "img_flip";
//char aimg_rotate[11] = "img_rotate\0 "; //char aimg_rotate[] = "img_rotate ";
#define LIBIMG_FORMAT_BMP 1 #define LIBIMG_FORMAT_BMP 1
#define LIBIMG_FORMAT_ICO 2 #define LIBIMG_FORMAT_ICO 2

View File

@ -12,7 +12,7 @@
//library //library
dword libio = #alibio; dword libio = #alibio;
char alibio[21] = "/sys/lib/libio.obj\0"; //"libio.obj\0"; char alibio[] = "/sys/lib/libio.obj"; //"libio.obj";
dword libio_init = #alibio_init; dword libio_init = #alibio_init;
dword file_size = #afile_size; dword file_size = #afile_size;
@ -23,11 +23,11 @@ $DD 2 dup 0
//import libio , \ //import libio , \
char alibio_init[9] = "lib_init\0"; char alibio_init[] = "lib_init";
char afile_size[11] = "file_size\0"; char afile_size[] = "file_size";
char afile_open[12] = "file_open\0"; char afile_open[] = "file_open";
char afile_read[11] = "file_read\0"; char afile_read[] = "file_read";
char afile_close[12] = "file_close\0"; char afile_close[] = "file_close";
//align 4 //align 4
//dword fh=0; //dword fh=0;

View File

@ -10,16 +10,16 @@
#include "../lib/dll.h" #include "../lib/dll.h"
#endif #endif
dword netcode_lib = #a_netcode_lib; dword netcode_lib = #a_netcode_lib;
char a_netcode_lib[21]="/sys/lib/netcode.obj\0"; char a_netcode_lib[]="/sys/lib/netcode.obj";
dword base64_encode = #aBase64_encode; dword base64_encode = #aBase64_encode;
dword base64_decode = #aBase64_decode; dword base64_decode = #aBase64_decode;
dword qp_decode = #aQp_decode; dword qp_decode = #aQp_decode;
$DD 2 dup 0 $DD 2 dup 0
char aBase64_encode[14] = "base64_encode\0"; char aBase64_encode[] = "base64_encode";
char aBase64_decode[14] = "base64_decode\0"; char aBase64_decode[] = "base64_decode";
char aQp_decode[10] = "qp_decode\0"; char aQp_decode[] = "qp_decode";
/*int base64_encode(char inp[], char outp[], int len); /*int base64_encode(char inp[], char outp[], int len);
Кодирование массива inp длиной len в массив outp (строку с '\0'). Функция возвращает длину outp. Кодирование массива inp длиной len в массив outp (строку с '\0'). Функция возвращает длину outp.

View File

@ -10,7 +10,7 @@
#include "../lib/dll.h" #include "../lib/dll.h"
#endif #endif
dword network_lib = #a_network_lib; dword network_lib = #a_network_lib;
char a_network_lib[21]="/sys/lib/network.obj\0"; char a_network_lib[]="/sys/lib/network.obj";
dword network_lib_init = #aLib_init; dword network_lib_init = #aLib_init;
dword inet_addr = #aInet_addr; //"192.168.0.1" -> dword IP dword inet_addr = #aInet_addr; //"192.168.0.1" -> dword IP
@ -22,14 +22,14 @@ dword getaddrinfo_abort = #aGetaddrinfo_abort;
dword freeaddrinfo = #aFreeaddrinfo; dword freeaddrinfo = #aFreeaddrinfo;
$DD 2 dup 0 $DD 2 dup 0
char aLib_init[9] = "lib_init\0"; char aLib_init[] = "lib_init";
char aInet_addr[10] = "inet_addr\0"; char aInet_addr[] = "inet_addr";
char aInet_ntoa[10] = "inet_ntoa\0"; char aInet_ntoa[] = "inet_ntoa";
char aGetaddrinfo[12] = "getaddrinfo\0"; char aGetaddrinfo[] = "getaddrinfo";
char aGetaddrinfo_start[18] = "getaddrinfo_start\0"; char aGetaddrinfo_start[] = "getaddrinfo_start";
char aGetaddrinfo_process[20] = "getaddrinfo_process\0"; char aGetaddrinfo_process[] = "getaddrinfo_process";
char aGetaddrinfo_abort[18] = "getaddrinfo_abort\0"; char aGetaddrinfo_abort[] = "getaddrinfo_abort";
char aFreeaddrinfo[13] = "freeaddrinfo\0"; char aFreeaddrinfo[] = "freeaddrinfo";
/* /*
addr соответствует IP 10.101.102.103 addr соответствует IP 10.101.102.103

View File

@ -2,15 +2,14 @@
char *text1[] = {"POP server adress:", "POP server port:", "SMTP server adress:", "SMTP server port:", '\0'}; char *text1[] = {"POP server adress:", "POP server port:", "SMTP server adress:", "SMTP server port:", '\0'};
dword mouse_opt;
unsigned char POP_server1[128]="pop.server.com"; unsigned char POP_server1[128]="pop.server.com";
unsigned char POP_server_port1[5]="110"; unsigned char POP_server_port1[5]="110";
unsigned char SMTP_server1[128]="smtp.server.com"; unsigned char SMTP_server1[128]="smtp.server.com";
unsigned char SMTP_server_port1[5]="25"; unsigned char SMTP_server_port1[5]="25";
edit_box POP_server_box = {210,230,125 ,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,sizeof(POP_server1),#POP_server1,#mouse_opt,100000000000b}; edit_box POP_server_box = {210,230,125 ,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,sizeof(POP_server1),#POP_server1,0,100000000000b};
edit_box POP_server_port_box = {210,230,160,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,5,#POP_server_port1,#mouse_opt,100000000000b}; edit_box POP_server_port_box = {210,230,160,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,5,#POP_server_port1,0,100000000000b};
edit_box SMTP_server_box = {210,230,195,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,sizeof(SMTP_server1),#SMTP_server1,#mouse_opt,100000000000b}; edit_box SMTP_server_box = {210,230,195,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,sizeof(SMTP_server1),#SMTP_server1,0,100000000000b};
edit_box SMTP_server_port_box = {210,230,230,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,5,#SMTP_server_port1,#mouse_opt,100000000000b}; edit_box SMTP_server_port_box = {210,230,230,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,5,#SMTP_server_port1,0,100000000000b};
checkbox automatic = { "Automatic configuration", true }; checkbox automatic = { "Automatic configuration", true };

View File

@ -41,9 +41,9 @@ unsigned char icons[] = FROM "icons.raw";
#define TOPPANELH 68 #define TOPPANELH 68
#define BOTPANELH 26 #define BOTPANELH 26
int mouse_dd;
char new_disk_size[5]; char new_disk_size[5];
edit_box edit_disk_size= {50,0,7,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,4,#new_disk_size,#mouse_dd, 1000000000000010b}; edit_box edit_disk_size= {50,0,7,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,
4,#new_disk_size,0, 1000000000000010b};
void Main_Window() void Main_Window()
{ {