From 4ab50d25b873467a8665d8fb7ac47a5d00bdcb8a Mon Sep 17 00:00:00 2001 From: Serhii Sakhno Date: Wed, 16 Oct 2013 22:56:46 +0000 Subject: [PATCH] tmpdisk: recalculation of the size of the input field when adding a disk git-svn-id: svn://kolibrios.org@4041 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/tmpdisk/t_window.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/programs/cmm/tmpdisk/t_window.c b/programs/cmm/tmpdisk/t_window.c index 53c77a5e11..b58d081e1a 100644 --- a/programs/cmm/tmpdisk/t_window.c +++ b/programs/cmm/tmpdisk/t_window.c @@ -59,14 +59,11 @@ edit_box edit_disk_size= {50,0,5,0xffffff,0x94AECE,0x000000,0xffffff,0,4,#disk_s void Main_Window() { unsigned int id, key, err; - int i, x, fr; + int i, x; mem_Init(); if (load_dll2(boxlib, #box_lib_init,0)!=0) notify("Error while loading GUI library /sys/lib/boxlib.obj"); - fr = GetFreeRAM() / 5; - fr = itoa(fr / 2048); - strcat(#disk_size, fr); - edit_disk_size.size = edit_disk_size.pos = strlen(#disk_size); + GetSizeDisk(); edit_disk_size.left = strlen(INTRO_TEXT_4)*6 + 10; SetEventMask(0x27); loop() @@ -177,6 +174,15 @@ void Main_Window() } } +void GetSizeDisk() +{ + int fr; + fr = GetFreeRAM() / 5; + fr = itoa(fr / 2048); + strcpy(#disk_size, fr); + edit_disk_size.size = edit_disk_size.pos = strlen(#disk_size); + edit_box_draw stdcall (#edit_disk_size); +} void OpenTmpDisk() { @@ -273,6 +279,7 @@ void AddDisk() pause(5); GetDisks(); DrawTmpDisks(); + GetSizeDisk(); }