diff --git a/programs/cmm/browser/WebView.c b/programs/cmm/browser/WebView.c index 0713f5dfd3..c4cf7e2019 100644 --- a/programs/cmm/browser/WebView.c +++ b/programs/cmm/browser/WebView.c @@ -1,5 +1,5 @@ //HTML Viewer in C-- -//Copyright 2007-2017 by Veliant & Leency +//Copyright 2007-2018 by Veliant & Leency //Asper, lev, Lrz, Barsuk, Nable, hidnplayr... #ifndef AUTOBUILD @@ -32,7 +32,7 @@ _http http = {0, 0, 0, 0, 0, 0, 0}; char homepage[] = FROM "html\\homepage.htm""\0"; #ifdef LANG_RUS -char version[]="Текстовый браузер 1.8"; +char version[]="Текстовый браузер 1.8b"; ?define IMAGES_CACHE_CLEARED "Кэш картинок очищен" ?define T_LAST_SLIDE "Это последний слайд" char loading[] = "Загрузка страницы...
"; @@ -117,6 +117,7 @@ edit_box address_box = {250,60,30,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000 void main() { + int i; load_dll(boxlib, #box_lib_init,0); load_dll(libio, #libio_init,1); load_dll(libimg, #libimg_init,1); @@ -164,6 +165,9 @@ void main() } else { + #define KEY_SCROLL_N 11 + if (SCAN_CODE_UP == key_scancode) for (i=0;i1) && (param[strlen(#param)-1]=='/') param[strlen(#param)-1]=NULL; //no "/" at the end @@ -201,7 +194,7 @@ void main() } mouse.get(); - + if (!mouse.mkm) && (stats>0) stats = 0; if (mouse.mkm) && (!stats) { @@ -304,7 +297,7 @@ void main() { if (sc_slider_h/2+files.y>mouse.y) || (mouse.y<0) || (mouse.y>4000) mouse.y=sc_slider_h/2+files.y; //anee eo?ni? iaa ieiii id = files.first; - files.first = -sc_slider_h / 2 + mouse.y -j -files.y * files.count; + files.first = -sc_slider_h / 2 + mouse.y -files.y * files.count; files.first /= files.h - 18; if (files.visible+files.first>files.count) files.first=files.count-files.visible; if (files.first<0) files.first=0; @@ -351,6 +344,10 @@ void main() KillProcess(about_window); SaveIniSettings(); ExitProcess(); + case PATH_BTN: + notify(COPY_PATH_STR); + Clipboard__CopyText(#path); + break; case 21: //Back GoBack(); break; @@ -467,15 +464,11 @@ void main() else Open(1); break; case 030: //Ctrl+A - select all files - for (i=0; i2) break; + EventRefreshDisksAndFolders(); } - - if(cmd_free) { if(cmd_free==1) menu_stak=free(menu_stak); @@ -613,11 +556,12 @@ void main() void DrawFavButton(int x) { _PutImage(x,10,20,22,#fav); - DefineButton(x+1,11,20-2,22-3,61+BT_HIDE,NULL); + DefineHiddenButton(x+1,11,20-2,22-3,61); } void draw_window() { + int i; if (show_status_bar.checked) status_bar_h = STATUS_BAR_H; else status_bar_h = 0; DefineAndDrawWindow(Form.left+rand_n,Form.top+rand_n,Form.width,Form.height,0x73,NULL,TITLE,0); GetProcessInfo(#Form, SelfInfo); @@ -627,11 +571,11 @@ void draw_window() GetProcessInfo(#Form, SelfInfo); //if win_size changed _PutImage(0,0,246,34,#toolbar); DrawBar(127, 8, 1, 25, col_graph); - for (j=0; j<3; j++) DefineButton(toolbar_buttons_x[j]+2,5+2,31-5,29-5,21+j+BT_HIDE,NULL); - for (j=3; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,NULL); + for (i=0; i<3; i++) DefineHiddenButton(toolbar_buttons_x[i]+2,7,31-5,29-5,21+i); + for (i=3; i<6; i++) DefineHiddenButton(toolbar_buttons_x[i], 5,31, 29, 21+i); DrawBar(246,0, Form.cwidth - 246, 34, col_work); _PutImage(Form.cwidth-17,11,6,18,#dots); - DefineButton(Form.cwidth-24,7,20,25,51+BT_HIDE+BT_NOFRAME,0); //dots + DefineHiddenButton(Form.cwidth-24,7,20,25,51+BT_NOFRAME); //dots //main rectangles DrawRectangle(1,40,Form.cwidth-3,Form.cheight - 42-status_bar_h,col_graph); DrawRectangle(0,39,Form.cwidth-1,Form.cheight - 40,col_palette[4]); //bg @@ -723,6 +667,7 @@ void DrawFilePanels() void List_ReDraw() { int all_lines_h; + dword j; static int old_cur_y, old_first; files.CheckDoesValuesOkey(); //prevent some shit @@ -769,9 +714,10 @@ void Line_ReDraw(dword bgcol, filenum){ char label_file_name[4096]; if (filenum==-1) return; DrawBar(files.x,y,4,files.item_h,bgcol); - DrawBar(files.x+20,y,files.w-20,files.item_h,bgcol); DrawBar(files.x+4,y,icon_size,icon_y-y,bgcol); if (files.item_h>icon_size) DrawBar(files.x+4,icon_y+icon_size-1,icon_size,y+files.item_h-icon_y-icon_size+1,bgcol); + if (colored_lines.checked) && (bgcol!=col_selec) && (filenum%2) bgcol=0xF1F1F1; + DrawBar(files.x+icon_size+4,y,files.w-icon_size-4,files.item_h,bgcol); file_offet = file_mas[filenum+files.first]*304 + buf+32; attr = ESDWORD[file_offet]; @@ -804,7 +750,7 @@ void Line_ReDraw(dword bgcol, filenum){ DrawIconByExtension(#temp_path, ext1, files.x+4, icon_y, bgcol); if (TestBit(attr, 1)) || (TestBit(attr, 2)) text_col=0xA6A6B7; //system or hiden? - if (bgcol!=0xFFFfff) + if (bgcol==col_selec) { itdir = TestBit(attr, 4); strcpy(#file_name, file_name_off); @@ -883,7 +829,9 @@ void Open_Dir(dword dir_path, redraw){ inline Sorting() { dword k=0, l=1; + int j=0; dword file_off; + if (!strcmp(#path,"/")) //do not sort root folder { for(k=1;k0) && (strncmp(file_mas[0]*304+buf+72,"..",2)!=0) for(k--; k>0; k--;) if (!strncmp(file_mas[k]*304+buf+72,"..",2)) {file_mas[k]>1) path[i-1]=NULL; else path[i]=NULL; + iii=strlen(#path)-1; + if (iii==0) return; + iii = strrchr(#path, '/'); + strcpy(#old_folder_name, #path+iii); + if (iii>1) path[iii-1]=NULL; else path[iii]=NULL; SelectFileByName(#old_folder_name); } @@ -1188,5 +1136,59 @@ void ChangeActivePanel() DrawFilePanels(); } +void EventSelectAllFiles(dword state) +{ + int i; + for (i=0; i - 1 { + int j; int iss = a; if (a >= b) return; for (j = a; j <= b; j++) @@ -12,6 +13,7 @@ void Sort_by_Size(int a, b) // void Sort_by_Name(int a, b) // фы  яхЁтюую т√чютр: a = 0, b = <¤ыхьхэЄют т ьрёёштх> - 1 { + int j; int isn = a; if (a >= b) return; for (j = a; j <= b; j++) @@ -22,7 +24,8 @@ void Sort_by_Name(int a, b) // void Sort_by_Type(int a, b) // фы  яхЁтюую т√чютр: a = 0, b = <¤ыхьхэЄют т ьрёёштх> - 1 -{ +{ + int j; dword filename1, filename2, ext1, ext2; int n, isn = a; if (a >= b) return; diff --git a/programs/cmm/eolite/include/translations.h b/programs/cmm/eolite/include/translations.h index 3419785f1b..75bacac23c 100644 --- a/programs/cmm/eolite/include/translations.h +++ b/programs/cmm/eolite/include/translations.h @@ -1,63 +1,65 @@ -#define TITLE "Eolite File Manager v3.94" -#define ABOUT_TITLE "EOLITE 3.94" +#define TITLE "Eolite File Manager v3.96b" +#define ABOUT_TITLE "EOLITE 3.96b" #ifdef LANG_RUS - ?define T_FILE "Файл" - ?define T_TYPE "Тип" - ?define T_SIZE "Размер" - ?define T_NEW_FOLDER "Новая папка" - ?define T_NEW_FILE "Новый файл" - ?define T_DELETE_FILE "Вы действительно хотите удалить" - ?define T_YES "Да" - ?define T_NO "Нет" - ?define T_CANCEL "Отмена" - ?define T_CREATE "Создать" - ?define T_RENAME "Переименовать" - ?define FS_ITEM_ALREADY_EXISTS "'Элемент с таким именем уже существует' -E" - ?define NOT_CREATE_FOLDER "'Не удалось создать папку.' -E" - ?define NOT_CREATE_FILE "'Не удалось создать файл.' -E" - ?define T_NOTIFY_APP_PARAM_WRONG "'Параметр для запуска Eolite не верен: папка не существует!' -E" - ?define T_COPY_WINDOW_TITLE "Копирую..." - ?define T_COPY_WINDOW_TEXT "Копируется файл:" - ?define T_MOVE_WINDOW_TITLE "Перемещаю..." - ?define T_MOVE_WINDOW_TEXT "Перемещается файл:" - ?define T_DELETE_WINDOW_TITLE "Удаляю..." - ?define T_DELETE_WINDOW_TEXT "Удаляется файл:" - ?define T_ABORT_WINDOW_BUTTON "Прервать" - ?define INFO_AFTER_COPY "Копирование завершено" - ?define T_CANCEL_PASTE "Копирование прекращено. Папка скопирована не полностью." - ?define T_SELECT_APP_TO_OPEN_WITH "Выберите программу для открытия файла" - ?define DEL_MORE_FILES_1 "выбранные элементы (" - ?define DEL_MORE_FILES_2 " шт.)?" - ?define STATUS_STR "Элементов: %d Папок: %d Файлов: %d Выделенно: %d" +?define T_FILE "Файл" +?define T_TYPE "Тип" +?define T_SIZE "Размер" +?define T_NEW_FOLDER "Новая папка" +?define T_NEW_FILE "Новый файл" +?define T_DELETE_FILE "Вы действительно хотите удалить" +?define T_YES "Да" +?define T_NO "Нет" +?define T_CANCEL "Отмена" +?define T_CREATE "Создать" +?define T_RENAME "Переименовать" +?define FS_ITEM_ALREADY_EXISTS "'Элемент с таким именем уже существует' -E" +?define NOT_CREATE_FOLDER "'Не удалось создать папку.' -E" +?define NOT_CREATE_FILE "'Не удалось создать файл.' -E" +?define T_NOTIFY_APP_PARAM_WRONG "'Параметр для запуска Eolite не верен: папка не существует!' -E" +?define T_COPY_WINDOW_TITLE "Копирую..." +?define T_COPY_WINDOW_TEXT "Копируется файл:" +?define T_MOVE_WINDOW_TITLE "Перемещаю..." +?define T_MOVE_WINDOW_TEXT "Перемещается файл:" +?define T_DELETE_WINDOW_TITLE "Удаляю..." +?define T_DELETE_WINDOW_TEXT "Удаляется файл:" +?define T_ABORT_WINDOW_BUTTON "Прервать" +?define INFO_AFTER_COPY "Копирование завершено" +?define T_CANCEL_PASTE "Копирование прекращено. Папка скопирована не полностью." +?define T_SELECT_APP_TO_OPEN_WITH "Выберите программу для открытия файла" +?define DEL_MORE_FILES_1 "выбранные элементы (" +?define DEL_MORE_FILES_2 " шт.)?" +?define STATUS_STR "Элементов: %d Папок: %d Файлов: %d Выделенно: %d" +?define COPY_PATH_STR "'Путь папки скопирован в буфер обмена' -I" #else - ?define T_FILE "File" - ?define T_TYPE "Type" - ?define T_SIZE "Size" - ?define T_NEW_FOLDER "New folder" - ?define T_NEW_FILE "New file" - ?define T_DELETE_FILE "Do you really want to delete" - ?define T_YES "Yes" - ?define T_NO "No" - ?define T_CANCEL "Cancel" - ?define T_CREATE "Create" - ?define T_RENAME "Rename" - ?define FS_ITEM_ALREADY_EXISTS "'An item with that name already exists' -E" - ?define WAIT_DELETING_FOLDER "Deleting folder. Please, wait..." - ?define NOT_CREATE_FOLDER "'Folder can not be created.' -E" - ?define NOT_CREATE_FILE "'File can not be created.' -E" - ?define T_NOTIFY_APP_PARAM_WRONG "'Eolite param is wrong: directory does not exist!' -E" - ?define T_COPY_WINDOW_TITLE "Copying..." - ?define T_COPY_WINDOW_TEXT "Copying file:" - ?define T_MOVE_WINDOW_TITLE "Moving..." - ?define T_MOVE_WINDOW_TEXT "Moving file:" - ?define T_DELETE_WINDOW_TITLE "Deleting..." - ?define T_DELETE_WINDOW_TEXT "Deleting file:" - ?define T_ABORT_WINDOW_BUTTON "Abort" - ?define INFO_AFTER_COPY "Copy finished" - ?define T_CANCEL_PASTE "Copy process terminated. Folder copied incompletely." - ?define T_SELECT_APP_TO_OPEN_WITH "Select application to open file" - ?define DEL_MORE_FILES_1 "selected items(" - ?define DEL_MORE_FILES_2 " pcs.)?" - ?define STATUS_STR "Elements: %d Dirs: %d Files: %d Selected: %d" +?define T_FILE "File" +?define T_TYPE "Type" +?define T_SIZE "Size" +?define T_NEW_FOLDER "New folder" +?define T_NEW_FILE "New file" +?define T_DELETE_FILE "Do you really want to delete" +?define T_YES "Yes" +?define T_NO "No" +?define T_CANCEL "Cancel" +?define T_CREATE "Create" +?define T_RENAME "Rename" +?define FS_ITEM_ALREADY_EXISTS "'An item with that name already exists' -E" +?define WAIT_DELETING_FOLDER "Deleting folder. Please, wait..." +?define NOT_CREATE_FOLDER "'Folder can not be created.' -E" +?define NOT_CREATE_FILE "'File can not be created.' -E" +?define T_NOTIFY_APP_PARAM_WRONG "'Eolite param is wrong: directory does not exist!' -E" +?define T_COPY_WINDOW_TITLE "Copying..." +?define T_COPY_WINDOW_TEXT "Copying file:" +?define T_MOVE_WINDOW_TITLE "Moving..." +?define T_MOVE_WINDOW_TEXT "Moving file:" +?define T_DELETE_WINDOW_TITLE "Deleting..." +?define T_DELETE_WINDOW_TEXT "Deleting file:" +?define T_ABORT_WINDOW_BUTTON "Abort" +?define INFO_AFTER_COPY "Copy finished" +?define T_CANCEL_PASTE "Copy process terminated. Folder copied incompletely." +?define T_SELECT_APP_TO_OPEN_WITH "Select application to open file" +?define DEL_MORE_FILES_1 "selected items(" +?define DEL_MORE_FILES_2 " pcs.)?" +?define STATUS_STR "Elements: %d Dirs: %d Files: %d Selected: %d" +?define COPY_PATH_STR "'Directory path copied to clipboard' -I" #endif diff --git a/programs/cmm/iconedit/colors_mas.h b/programs/cmm/iconedit/colors_mas.h index 3efcb4edb8..0962eb3c6d 100644 --- a/programs/cmm/iconedit/colors_mas.h +++ b/programs/cmm/iconedit/colors_mas.h @@ -1,4 +1,4 @@ -#define MAX_CELL_SIZE 128 +#define MAX_CELL_SIZE 256 ////////////////////////////////////////////////////////////////////////////////////// // // diff --git a/programs/cmm/iconedit/compile_en.bat b/programs/cmm/iconedit/compile_en.bat index 926c272b46..4e4fdaf0e3 100644 --- a/programs/cmm/iconedit/compile_en.bat +++ b/programs/cmm/iconedit/compile_en.bat @@ -9,10 +9,11 @@ cls @del lang.h-- if exist iconedit ( - "C:\Program Files\WinImage\winimage.exe" "D:\Soft\Kolibri\QEMU\kolibri.img" /H /Q /I iconedit + "C:\Program Files (x86)\WinImage\winimage.exe" "C:\Users\Leency\Desktop\kolibri.img" /H /Q /I iconedit d: - cd "D:\Soft\Kolibri\QEMU" - call "D:\Soft\Kolibri\QEMU\qemu-kos-img.bat" + cd "D:\Kolibri\Infrastructure\QEMU" + call "z_kos.bat" ) else ( @pause ) + diff --git a/programs/cmm/iconedit/compile_ru.bat b/programs/cmm/iconedit/compile_ru.bat index def3a2fdfc..6bff63b2d0 100644 --- a/programs/cmm/iconedit/compile_ru.bat +++ b/programs/cmm/iconedit/compile_ru.bat @@ -9,10 +9,10 @@ cls @del lang.h-- if exist iconedit ( - "C:\Program Files\WinImage\winimage.exe" "D:\Soft\Kolibri\QEMU\kolibri.img" /H /Q /I iconedit + "C:\Program Files (x86)\WinImage\winimage.exe" "C:\Users\Leency\Desktop\kolibri.img" /H /Q /I iconedit d: - cd "D:\Soft\Kolibri\QEMU" - call "D:\Soft\Kolibri\QEMU\qemu-kos-img.bat" + cd "D:\Kolibri\Infrastructure\QEMU" + call "z_kos.bat" ) else ( @pause ) diff --git a/programs/cmm/iconedit/iconedit.c b/programs/cmm/iconedit/iconedit.c index 3028eedc2c..dd83bf1146 100644 --- a/programs/cmm/iconedit/iconedit.c +++ b/programs/cmm/iconedit/iconedit.c @@ -31,9 +31,9 @@ #ifdef LANG_RUS #define T_NOTIFY_OPEN "'IconEdit -В данный момент IconEdit может открывать только иконки, созданные в самом редакторе. -Если нужно открыть другое изображение, воспользуйтесь инструментом <Фотоаппарат> -для захвата картинки с экрана.' -Wt" +тАЪ ┬д┬а┬н┬н├л┬й ┬м┬о┬м┬е┬н├в IconEdit ┬м┬о┬ж┬е├в ┬о├в┬к├а├л┬в┬а├в├м ├в┬о┬л├м┬к┬о ┬и┬к┬о┬н┬к┬и, ├б┬о┬з┬д┬а┬н┬н├л┬е ┬в ├б┬а┬м┬о┬м ├а┬е┬д┬а┬к├в┬о├а┬е. +тАж├б┬л┬и ┬н├г┬ж┬н┬о ┬о├в┬к├а├л├в├м ┬д├а├г┬г┬о┬е ┬и┬з┬о┬б├а┬а┬ж┬е┬н┬и┬е, ┬в┬о├б┬п┬о┬л├м┬з├г┬й├в┬е├б├м ┬и┬н├б├в├а├г┬м┬е┬н├в┬о┬м <тАЭ┬о├в┬о┬а┬п┬п┬а├а┬а├в> +┬д┬л├п ┬з┬а├е┬в┬а├в┬а ┬к┬а├а├в┬и┬н┬к┬и ├б ├н┬к├а┬а┬н┬а.' -Wt" #else #define T_NOTIFY_OPEN "'IconEdit You can open only files created in IconEdit for now! @@ -41,7 +41,7 @@ In other case please use tool to get an image from screen.' -Wt" #endif -#define T_TITLE "Icon Editor 0.56 Alpha" +#define T_TITLE "Icon Editor 0.57b Alpha" #define TOPBAR_H 24+8 #define LEFTBAR_W 16+5+5+3+3 @@ -58,10 +58,13 @@ block canvas = { NULL, NULL, NULL, NULL }; block wrapper = { LEFTBAR_W, TOPBAR_H, NULL, NULL }; block right_bar = { NULL, 10+TOPBAR_H, RIGHT_BAR_W+10, NULL }; -block b_color_gradient = {NULL, 40+TOPBAR_H, RIGHT_BAR_W, 30}; -block b_last_colors = {NULL, 80+TOPBAR_H, RIGHT_BAR_W, COLSIZE*2}; -block b_default_palette = {NULL, COLSIZE*2+10+80+TOPBAR_H, RIGHT_BAR_W, COLSIZE*9}; +dword linear_gradient[RIGHT_BAR_W]; +block b_color_gradient = {NULL, 40+TOPBAR_H, RIGHT_BAR_W, 25}; +//block b_opacity_gradient = {NULL, 75+TOPBAR_H, RIGHT_BAR_W, 15}; +block b_last_colors = {NULL, 75+TOPBAR_H, RIGHT_BAR_W, COLSIZE}; +block b_default_palette = {NULL, COLSIZE+10+75+TOPBAR_H, RIGHT_BAR_W, COLSIZE*9}; +dword transparent = 0xBFCAD2; dword color1 = 0x000000; dword color2 = 0xBFCAD2; dword tool_color; @@ -103,6 +106,7 @@ enum { proc_info Form; dword semi_white; +bool bg_dark=false; more_less_box zoom = { 11, 1, 40, "Zoom" }; @@ -120,10 +124,11 @@ dword default_palette[] = { 0xCC99FF,0xFF99FF,0xFF99CC,0xE0E0E0,0xFFCCCC,0xFFE5CC,0xFFFFCC,0xE5FFCC,0xCCFFCC,0xCCFFE5, 0xCCFFFF,0xCCE5FF,0xCCCCFF,0xE5CCFF,0xFFCCFF,0xFFCCE5,0xFFFFFF }; -dword last_used_colors[13*2] = { + +#define LAST_USED_MAX 13 +dword last_used_colors[LAST_USED_MAX] = { 0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF, -0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF, -0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF +0xFFFFFF,0xFFFFFF,0xFFFFFF }; CustomCursor Cursor; @@ -157,6 +162,7 @@ void main() { word btn; libimg_image open_image; + dword tmp_bg_col; load_dll(libio, #libio_init, 1); load_dll(libimg, #libimg_init, 1); @@ -166,6 +172,7 @@ void main() Libimg_LoadImage(#left_icons, "/sys/icons16.png"); system.color.get(); + semi_white = MixColors(system.color.work, 0xFFFfff, 96); Libimg_ReplaceColor(top_icons.image, top_icons.w, top_icons.h, 0xffFFFfff, semi_white); Libimg_ReplaceColor(top_icons.image, top_icons.w, top_icons.h, 0xffCACBD6, MixColors(semi_white, 0, 220)); @@ -173,6 +180,12 @@ void main() Libimg_ReplaceColor(left_icons.image, left_icons.w, left_icons.h, 0xffFFFfff, system.color.work); Libimg_ReplaceColor(left_icons.image, left_icons.w, left_icons.h, 0xffCACBD6, MixColors(system.color.work, 0, 200)); + //fix line and rectandle color for dark skins + if (GrayScaleImage(#system.color.work,1,1)<65) bg_dark=true; else bg_dark=false; + if (bg_dark) Libimg_ReplaceColor(left_icons.image, left_icons.w, left_icons.h, 0xff545454, 0xffD3D3D4); + + EventSetActiveColor(1, color1); + if (!param[0]) { image.create(32, 32); } @@ -185,7 +198,7 @@ void main() ExitProcess(); } else { - image.create(open_image.w, open_image.h); + image.create(open_image.h, open_image.w); image.set_image(open_image.imgsrc); } } @@ -257,8 +270,7 @@ void main() EventCreateNewIcon(); break; case BTN_OPEN: - notify(T_NOTIFY_OPEN); - RunProgram("/sys/lod", sprintf(#param, "*png* %s",#program_path)); + EventOpenIcon(); break; case BTN_SAVE: EventSaveIconToFile(); @@ -323,11 +335,26 @@ void main() case evKey: GetKeys(); + if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL) + { + switch(key_scancode) + { + case SCAN_CODE_KEY_S: + EventSaveIconToFile(); + break; + case SCAN_CODE_KEY_O: + EventOpenIcon(); + break; + } + } + + if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) { + if (key_scancode == SCAN_CODE_DEL) EventCleanCanvas(); + } + if (currentTool != TOOL_NONE) && (tools[currentTool].onKeyEvent != 0) tools[currentTool].onKeyEvent(key_scancode); - if (key_scancode == SCAN_CODE_DEL) EventCleanCanvas(); - if (key_scancode == SCAN_CODE_KEY_P) setCurrentTool(TOOL_PENCIL); if (key_scancode == SCAN_CODE_KEY_I) setCurrentTool(TOOL_PIPETTE); if (key_scancode == SCAN_CODE_KEY_F) setCurrentTool(TOOL_FILL); @@ -470,6 +497,7 @@ void DrawEditArea() canvas.h = image.rows * zoom.value; if (canvas.w+2 > wrapper.w) || (canvas.h+2 > wrapper.h) { zoom.value--; + if (zoom.x) zoom.redraw(); DrawEditArea(); return; } @@ -507,37 +535,59 @@ void DrawActiveColor(dword iny) if (iny != NULL) outy = iny; DrawFrame(right_bar.x, outy, CELL, CELL, NULL); DrawBar(right_bar.x+2, outy+2, CELL-4, CELL-4, color1); - sprintf(#param, "%A", color1); - WriteTextWithBg(right_bar.x+30, outy+3, 0xD0, system.color.work_text, #param+4, system.color.work); - DrawFrame(right_bar.x+110, outy, CELL, CELL, NULL); - DrawBar(right_bar.x+110+2, outy+2, CELL-4, CELL-4, color2); - sprintf(#param, "%A", color2); - WriteTextWithBg(right_bar.x+30+110, outy+3, 0xD0, system.color.work_text, #param+4, system.color.work); - DrawCurrentColorGradientByLightness(); + DrawFrame(right_bar.x+CELL+5, outy, CELL, CELL, NULL); + DrawBar(right_bar.x+CELL+5+2, outy+2, CELL-4, CELL-4, color2); + + //sprintf(#param, "%A", color1); + //WriteTextWithBg(right_bar.x+30, outy+3, 0xD0, system.color.work_text, #param+4, system.color.work); + DrawCurrentColorGradient(); } -void DrawCurrentColorGradientByLightness() +int lmax; +void GenerateCurrentColorGradient() +{ + int i, avg, rmax; + + rgb.DwordToRgb(color1); + avg = 255 - calc(rgb.r + rgb.g + rgb.b / 3); + + lmax = b_color_gradient.w *avg/255 | 1; + rmax = b_color_gradient.w - lmax | 1; + if (lmax == 0) lmax=1; + if (rmax == 0) rmax=1; + + for (i=0; ib_color_gradient.w-2) hitch_x=b_color_gradient.x+b_color_gradient.w-3; + for (i=0 ; i=preview_size) || (image.columns>=preview_size) { + notify("'IconEdit\nImage is too big for preview!' -tE"); + return; + } loop() switch(WaitEvent()) { case evButton: @@ -645,6 +699,12 @@ void EventCreateNewIcon() Window_CanvasReSize.create(); } +void EventOpenIcon() +{ + //notify(T_NOTIFY_OPEN); + RunProgram("/sys/lod", sprintf(#param, "*png* %s",#program_path)); +} + void EventSaveIconToFile() { int i=0; @@ -674,7 +734,8 @@ void EventExitIconEdit() void EventSetActiveColor(int _number, _color) { int i; - for (i=13*2-1; i>0; i--) { + if (last_used_colors[0] == _color) return; + for (i=LAST_USED_MAX-1; i>0; i--) { last_used_colors[i] = last_used_colors[i-1]; } last_used_colors[0] = _color; @@ -682,6 +743,12 @@ void EventSetActiveColor(int _number, _color) if (_number == 1) color1 = _color; if (_number == 2) color2 = _color; + if (b_color_gradient.hovered()) { + lmax = mouse.x - b_color_gradient.x; + } + else { + GenerateCurrentColorGradient(); + } DrawActiveColor(NULL); DrawColorPallets(); } diff --git a/programs/cmm/iconedit/tools/pipette.h b/programs/cmm/iconedit/tools/pipette.h index e07cf76e6b..7f7f0eb9df 100644 --- a/programs/cmm/iconedit/tools/pipette.h +++ b/programs/cmm/iconedit/tools/pipette.h @@ -8,7 +8,7 @@ void PipetteTool_onKeyEvent() { } void PipetteTool_onMouseEvent(int mouseX, int mouseY, int lkm, int pkm) { - if (!canvas.hovered()) return; //TODO: option "Restrict pipette to canvas area" + //if (!canvas.hovered()) return; //TODO: option "Restrict pipette to canvas area" tool_color = GetPixelUnderMouse(); DrawBar(Form.cwidth-30, 5, 20, 20, tool_color); diff --git a/programs/cmm/iconedit/tools/selection.h b/programs/cmm/iconedit/tools/selection.h index 7a699a5aee..cd0cd09dc8 100644 --- a/programs/cmm/iconedit/tools/selection.h +++ b/programs/cmm/iconedit/tools/selection.h @@ -209,6 +209,7 @@ void SelectTool_onKeyEvent(dword keycode) { dword r, c; if (SCAN_CODE_DEL == keycode) { + DrawBarIcon(selection.start_x, selection.start_y, selection.end_x, selection.end_y, color2, TOIMAGE); selection.reset(); DrawCanvas(); } diff --git a/programs/cmm/installer/installer.c b/programs/cmm/installer/installer.c index 67920acba5..2b826230be 100644 --- a/programs/cmm/installer/installer.c +++ b/programs/cmm/installer/installer.c @@ -1,32 +1,37 @@ -#define MEMSIZE 0xA1000 +#define MEMSIZE 4096*15 #include "..\lib\strings.h" #include "..\lib\mem.h" #include "..\lib\io.h" #include "..\lib\copyf.h" #include "..\lib\patterns\restart_process.h" -#include "..\lib\added_sysdir.c"; - -?define T_END "\'Установка KolibriN успешно завершена.\' -O" -?define T_LESS_RAM "Мало свободной оперативной памяти. Могут возникнуть проблемы" +//#include "..\lib\added_sysdir.c"; void main() { - - SetAdditionalSystemDirectory("kolibrios", abspath("install/kolibrios")+1); - io.run("/sys/media/kiv", "\\S__/kolibrios/res/Wallpapers/In the wind there is longing.png"); - io.del("/sys/docpack"); - copyf(abspath("install/sys"), "/sys"); - RestartProcessByName("@icon", MULTIPLE); - RestartProcessByName("@taskbar", SINGLE); - RestartProcessByName("@docky", SINGLE); - notify(T_END); - io.run("/sys/tmpdisk", "a0s10"); + //SetAdditionalSystemDirectory("kolibrios", abspath("install/kolibrios")+1); + io.run("/sys/tmpdisk", "a0"); pause(50); - copyf(abspath("install/tmp"), "/tmp0/1"); + + io.del("/sys/docpack"); + + copyf(abspath("rd"), "/sys"); + copyf(abspath("kos"), "/kolibrios"); + copyf(abspath("tmp"), "/tmp0/1"); + + KillProcessByName("@icon", MULTIPLE); + KillProcessByName("@taskbar", SINGLE); + KillProcessByName("@docky", SINGLE); + + RunProgram("/sys/@icon", NULL); + RunProgram("/sys/@taskbar", NULL); + RunProgram("/sys/@docky", NULL); + + io.run("/sys/media/kiv", "\\S__/kolibrios/res/Wallpapers/deink.png"); + //notify("'KolibriNext\nInstall complete'-tO"); ExitProcess(); } -void Operation_Draw_Progress(dword filename) { return; } +void Operation_Draw_Progress(dword filename) { debug("copying: "); debugln(filename); } stop: \ No newline at end of file diff --git a/programs/cmm/kolibrin/kolibrin.c b/programs/cmm/kolibrin/kolibrin.c index 83d4fc517a..6de7ad174f 100644 --- a/programs/cmm/kolibrin/kolibrin.c +++ b/programs/cmm/kolibrin/kolibrin.c @@ -8,33 +8,24 @@ void main() { dword dirbuf, fcount, filename, i; dword dirbuf2, fcount2, filename2, j; - char cd_path[4096]; + char drive_name[4096]; char install_path[4096]; - signed int result; pause(200); GetDir(#dirbuf, #fcount, "/", DIRS_ONLYREAL); for (i=0; i0) ExitProcess(); - } + for (j=0; j 0) ExitProcess(); } } notify("'KolibriN\nНе могу найти installer.kex ни в одном корне диска!\nПопробуйте найти и запустить его вручную.' -dtE"); diff --git a/programs/cmm/lib/fs.h b/programs/cmm/lib/fs.h index e8a0120d2b..64e8e89de7 100644 --- a/programs/cmm/lib/fs.h +++ b/programs/cmm/lib/fs.h @@ -177,6 +177,13 @@ $int 0x40 } +inline fastcall void SetCurDir( ECX) +{ + EAX=30; + EBX=1; + $int 0x40 +} + //===================================================// // // // Misc // diff --git a/programs/cmm/lib/gui.h b/programs/cmm/lib/gui.h index 3d13329255..c8215733dc 100644 --- a/programs/cmm/lib/gui.h +++ b/programs/cmm/lib/gui.h @@ -193,7 +193,7 @@ PutShadow(x+1,y+h+3,w+1,1,skinned,1); } -:void GrayScaleImage(dword color_image, w, h) +:dword GrayScaleImage(dword color_image, w, h) { dword i,gray,to,rr,gg,bb; to = w*h*3 + color_image; @@ -208,6 +208,7 @@ gray = sqrt(gray) / 3; DSBYTE[i] = DSBYTE[i+1] = DSBYTE[i+2] = gray; } + return gray; } :void ShadowImage(dword color_image, w, h, strength) diff --git a/programs/cmm/lib/keyboard.h b/programs/cmm/lib/keyboard.h index 367562790b..ec9f5ff967 100644 --- a/programs/cmm/lib/keyboard.h +++ b/programs/cmm/lib/keyboard.h @@ -10,6 +10,10 @@ #define ASCII_KEY_INS 185 #define ASCII_KEY_SPACE 032 +#define ASCII_KEY_PLUS 043 +#define ASCII_KEY_MINUS 045 +#define ASCII_KEY_EQU 061 + #define ASCII_KEY_LEFT 176 #define ASCII_KEY_RIGHT 179 #define ASCII_KEY_DOWN 177 diff --git a/programs/cmm/lib/kolibri.h b/programs/cmm/lib/kolibri.h index 2b1e36ec6e..dff2e641cb 100644 --- a/programs/cmm/lib/kolibri.h +++ b/programs/cmm/lib/kolibri.h @@ -287,14 +287,6 @@ inline fastcall ExitProcess() //------------------------------------------------------------------------------ -inline fastcall void SetCurDir( ECX) -{ - EAX=30; - EBX=1; - $int 0x40 -} - - //eax = ├┐├з├╗├к ├▒├и├▒├▓├е├м├╗ (1=eng, 2=fi, 3=ger, 4=rus) #define SYS_LANG_ENG 1 #define SYS_LANG_FIN 2 @@ -592,18 +584,20 @@ inline fastcall void PutPixel( EBX,ECX,EDX) :void EventDragWindow() { + proc_info Form1; dword tmp_x,tmp_y; dword z1,z2; tmp_x = mouse.x; tmp_y = mouse.y; do { + GetProcessInfo(#Form1, SelfInfo); mouse.get(); if (tmp_x!=mouse.x) || (tmp_y!=mouse.y) { - z1 = Form.left + mouse.x - tmp_x; - z2 = Form.top + mouse.y - tmp_y; - if(z1<=10) || (z1>20000) z1=0; else if(z1>screen.width-Form.width-10)z1=screen.width-Form.width; - if(z2<=10) || (z2>20000) z2=0; else if(z2>screen.height-Form.height-10)z2=screen.height-Form.height; + z1 = Form1.left + mouse.x - tmp_x; + z2 = Form1.top + mouse.y - tmp_y; + if(z1<=10) || (z1>20000) z1=0; else if(z1>screen.width-Form1.width-10)z1=screen.width-Form1.width; + if(z2<=10) || (z2>20000) z2=0; else if(z2>screen.height-Form1.height-10)z2=screen.height-Form1.height; MoveSize(z1 , z2, OLD, OLD); draw_window(); } diff --git a/programs/cmm/lib/mouse.h b/programs/cmm/lib/mouse.h index 64d6d89861..88008bd8e3 100644 --- a/programs/cmm/lib/mouse.h +++ b/programs/cmm/lib/mouse.h @@ -27,7 +27,8 @@ :struct MOUSE { - signed x,y,xx,yy,lkm,mkm,pkm,key,tmp,tmp_time,hor,vert,down,up,move,click,dblclick,drag,left,top; + signed x,y,xx,yy,lkm,mkm,pkm,key,tmp,tmp_time,hor,vert,left,top; + bool down,up,move,click,dblclick,drag; dword handle,_; byte cmd; void get(); @@ -187,8 +188,6 @@ vert = EBX; } - - :void MOUSE::slider() { signed _x,_y; diff --git a/programs/cmm/lib/obj/box_lib.h b/programs/cmm/lib/obj/box_lib.h index d76dfb6678..affb20dc9a 100644 --- a/programs/cmm/lib/obj/box_lib.h +++ b/programs/cmm/lib/obj/box_lib.h @@ -81,6 +81,29 @@ PathShow_prepare stdcall(#PathShow); PathShow_draw stdcall(#PathShow); */ +//editbox flags +#define ed_pass 1b +#define ed_focus 10b //focused +#define ed_shift 100b //flag is set when Shift is pressed +#define ed_shift_on 1000b +#define ed_shift_bac 10000b //bif for Shift reset, if set the smth is selected +#define ed_left_fl 100000b +#define ed_offset_fl 1000000b +#define ed_insert 10000000b +#define ed_mouse_on 100000000b +#define ed_mous_adn_b 100011000b +#define ed_always_focus 100000000000000b +#define ed_figure_only 1000000000000000b //symbols only +#define ed_shift_cl 1111111111100011b +#define ed_shift_mcl 1111111111111011b +#define ed_shift_off 1111111111111011b +#define ed_shift_on_off 1111111111110111b +#define ed_shift_bac_cl 1111111111101111b +#define ed_right_fl 1111111111011111b +#define ed_offset_cl 1111111110111111b +#define ed_insert_cl 1111111101111111b +#define ed_mouse_on_off 1111111011111111b + struct edit_box{ dword width, left, diff --git a/programs/cmm/lib/patterns/http_downloader.h b/programs/cmm/lib/patterns/http_downloader.h index 5a6ec391f3..cb91f829bb 100644 --- a/programs/cmm/lib/patterns/http_downloader.h +++ b/programs/cmm/lib/patterns/http_downloader.h @@ -164,7 +164,7 @@ int check_is_the_adress_local(dword _in) if(!strncmp(_in,"sys/",4)) return true; if(!strncmp(_in,"tmp/",4)) return true; if(!strncmp(_in,"usbhd",5)) return true; - if(!strncmp(_in,"kolibrios",10)) return true; + if(!strncmp(_in,"kolibrios",9)) return true; return false; } diff --git a/programs/cmm/lib/patterns/rgb.h b/programs/cmm/lib/patterns/rgb.h index 20cdfb30e1..c43dedf328 100644 --- a/programs/cmm/lib/patterns/rgb.h +++ b/programs/cmm/lib/patterns/rgb.h @@ -32,10 +32,14 @@ return _r + _g + _b; } -:dword MixColors(dword _base, _overlying, byte a) +:dword MixColors(dword _base, _overlying, dword a) { _rgb rgb1, rgb2, rgb_final; - byte n_a; + dword n_a; + if (a<0) || (a>255) { + debug("Wrong alpha param in MixColors()!"); + debugval("alpha", a); + } rgb1.DwordToRgb(_base); rgb2.DwordToRgb(_overlying); diff --git a/programs/cmm/notes/engine.h b/programs/cmm/notes/engine.h index 1dd1853a52..a26e034ad7 100644 --- a/programs/cmm/notes/engine.h +++ b/programs/cmm/notes/engine.h @@ -1,11 +1,10 @@ -#define LINES_COUNT 13 #define MAX_LINE_CHARS 256 #define CHBOX 12 #define CHECKBOX_ID 50 unsigned char checkbox[sizeof(file "checkbox.raw")]= FROM "checkbox.raw"; -#define COL_BG_ACTIVE 0xFFE56B +#define COL_BG_ACTIVE 0xFFF0A9 #define COL_BG_INACTIVE 0xFFFFFF //===================================================// @@ -18,16 +17,23 @@ struct NOTE_LINE { bool state; char data[MAX_LINE_CHARS]; + void Delete(); }; +void NOTE_LINE::Delete() +{ + state=false; + data[0]=' '; + data[1]=NULL; +} + //===================================================// // // // LIST // // // //===================================================// -struct NOTES { - llist list; +struct NOTES : llist { char txt_path[4096]; char txt_data[MAX_LINE_CHARS*LINES_COUNT]; @@ -36,7 +42,7 @@ struct NOTES { char edit_active; int OpenTxt(); int SaveTxt(); - void DeleteCurrentNode(); + void DeleteNode(); void DrawList(); dword DrawLine(int line_n, draw_h); } notes; @@ -71,7 +77,12 @@ int NOTES::OpenTxt(dword file_path) linepos++; i++; } - list.count = item_n; + while (item_n < LINES_COUNT) + { + //lines[item_n].Delete(); + item_n++; + } + count = LINES_COUNT; return 1; } } @@ -81,7 +92,7 @@ int NOTES::SaveTxt() int i; dword tm; strcpy(#txt_data, "notes"); - for (i=0; i<=list.count; i++) + for (i=0; i<=count; i++) { if (lines[i].state==false) strcat(#txt_data, "\n- "); else strcat(#txt_data, "\n+ "); tm = #lines[i].data; @@ -90,15 +101,10 @@ int NOTES::SaveTxt() WriteFile(0, strlen(#txt_data), #txt_data, #txt_path); } -void NOTES::DeleteCurrentNode() -{ - return; -} - void NOTES::DrawList() { int i; - for (i=0; i=0) edit_box_mouse stdcall (#edit_box); break; case evButton: - btn = GetButtonID(); - if (CLOSE_BTN == btn) EventExitApp(); - if (DELETE_BTN == btn) + btn = GetButtonID(); + switch(btn) { - notes.DeleteCurrentNode(); - notes.DrawList(); - DeleteBtn.active = 0; - break; - } - if (btn>=CHECKBOX_ID) //checkboxes - { - notes.lines[btn-CHECKBOX_ID].state ^= 1; - notes.DrawList(); - break; - } + case CLOSE_BTN: + EventExitApp(); + break; + case DELETE_BTN: + EventDeleteCurrentNode(); + break; + default: + notes.lines[btn-CHECKBOX_ID].state ^= 1; + EventListRedraw(); + break; + } break; case evKey: GetKeys(); - if (SCAN_CODE_ESC == key_scancode) EventExitApp(); - if (SCAN_CODE_DOWN == key_scancode) { EventActivateLine(notes.list.cur_y+1); break; } - if (SCAN_CODE_UP == key_scancode) { EventActivateLine(notes.list.cur_y-1); break; } - if (notes.list.cur_y>=0) edit_box_key stdcall (#edit_box); + switch(key_scancode) + { + case SCAN_CODE_ESC: + EventExitApp(); + break; + case SCAN_CODE_DOWN: + EventActivateLine(notes.cur_y+1); + break; + case SCAN_CODE_UP: + EventActivateLine(notes.cur_y-1); + break; + default: + if (notes.cur_y>=0) { + EAX = key_editbox; + edit_box_key stdcall (#notebox); + } + + } break; case evReDraw: @@ -126,7 +140,6 @@ void main() } } - void DrawCloseButton(dword x,y,w,h) { DrawRectangle(x,y,w,h,0xC96832); @@ -139,33 +152,31 @@ void DrawCloseButton(dword x,y,w,h) void draw_window() { int i; - notes.list.SetSizes(1, HEADER_HEIGHT, 270, RED_LINE_X*LINES_COUNT, RED_LINE_X); - DefineAndDrawWindow(100,100,notes.list.w+1,notes.list.h+HEADER_HEIGHT+4,0x01,0,0,0x01fffFFF); - //DefineDragableWindow(100, 100, notes.list.w+1, notes.list.h+HEADER_HEIGHT+4); - GetProcessInfo(#Form, SelfInfo); - DrawRectangle3D(0,0,Form.width,TITLE_H-1,0xBB6535, 0xCD6F3B); - DrawRectangle3D(1,1,Form.width-2,TITLE_H-3,0xEFBFA4, 0xDD8452); - DrawBar(2,2,Form.width-3,TITLE_H-4,0xE08C5E); + DefineUnDragableWindow(100,100,WIN_W, WIN_H); + notes.SetSizes(RED_LINE_X+1, HEADER_HEIGHT, WIN_W-1, RED_LINE_X*LINES_COUNT, RED_LINE_X); + DrawRectangle3D(0,0,WIN_W,TITLE_H-1,0xBB6535, 0xCD6F3B); + DrawRectangle3D(1,1,WIN_W-2,TITLE_H-3,0xEFBFA4, 0xDD8452); + DrawBar(2,2,WIN_W-3,TITLE_H-4,0xE08C5E); WriteText(9,TITLE_H/2-6,0x90,0xA9613A,WINDOW_CAPTION); WriteTextB(7,TITLE_H/2-7,0x90,0xFFFfff,WINDOW_CAPTION); _PutImage(1, TITLE_H, 292,EDGE_H, #edge); - PutPixel(notes.list.x+RED_LINE_X, notes.list.y-1, COL_RED_LINE); + PutPixel(notes.x+RED_LINE_X, notes.y-1, COL_RED_LINE); ECX-=1; $int 0x40; - DrawCloseButton(Form.width-23,4,16,16); - DrawRectangle(0,TITLE_H,Form.width,Form.height-HEADER_HEIGHT+EDGE_H,0xBBBBBB); - for (i=0; lists[i]!=0; i++) DrawBar(1,Form.height-i-1, Form.width-1, 1, lists[i]); - edit_box.width = notes.list.w-RED_LINE_X-8; - edit_box.left = notes.list.x+RED_LINE_X+4; - - notes.DrawList(); + DrawCloseButton(WIN_W-23,4,16,16); + DrawRectangle(0,TITLE_H,WIN_W,WIN_H-HEADER_HEIGHT+EDGE_H,0xBBBBBB); + for (i=0; lists[i]!=0; i++) DrawBar(1,WIN_H-i-1, WIN_W-1, 1, lists[i]); + EventListRedraw(); } -void DrawEditBox_Notes() +void DrawEditBoxN() { - edit_box.pos = edit_box.offset = edit_box.shift = 0; - edit_box.size = strlen(edit_box.text); - edit_box.top = notes.list.cur_y*notes.list.item_h+4+notes.list.y; - edit_box_draw stdcall(#edit_box); + notebox.width = notes.w-notes.x-8; + notebox.left = notes.x+5; + notebox.pos = notebox.offset = notebox.shift = notebox.shift_old = 0; + notebox.cl_curs_x = notebox.cl_curs_y = 0; + notebox.size = strlen(notebox.text); + notebox.top = notes.cur_y*notes.item_h+4+notes.y; + edit_box_draw stdcall(#notebox); } //===================================================// @@ -176,17 +187,13 @@ void DrawEditBox_Notes() void EventActivateLine(int line_n) { - int old; - if (line_n<0) || (line_n>notes.list.count) return; - DeleteBtn.active = 0; - //redraw lines - notes.list.cur_y = line_n; - edit_box.text = notes.DrawLine(notes.list.cur_y, notes.list.item_h); - notes.DrawList(); - DrawEditBox_Notes(); + if (line_n<0) || (line_n>notes.count) return; + notes.cur_y = line_n; + notebox.text = notes.DrawLine(notes.cur_y, notes.item_h); + EventListRedraw(); + DrawEditBoxN(); } - void EventExitApp() { notes.SaveTxt(); @@ -195,19 +202,25 @@ void EventExitApp() void EventDrawDeleteButton() { - notes.DrawLine(notes.list.cur_y, notes.list.item_h); - DeleteBtn.Draw(notes.list.x+notes.list.w, notes.list.cur_y*notes.list.item_h+notes.list.y, notes.list.item_h); - edit_box.top=-20; - DeleteBtn.active = 1; + notes.DrawLine(notes.cur_y, notes.item_h); + delBtn.set_size(WIN_W-DELETE_W-1, notes.cur_y*notes.item_h+notes.y, DELETE_W, notes.item_h-1); + DefineButton(delBtn.x, delBtn.y, delBtn.w, delBtn.h, DELETE_BTN, 0xFF0000); + WriteText(delBtn.x+10, delBtn.h/2-3 + delBtn.y, 0x80, 0xFFFfff, DELETE_TEXT); + notebox.top=-20; + delete_active = true; } -void EventSelectItem() +void EventDeleteCurrentNode() { - int id; - id = mouse.y-notes.list.y/notes.list.item_h; - if (DeleteBtn.active) && (mouse.x>notes.list.x+notes.list.w-DeleteBtn.width) return; - if (id!=notes.list.cur_y) && (id w-MIN_PB_BLOCK_W) progress_w = w-MIN_PB_BLOCK_W; - DrawBar(x, y, w-progress_w, h, LOAD_ACTIVE); - sprintf(#param, "%i%s", active_value, mesure); - WriteText(w-progress_w- calc(strlen(#param)*8) /2 + x, h/2-7+y, 0x90, LOAD_BG, #param); + + DrawBar(x, y, w-progress_w, 1, MixColors(PROGRESS_ACTIVE, PROGRESS_BG, 200)); + DrawBar(x, y+1, w-progress_w, h-2, PROGRESS_ACTIVE); + DrawBar(x, y+h-1, w-progress_w, 1, MixColors(PROGRESS_ACTIVE, system.color.work_graph, 200)); - DrawBar(x+w-progress_w, y, progress_w, h, LOAD_BG); + + sprintf(#param, "%i%s", active_value, mesure); + WriteText(w-progress_w- calc(strlen(#param)*8) /2 + x, h/2-7+y, 0x90, PROGRESS_BG, #param); + + DrawBar(x+w-progress_w, y, progress_w, h, PROGRESS_BG); sprintf(#param, "%i%s", bg_value, mesure); - WriteText(-progress_w - calc(strlen(#param)*8)/2 + w+x, h/2-7+y, 0x90, LOAD_BG_TEXT, #param); + WriteText(-progress_w - calc(strlen(#param)*8)/2 + w+x, h/2-7+y, 0x90, PROGRESS_BG_TEXT, #param); } //===================================================// @@ -232,10 +238,10 @@ void MonitorCpu() WriteText(cpu.x+cpu.w-calc(strlen(#param)*8), cpu.y-25, 0x90, system.color.work_text, #param); for (i=0; i=20) { if (selected==id-20) OpenTmpDisk(); @@ -109,7 +116,7 @@ void Main_Window() AddDisk(); break; case SCAN_CODE_DEL: - if (disk_num<>0) DelDisk(); + DelDisk(); break; case SCAN_CODE_ENTER: OpenTmpDisk(); @@ -135,7 +142,7 @@ void Main_Window() break; case evReDraw: system.color.get(); - DefineAndDrawWindow(170,150,405,290,0x74,system.color.work,"Virtual Disk Manager 0.67",0); + DefineAndDrawWindow(170,150,405,290,0x74,system.color.work,"Virtual Disk Manager 0.67a",0); GetProcessInfo(#Form, SelfInfo); if (Form.status_window>2) break; @@ -284,6 +291,11 @@ void DelDisk() notify(NOTIFY_TEXT_NO_DISK); return; } + if (disk_list[selected].Item[3]=='0') && (! key_modifier & KEY_LSHIFT) && (! key_modifier & KEY_RSHIFT) + { + notify(NOTIFY_SYSTEM_DISK0); + return; + } param[0]='d'; param[1]=disk_list[selected].Item[3]; err = byte Console_Work();