cmm: editbox convex

git-svn-id: svn://kolibrios.org@6193 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2016-02-11 02:22:34 +00:00
parent db17d90b8d
commit deb780f6ba
3 changed files with 28 additions and 19 deletions

View File

@ -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); 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) :void DrawProgressBar(dword st_x, st_y, st_w, st_h, col_fon, col_border, col_fill, col_text, progress_percent)
{ {
int progress_w; int progress_w;

View File

@ -181,20 +181,16 @@ void DrawLoginScreen()
DrawBar(0,0, Form.cwidth, Form.cheight, system.color.work); DrawBar(0,0, Form.cwidth, Form.cheight, system.color.work);
WriteText(panel_x,panel_y,0x80,system.color.work_text,"Your Email:"); 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.left = panel_x+3;
login_box.top = panel_y+15; login_box.top = panel_y+15;
edit_box_draw stdcall(#login_box); edit_box_draw stdcall(#login_box);
EditBox(#login_box);
WriteText(panel_x,panel_y+40,0x80,system.color.work_text,"Password:"); 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.left = panel_x+3;
pass_box.top = panel_y+55; pass_box.top = panel_y+55;
edit_box_draw stdcall(#pass_box); edit_box_draw stdcall(#pass_box);
EditBox(#pass_box);
if (!aim) if (!aim)
{ {

View File

@ -15,8 +15,7 @@
?define INTRO_TEXT_1 "‡¤¥áì ¡ã¤¥â ®â®¡à ¦ âìáï ᯨ᮪" ?define INTRO_TEXT_1 "‡¤¥áì ¡ã¤¥â ®â®¡à ¦ âìáï ᯨ᮪"
?define INTRO_TEXT_2 "¢¨àâã «ì­ëå ¤¨áª®¢ ¢ á¨á⥬¥." ?define INTRO_TEXT_2 "¢¨àâã «ì­ëå ¤¨áª®¢ ¢ á¨á⥬¥."
?define INTRO_TEXT_3 "<EFBFBD>®¯à®¡ã©â¥ ¤®¡ ¢¨âì ®¤¨­..." ?define INTRO_TEXT_3 "<EFBFBD>®¯à®¡ã©â¥ ¤®¡ ¢¨âì ®¤¨­..."
?define INTRO_TEXT_4 "<EFBFBD> §¬¥à:" ?define SIZE_TEXT "<EFBFBD> §¬¥à:"
?define NOTIFY_TEXT_NO_DISK "'„«ï ­ ç «  ¤®¡ ¢ì⥠å®âï ¡ë ®¤¨­ ¤¨áª' -W" ?define NOTIFY_TEXT_NO_DISK "'„«ï ­ ç «  ¤®¡ ¢ì⥠å®âï ¡ë ®¤¨­ ¤¨áª' -W"
?define NOTIFY_TEXT_DISK_LIMIT "'„®á⨣­ã⠯।¥« ª®«¨ç¥á⢠ ¢¨àâã «ì­ëå ¤¨áª®¢' -W" ?define NOTIFY_TEXT_DISK_LIMIT "'„®á⨣­ã⠯।¥« ª®«¨ç¥á⢠ ¢¨àâã «ì­ëå ¤¨áª®¢' -W"
?define FREE_RAM_TEXT "<EFBFBD> §¬¥à ᢮¡®¤­®© ®¯¥à â¨¢­®© ¯ ¬ïâ¨: " ?define FREE_RAM_TEXT "<EFBFBD> §¬¥à ᢮¡®¤­®© ®¯¥à â¨¢­®© ¯ ¬ïâ¨: "
@ -31,8 +30,7 @@
?define INTRO_TEXT_1 " There will be list of mounted" ?define INTRO_TEXT_1 " There will be list of mounted"
?define INTRO_TEXT_2 " virtual disks." ?define INTRO_TEXT_2 " virtual disks."
?define INTRO_TEXT_3 " Try to add one..." ?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_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 NOTIFY_TEXT_DISK_LIMIT "'Reached the limit of the number of virtual disks' -W"
?define FREE_RAM_TEXT "Free RAM size: " ?define FREE_RAM_TEXT "Free RAM size: "
@ -48,12 +46,12 @@ char selected;
proc_info Form; proc_info Form;
unsigned char icons[] = FROM "icons.raw"; unsigned char icons[] = FROM "icons.raw";
#define TOPPANELH 50 #define TOPPANELH 54
#define BOTPANELH 20 #define BOTPANELH 20
int mouse_dd; int mouse_dd;
char new_disk_size[5]; 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() void Main_Window()
{ {
@ -63,7 +61,7 @@ void Main_Window()
mem_Init(); mem_Init();
load_dll(boxlib, #box_lib_init,0); load_dll(boxlib, #box_lib_init,0);
GetSizeDisk(); GetSizeDisk();
edit_disk_size.left = strlen(INTRO_TEXT_4)*6 + 10; edit_disk_size.left = strlen(SIZE_TEXT)*9 + 10;
SetEventMask(0x27); SetEventMask(0x27);
loop() loop()
{ {
@ -137,14 +135,15 @@ void Main_Window()
DrawBar(0,0, Form.cwidth,TOPPANELH, system.color.work); DrawBar(0,0, Form.cwidth,TOPPANELH, system.color.work);
DrawBar(0,TOPPANELH, Form.cwidth,1, system.color.work_graph); DrawBar(0,TOPPANELH, Form.cwidth,1, system.color.work_graph);
WriteText(6, 9, 0x80, system.color.work_text, INTRO_TEXT_4); WriteText(6, 6, 0x90, system.color.work_text, SIZE_TEXT);
WriteText(edit_disk_size.left + edit_disk_size.width + 8, 9, 0x80, system.color.work_text, "MB."); WriteText(edit_disk_size.left + edit_disk_size.width + 12, 6, 0x90, system.color.work_text, "MB.");
edit_box_draw stdcall (#edit_disk_size); 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) 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); DefineButton(x,29, strlen(but_text[i])*6+28,19, 10+i, system.color.work_button);
_PutImage(x+3,28, 14,14, i*14*14*3+#icons); _PutImage(x+3,32, 14,14, i*14*14*3+#icons);
WriteText(x+22,31, 0x80, system.color.work_button_text, but_text[i]); WriteText(x+22,35, 0x80, system.color.work_button_text, but_text[i]);
} }
GetDisks(); GetDisks();
DrawTmpDisks(); DrawTmpDisks();
@ -208,7 +207,7 @@ void DrawTmpDisks()
byte i, real_id; byte i, real_id;
int FreeRAM=GetFreeRAM()/1024; 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-1, Form.cwidth,1, system.color.work_graph);
DrawBar(0,Form.cheight-BOTPANELH, Form.cwidth,BOTPANELH, system.color.work); DrawBar(0,Form.cheight-BOTPANELH, Form.cwidth,BOTPANELH, system.color.work);
strcpy(#free_ram_text, FREE_RAM_TEXT); strcpy(#free_ram_text, FREE_RAM_TEXT);