From 80c86aab650744953c43a07e2aee75b6e8a22a15 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sun, 10 Jan 2016 20:02:47 +0000 Subject: [PATCH] CMM: a lot of small changes git-svn-id: svn://kolibrios.org@6050 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/Calypte/Calypte.c | 1 - programs/cmm/Calypte/include/gui.h | 23 ---------- programs/cmm/Calypte/include/properties.h | 4 +- programs/cmm/eolite/Eolite.c | 10 ++-- programs/cmm/eolite/include/about.h | 11 +++-- programs/cmm/eolite/include/gui.h | 14 +++--- programs/cmm/eolite/include/progress_dialog.h | 2 +- programs/cmm/eolite/include/properties.h | 8 ++-- programs/cmm/eolite/include/settings.h | 4 +- programs/cmm/eolite/include/translations.h | 4 +- programs/cmm/examples/compile.bat | 20 +++++--- programs/cmm/examples/example.c | 46 ------------------- programs/cmm/examples/window.c | 42 +++++++++++++++++ programs/cmm/lib/kolibri.h | 1 + programs/cmm/lib/patterns/rgb.h | 19 +++++++- 15 files changed, 103 insertions(+), 106 deletions(-) delete mode 100644 programs/cmm/Calypte/include/gui.h delete mode 100644 programs/cmm/examples/example.c create mode 100644 programs/cmm/examples/window.c diff --git a/programs/cmm/Calypte/Calypte.c b/programs/cmm/Calypte/Calypte.c index 86ec88c34f..fcb87ffebc 100644 --- a/programs/cmm/Calypte/Calypte.c +++ b/programs/cmm/Calypte/Calypte.c @@ -118,7 +118,6 @@ byte active_properties = 0; int encoding; dword properties_window; -#include "include\gui.h" #include "include\properties.h" struct filter diff --git a/programs/cmm/Calypte/include/gui.h b/programs/cmm/Calypte/include/gui.h deleted file mode 100644 index f18e7fad34..0000000000 --- a/programs/cmm/Calypte/include/gui.h +++ /dev/null @@ -1,23 +0,0 @@ -#define COL_PADDING 0xC8C9C9 - -dword col_palette[14] = {0xD2D3D3,0xD4D4D4,0xD6D5D6,0xD8D7D8,0xDAD8D9,0xDCDADB, -0xDFDCDD,0xE1DDDE,0xE2DEE0,0xE4DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1}; - -void DrawFlatButton(dword x,y,width,height,id,color,text) -{ - int fill_h; - DrawRectangle(x,y,width,height,system.color.work_graph); - DrawRectangle3D(x+1,y+1,width-2,height-2,0xFEFEFE,COL_PADDING); - PutPixel(x+width-1, y+1, COL_PADDING); - if (color!=-1) DrawFilledBar(x+2, y+2, width-3, height-3); - IF (id<>0) DefineButton(x+1,y+1,width-2,height-2,id+BT_HIDE,0xEFEBEF); - WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,system.color.work_text,text); -} - -void DrawFilledBar(dword x, y, w, h) -{ - int i, fill_h; - if (h <= 14) fill_h = h; else fill_h = 14; - for (i=0; i2) break; - _PutImage(10, 15, 86, 86, #logo); - WriteTextB(110,15,0x81,0xBF40BF,ABOUT_TITLE); + if (about_form.status_window>2) break; + _PutImage(10, 23, 86, 86, #logo); + WriteTextB(112,16,0x82,0xD49CD2,ABOUT_TITLE); + WriteTextB(110,14,0x82,0xBF40BF,ABOUT_TITLE); WriteTextLines(110,53,10010000b,0,DEVELOPERS_TEXT,21); #ifdef LANG_RUS - DrawFlatButton(about_form.cwidth-310,about_form.cheight-38,180,26,11,0xE4DFE1,"ˆáâ®à¨ï ࠧࠡ®âª¨"); + DrawFlatButton(about_form.cwidth-310,about_form.cheight-38,180,26,11,"ˆáâ®à¨ï ࠧࠡ®âª¨"); #endif - DrawFlatButton(about_form.cwidth-110,about_form.cheight-38, 90,26,10,0xE4DFE1,CLOSE_BUTTON_TEXT); + DrawFlatButton(about_form.cwidth-110,about_form.cheight-38, 90,26,10,CLOSE_BUTTON_TEXT); } } diff --git a/programs/cmm/eolite/include/gui.h b/programs/cmm/eolite/include/gui.h index 2346743edf..3d6ef8e632 100644 --- a/programs/cmm/eolite/include/gui.h +++ b/programs/cmm/eolite/include/gui.h @@ -23,7 +23,8 @@ void Scroll() { if (sc_slider_h > sc_h-sc_slider_y+56) || (files.first+files.visible>=files.count) sc_slider_y= Form.cheight - 19 - sc_slider_h; //äëÿ áîëüøîãî ñïèñêà } //slider - DrawFlatButton(sc_x,sc_slider_y,16,sc_slider_h,0,-1,""); + DrawRectangle(sc_x,sc_slider_y,16,sc_slider_h,system.color.work_graph); + DrawRectangle3D(sc_x+1,sc_slider_y+1,14,sc_slider_h-2,0xFEFEFE,col_padding); if (!scroll_used) for (i=0; i<13; i++) DrawBar(sc_x + 2 + i, sc_slider_y+2, 1, sc_slider_h-3, col_palette[13-i]); if (scroll_used) for (i=0; i<13; i++) DrawBar(sc_x + 2 + i, sc_slider_y+2, 1, sc_slider_h-3, col_palette[i]); //area before slider @@ -42,14 +43,13 @@ void Scroll() { } } -void DrawFlatButton(dword x,y,width,height,id,color,text) +void DrawFlatButton(dword x,y,width,height,id,text) { - int fill_h; DrawRectangle(x,y,width,height,system.color.work_graph); DrawRectangle3D(x+1,y+1,width-2,height-2,0xFEFEFE,col_padding); PutPixel(x+width-1, y+1, col_padding); - if (color!=-1) DrawFilledBar(x+2, y+2, width-3, height-3); - IF (id<>0) DefineButton(x+1,y+1,width-2,height-2,id+BT_HIDE,0xEFEBEF); + DrawFilledBar(x+2, y+2, width-3, height-3); + if (id) DefineButton(x+1,y+1,width-2,height-2,id+BT_HIDE,0xEFEBEF); if (height<18) WriteText(-strlen(text)*6+width/2+x+1,height/2+y-3,0x80,system.color.work_text,text); else @@ -74,6 +74,6 @@ void DrawEolitePopup(dword b1_text, b2_text) int b1_x = dform_x + button_margin; int b2_x = dform_x + button_margin + b1_len + button_margin; DrawPopup(dform_x, 160, form_w, 90, 1, system.color.work, system.color.work_graph); - DrawFlatButton(b1_x, 210, b1_len, 24, 301, 0xFFB6B5, b1_text); - DrawFlatButton(b2_x, 210, b2_len, 24, 302, 0xC6DFC6, b2_text); + DrawFlatButton(b1_x, 210, b1_len, 24, 301, b1_text); + DrawFlatButton(b2_x, 210, b2_len, 24, 302, b2_text); } \ No newline at end of file diff --git a/programs/cmm/eolite/include/progress_dialog.h b/programs/cmm/eolite/include/progress_dialog.h index 40550e530c..fc298944e4 100644 --- a/programs/cmm/eolite/include/progress_dialog.h +++ b/programs/cmm/eolite/include/progress_dialog.h @@ -27,7 +27,7 @@ void DisplayOperationForm() else if (operation_flag==MOVE_FLAG) WriteText(45, 11, 0x80, system.color.work_text, T_MOVE_WINDOW_TEXT); else WriteText(45, 11, 0x80, system.color.work_text, T_DELETE_WINDOW_TEXT); - DrawFlatButton(Dialog_Form.cwidth - 96, Dialog_Form.cheight - 32, 80, 22, 10, system.color.work_button, T_ABORT_WINDOW_BUTTON); + DrawFlatButton(Dialog_Form.cwidth - 96, Dialog_Form.cheight - 32, 80, 22, 10, T_ABORT_WINDOW_BUTTON); DrawBar(8, 10, 32, 32, 0xFFFfff); break; } diff --git a/programs/cmm/eolite/include/properties.h b/programs/cmm/eolite/include/properties.h index 26b559cf97..f04fa6c495 100644 --- a/programs/cmm/eolite/include/properties.h +++ b/programs/cmm/eolite/include/properties.h @@ -147,8 +147,8 @@ void Quest() DrawPopup(30,80,200,90,1,system.color.work, system.color.work_graph); WriteText(50, 100, 0x80, 0x000000, QUEST_1); WriteText(80, 115, 0x80, 0x000000, QUEST_2); - DrawFlatButton(52,138,70,20,301,0xFFB6B5,T_YES); - DrawFlatButton(145,138,70,20,302,0xC6DFC6,T_NO); + DrawFlatButton(52,138,70,20,301,T_YES); + DrawFlatButton(145,138,70,20,302,T_NO); } void GetSizeDir(dword way) @@ -321,8 +321,8 @@ void DrawPropertiesWindow() { DefineAndDrawWindow(Form.left + 150,150,270,285+GetSkinHeight(),0x34,system.color.work,WINDOW_TITLE_PROPERTIES); GetProcessInfo(#settings_form, SelfInfo); - DrawFlatButton(settings_form.cwidth - 80 - 13, settings_form.cheight - 34, 80, 24, 10, 0xE4DFE1, BTN_CLOSE); - DrawFlatButton(settings_form.cwidth - 170 - 13, settings_form.cheight - 34, 80, 24, 11, 0xE4DFE1, BTN_APPLY); + DrawFlatButton(settings_form.cwidth - 80 - 13, settings_form.cheight - 34, 80, 24, 10, BTN_CLOSE); + DrawFlatButton(settings_form.cwidth - 170 - 13, settings_form.cheight - 34, 80, 24, 11, BTN_APPLY); DrawBar(10, 10, 32, 32, 0xFFFfff); WriteText(10, 50, 0x80, 0x000000, PR_T_DEST); diff --git a/programs/cmm/eolite/include/settings.h b/programs/cmm/eolite/include/settings.h index c0336e0d7a..473b3942d0 100644 --- a/programs/cmm/eolite/include/settings.h +++ b/programs/cmm/eolite/include/settings.h @@ -66,8 +66,8 @@ void settings_dialog() case evReDraw: DefineAndDrawWindow(Form.left + Form.width/2-10, Form.top + Form.height/2 - 75, 370, 243+GetSkinHeight(),0x34,system.color.work,TITLE_SETT); DrawSettingsCheckBoxes(); - DrawFlatButton(9, 166, strlen(SAVE_PATH_AS_DEFAULT)+3*8, 24, 6, 0xE4DFE1, SAVE_PATH_AS_DEFAULT); - DrawFlatButton(9, 200, strlen(EDIT_FILE_ASSOCIATIONS)+3*8, 24, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS); + DrawFlatButton(9, 166, strlen(SAVE_PATH_AS_DEFAULT)+3*8, 24, 6, SAVE_PATH_AS_DEFAULT); + DrawFlatButton(9, 200, strlen(EDIT_FILE_ASSOCIATIONS)+3*8, 24, 5, EDIT_FILE_ASSOCIATIONS); } } } diff --git a/programs/cmm/eolite/include/translations.h b/programs/cmm/eolite/include/translations.h index f1d15696c6..201755e588 100644 --- a/programs/cmm/eolite/include/translations.h +++ b/programs/cmm/eolite/include/translations.h @@ -1,5 +1,5 @@ -#define TITLE "Eolite File Manager v3.36" -#define ABOUT_TITLE "Eolite 3.36" +#define TITLE "Eolite File Manager v3.37" +#define ABOUT_TITLE "EOLITE 3.37" #ifdef LANG_RUS ?define T_FILE "” ©«" diff --git a/programs/cmm/examples/compile.bat b/programs/cmm/examples/compile.bat index 162813961e..28f174e891 100644 --- a/programs/cmm/examples/compile.bat +++ b/programs/cmm/examples/compile.bat @@ -1,14 +1,20 @@ -c-- example.c +c-- window.c c-- collections.c c-- menu.c +c-- mixcolors.c -@del @@example -@del @@collections -@del @@menu +@echo off +@del _window +@del _collections +@del _menu +@del _mixcolors -@rename example.com @@example -@rename collections.com @@collections -@rename menu.com @@menu +@rename window.com _window +@rename collections.com _collections +@rename menu.com _menu +@rename mixcolors.com _mixcolors @del warning.txt +@echo on + @pause \ No newline at end of file diff --git a/programs/cmm/examples/example.c b/programs/cmm/examples/example.c deleted file mode 100644 index 047b7fd24f..0000000000 --- a/programs/cmm/examples/example.c +++ /dev/null @@ -1,46 +0,0 @@ -#define MEMSIZE 0x3E80 - -#include "../lib/io.h" - -void main() -{ - int id, key, i; - dword file; - io.dir.load(0,DIR_ONLYREAL); - loop() - { - switch(WaitEvent()) - { - case evButton: - id=GetButtonID(); - if (id==1) ExitProcess(); - break; - - case evKey: - key = GetKey(); - if (key==013){ //Enter - draw_window(); - - } - break; - - case evReDraw: - draw_window(); - break; - } - } -} -void draw_window() -{ - proc_info Form; - int i; - i=0; - DefineAndDrawWindow(215,100,250,200,0x34,0xFFFFFF,"Window header"); - GetProcessInfo(#Form, SelfInfo); - while(i