From cabc9ee63e2da533d3b01e3781de7f3984467dd2 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Fri, 20 Mar 2015 23:40:49 +0000 Subject: [PATCH] CMM: minor fixes git-svn-id: svn://kolibrios.org@5542 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/eolite/include/settings.h | 5 +++-- programs/cmm/lib/file_system.h | 20 +++++++++++++++++++- programs/cmm/lib/gui.h | 17 ++++++++++++----- programs/cmm/panels_cfg/panels_cfg.c | 2 +- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/programs/cmm/eolite/include/settings.h b/programs/cmm/eolite/include/settings.h index e37a87cfc8..88d221f71d 100644 --- a/programs/cmm/eolite/include/settings.h +++ b/programs/cmm/eolite/include/settings.h @@ -91,8 +91,8 @@ void DrawSettingsCheckBoxes() CheckBox2(10, 11, 20, SHOW_DEVICE_CLASS, show_dev_name); CheckBox2(10, 33, 21, SHOW_REAL_NAMES, real_files_names_case); CheckBox2(10, 55, 22, NOTIFY_COPY_END, info_after_copy); - CheckBox2(10, 77, 23, USE_BIG_FONTS, use_big_fonts); - MoreLessBox(10, 104, 18, 25, 26, sc.work_graph, 0xD2D3D3, 0x000000, files.line_h, LIST_LINE_HEIGHT); + CheckBox2(10, 77, 23, USE_BIG_FONTS, use_big_fonts); + MoreLessBox(10, 104, 18, 25, 26, #sc, files.line_h, LIST_LINE_HEIGHT); } @@ -149,6 +149,7 @@ void SetAppColors() sc.work = 0xE4DFE1; sc.work_text = 0; sc.work_graph = 0x9098B0; //A0A0B8; //0x819FC5; + sc.work_button = 0xD2D3D3; sc.work_button_text = 0x000000; col_padding = 0xC8C9C9; //col_selec = 0x94AECE; diff --git a/programs/cmm/lib/file_system.h b/programs/cmm/lib/file_system.h index 6eaa9dfad1..a30b6a6b9c 100644 --- a/programs/cmm/lib/file_system.h +++ b/programs/cmm/lib/file_system.h @@ -156,7 +156,25 @@ $mov eax,70 $mov ebx,#write_file_70.func $int 0x40 -} +} + +////////////////////////////////////////// +// WriteInFileThatAlredyExists // +////////////////////////////////////////// +:f70 write_file_offset_70; +:int WriteFileWithOffset(dword write_data_size, write_buffer, write_file_path, offset) +{ + write_file_offset_70.func = 3; + write_file_offset_70.param1 = offset; + write_file_offset_70.param2 = 0; + write_file_offset_70.param3 = write_data_size; + write_file_offset_70.param4 = write_buffer; + write_file_offset_70.rezerv = 0; + write_file_offset_70.name = write_file_path; + $mov eax,70 + $mov ebx,#write_file_offset_70.func + $int 0x40 +} /////////////////////////// // Прочитать папку // diff --git a/programs/cmm/lib/gui.h b/programs/cmm/lib/gui.h index 7cb75f303f..955b7ef9cb 100644 --- a/programs/cmm/lib/gui.h +++ b/programs/cmm/lib/gui.h @@ -65,17 +65,24 @@ } } -:void MoreLessBox(dword x,y,s, bt_id_more, bt_id_less, color_border, color_button, color_text, value, text) +:void MoreLessBox(dword x,y,s, bt_id_more, bt_id_less, colors_pointer, value, text) { #define VALUE_FIELD_W 26; - DrawRectangle(x, y, VALUE_FIELD_W, s, color_border); + system_colors colors; + ESI = colors_pointer; + colors.work_graph = ESI.system_colors.work_graph; + colors.work_text = ESI.system_colors.work_text; + colors.work_button = ESI.system_colors.work_button; + colors.work_button_text = ESI.system_colors.work_button_text; + + DrawRectangle(x, y, VALUE_FIELD_W, s, colors.work_graph); DrawRectangle3D(x+1, y+1, VALUE_FIELD_W-2, s-2, 0xDDDddd, 0xffffff); DrawBar(x+2, y+2, VALUE_FIELD_W-3, s-3, 0xffffff); WriteText(x+6, s / 2 + y -3, 0x80, 0x000000, itoa(value)); - DrawCaptButton(VALUE_FIELD_W + x + 1, y, s, s, bt_id_more, color_button, color_text, "+"); - DrawCaptButton(VALUE_FIELD_W + x + s + 2, y, s, s, bt_id_less, color_button, color_text, "-"); - WriteText(x+VALUE_FIELD_W+s+s+10, s / 2 + y -3, 0x80, color_text, text); + DrawCaptButton(VALUE_FIELD_W + x + 1, y, s, s, bt_id_more, colors.work_button, colors.work_button_text, "+"); + DrawCaptButton(VALUE_FIELD_W + x + s + 2, y, s, s, bt_id_less, colors.work_button, colors.work_button_text, "-"); + WriteText(x+VALUE_FIELD_W+s+s+10, s / 2 + y -3, 0x80, colors.work_text, text); } :void DrawProgressBar(dword st_x, st_y, st_w, st_h, col_fon, col_border, col_fill, col_text, progress_percent) diff --git a/programs/cmm/panels_cfg/panels_cfg.c b/programs/cmm/panels_cfg/panels_cfg.c index 3db6c99853..b1a6bdf10d 100644 --- a/programs/cmm/panels_cfg/panels_cfg.c +++ b/programs/cmm/panels_cfg/panels_cfg.c @@ -271,7 +271,7 @@ void PanelCfg_CheckBox(dword x, y, id, text, byte value) { } void PanelCfg_MoreLessBox(dword x, y, id_more, id_less; byte value; dword text) { - MoreLessBox(x, y, 18, id_more, id_less, sc.work_graph, sc.work_button, sc.work_text, value, text); + MoreLessBox(x, y, 18, id_more, id_less, #sc, value, text); }