From deb780f6ba1b4c1584294ffa3af83fd782ed9157 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Thu, 11 Feb 2016 02:22:34 +0000 Subject: [PATCH] cmm: editbox convex git-svn-id: svn://kolibrios.org@6193 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/lib/gui.h | 14 ++++++++++++++ programs/cmm/liza/login.c | 8 ++------ programs/cmm/tmpdisk/t_gui.c | 25 ++++++++++++------------- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/programs/cmm/lib/gui.h b/programs/cmm/lib/gui.h index d4941a8070..8fff53391b 100644 --- a/programs/cmm/lib/gui.h +++ b/programs/cmm/lib/gui.h @@ -107,6 +107,20 @@ DrawRectangle3D(x-1,y-1,VALUE_FIELD_W+SIZE+SIZE+2,SIZE+2,system.color.work_dark,system.color.work_light); } +:void EditBox(dword edit_box_pointer) +{ + dword x,y,w,h; + ESI = edit_box_pointer; + x = ESI.edit_box.left; + y = ESI.edit_box.top; + w = ESI.edit_box.width+1; + h = 15; + DrawRectangle(x-1, y-1, w+2, h+2, 0xFFFfff); + DrawRectangle3D(x-2, y-2, w+2, h+2, 0xDDDddd, 0xffffff); + DrawRectangle(x-3, y-3, w+6, h+6, system.color.work_graph); + DrawRectangle3D(x-4, y-4, w+8, h+8, system.color.work_dark, system.color.work_light); +} + :void DrawProgressBar(dword st_x, st_y, st_w, st_h, col_fon, col_border, col_fill, col_text, progress_percent) { int progress_w; diff --git a/programs/cmm/liza/login.c b/programs/cmm/liza/login.c index 4dc658790d..c8c0a10248 100644 --- a/programs/cmm/liza/login.c +++ b/programs/cmm/liza/login.c @@ -181,20 +181,16 @@ void DrawLoginScreen() DrawBar(0,0, Form.cwidth, Form.cheight, system.color.work); WriteText(panel_x,panel_y,0x80,system.color.work_text,"Your Email:"); - DrawRectangle(panel_x, panel_y+12, PANEL_W,20, system.color.work_graph); //border - DrawRectangle3D(panel_x+1, panel_y+13, PANEL_W-2,18, 0xDDDddd, 0xFFFfff); //shadow - DrawRectangle(panel_x+2, panel_y+14, PANEL_W-4,16, 0xFFFfff); login_box.left = panel_x+3; login_box.top = panel_y+15; edit_box_draw stdcall(#login_box); + EditBox(#login_box); WriteText(panel_x,panel_y+40,0x80,system.color.work_text,"Password:"); - DrawRectangle(panel_x, panel_y+52, PANEL_W,20, system.color.work_graph); //border - DrawRectangle3D(panel_x+1, panel_y+53, PANEL_W-2,18, 0xDDDddd, 0xFFFfff); //shadow - DrawRectangle(panel_x+2, panel_y+54, PANEL_W-4,16, 0xFFFfff); pass_box.left = panel_x+3; pass_box.top = panel_y+55; edit_box_draw stdcall(#pass_box); + EditBox(#pass_box); if (!aim) { diff --git a/programs/cmm/tmpdisk/t_gui.c b/programs/cmm/tmpdisk/t_gui.c index a944b823f6..f4a90e1186 100644 --- a/programs/cmm/tmpdisk/t_gui.c +++ b/programs/cmm/tmpdisk/t_gui.c @@ -15,8 +15,7 @@ ?define INTRO_TEXT_1 "Здесь будет отображаться список" ?define INTRO_TEXT_2 "виртуальных дисков в системе." ?define INTRO_TEXT_3 "Попробуйте добавить один..." - ?define INTRO_TEXT_4 "Размер:" - + ?define SIZE_TEXT "Размер:" ?define NOTIFY_TEXT_NO_DISK "'Для начала добавьте хотя бы один диск' -W" ?define NOTIFY_TEXT_DISK_LIMIT "'Достигнут предел количества виртуальных дисков' -W" ?define FREE_RAM_TEXT "Размер свободной оперативной памяти: " @@ -31,8 +30,7 @@ ?define INTRO_TEXT_1 " There will be list of mounted" ?define INTRO_TEXT_2 " virtual disks." ?define INTRO_TEXT_3 " Try to add one..." - ?define INTRO_TEXT_4 "Size:" - + ?define SIZE_TEXT "Size:" ?define NOTIFY_TEXT_NO_DISK "'You need to have at least one disk' -W" ?define NOTIFY_TEXT_DISK_LIMIT "'Reached the limit of the number of virtual disks' -W" ?define FREE_RAM_TEXT "Free RAM size: " @@ -48,12 +46,12 @@ char selected; proc_info Form; unsigned char icons[] = FROM "icons.raw"; -#define TOPPANELH 50 +#define TOPPANELH 54 #define BOTPANELH 20 int mouse_dd; char new_disk_size[5]; -edit_box edit_disk_size= {50,0,5,0xffffff,0x94AECE,0x000000,0xffffff,0,4,#new_disk_size,#mouse_dd, 1000000000000010b}; +edit_box edit_disk_size= {50,0,7,0xffffff,0x94AECE,0xFFFfff,0xffffff,0,4,#new_disk_size,#mouse_dd, 1000000000000010b}; void Main_Window() { @@ -63,7 +61,7 @@ void Main_Window() mem_Init(); load_dll(boxlib, #box_lib_init,0); GetSizeDisk(); - edit_disk_size.left = strlen(INTRO_TEXT_4)*6 + 10; + edit_disk_size.left = strlen(SIZE_TEXT)*9 + 10; SetEventMask(0x27); loop() { @@ -137,14 +135,15 @@ void Main_Window() DrawBar(0,0, Form.cwidth,TOPPANELH, system.color.work); DrawBar(0,TOPPANELH, Form.cwidth,1, system.color.work_graph); - WriteText(6, 9, 0x80, system.color.work_text, INTRO_TEXT_4); - WriteText(edit_disk_size.left + edit_disk_size.width + 8, 9, 0x80, system.color.work_text, "MB."); + WriteText(6, 6, 0x90, system.color.work_text, SIZE_TEXT); + WriteText(edit_disk_size.left + edit_disk_size.width + 12, 6, 0x90, system.color.work_text, "MB."); edit_box_draw stdcall (#edit_disk_size); + EditBox(#edit_disk_size); for (i=0, x=6; i<2; i++, x+=strlen(but_text[i])*6+37) { - DefineButton(x,25, strlen(but_text[i])*6+28,19, 10+i, system.color.work_button); - _PutImage(x+3,28, 14,14, i*14*14*3+#icons); - WriteText(x+22,31, 0x80, system.color.work_button_text, but_text[i]); + DefineButton(x,29, strlen(but_text[i])*6+28,19, 10+i, system.color.work_button); + _PutImage(x+3,32, 14,14, i*14*14*3+#icons); + WriteText(x+22,35, 0x80, system.color.work_button_text, but_text[i]); } GetDisks(); DrawTmpDisks(); @@ -208,7 +207,7 @@ void DrawTmpDisks() byte i, real_id; int FreeRAM=GetFreeRAM()/1024; - DrawBar(0,51, Form.cwidth,Form.cheight-TOPPANELH-BOTPANELH-2, 0xFFFFFF); + DrawBar(0,TOPPANELH+1, Form.cwidth,Form.cheight-TOPPANELH-BOTPANELH-2, 0xFFFFFF); DrawBar(0,Form.cheight-BOTPANELH-1, Form.cwidth,1, system.color.work_graph); DrawBar(0,Form.cheight-BOTPANELH, Form.cwidth,BOTPANELH, system.color.work); strcpy(#free_ram_text, FREE_RAM_TEXT);