forked from KolibriOS/kolibrios
CMM: a lot of small changes
git-svn-id: svn://kolibrios.org@6050 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
7d7d3e178a
commit
80c86aab65
@ -118,7 +118,6 @@ byte active_properties = 0;
|
||||
int encoding;
|
||||
dword properties_window;
|
||||
|
||||
#include "include\gui.h"
|
||||
#include "include\properties.h"
|
||||
|
||||
struct filter
|
||||
|
@ -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; i<fill_h; i++) DrawBar(x, y+i, w, 1, col_palette[14-i]);
|
||||
DrawBar(x, y+i, w, h-fill_h, col_palette[14-i]);
|
||||
}
|
@ -85,8 +85,8 @@ void properties_dialog()
|
||||
break;
|
||||
|
||||
case evReDraw:
|
||||
DefineAndDrawWindow(Form.left + 150,150,270,285+GetSkinHeight(),0x34,system.color.work,WINDOW_TITLE_PROPERTIES);
|
||||
DefineAndDrawWindow(Form.left + 150,150,270,285+skin_height,0x34,system.color.work,WINDOW_TITLE_PROPERTIES);
|
||||
GetProcessInfo(#settings_form, SelfInfo);
|
||||
DrawFlatButton(settings_form.cwidth - 70 - 13, settings_form.cheight - 34, 70, 22, 10, 0xE4DFE1, BTN_CLOSE);
|
||||
DrawCaptButton(settings_form.cwidth-70-13, settings_form.cheight-34, 70, 22, 10, 0x288FBD, 0xFFFfff, BTN_CLOSE);
|
||||
}
|
||||
}
|
@ -564,11 +564,11 @@ void draw_window()
|
||||
void DrawList()
|
||||
{
|
||||
word sorting_arrow_x;
|
||||
DrawFlatButton(files.x, files.y-17, files.w - 141,16,31,system.color.work,T_FILE);
|
||||
DrawFlatButton(files.x + files.w - 141, files.y-17,73,16,32,system.color.work,T_TYPE);
|
||||
DrawFlatButton(files.x + files.w - 68, files.y-17,68,16,33,system.color.work,T_SIZE);
|
||||
DrawFlatButton(files.x + files.w, files.y-17,16,16, 0,system.color.work,"\x18");
|
||||
DrawFlatButton(files.x + files.w,files.y+files.h-16,16,16,0,system.color.work,"\x19");
|
||||
DrawFlatButton(files.x, files.y-17, files.w - 141,16,31,T_FILE);
|
||||
DrawFlatButton(files.x + files.w - 141, files.y-17,73,16,32,T_TYPE);
|
||||
DrawFlatButton(files.x + files.w - 68, files.y-17,68,16,33,T_SIZE);
|
||||
DrawFlatButton(files.x + files.w, files.y-17,16,16, 0,"\x18");
|
||||
DrawFlatButton(files.x + files.w,files.y+files.h-16,16,16,0,"\x19");
|
||||
if (sort_num==1) sorting_arrow_x = files.w - 141 / 2 + files.x + 18;
|
||||
if (sort_num==2) sorting_arrow_x = files.x + files.w - 90;
|
||||
if (sort_num==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w;
|
||||
|
@ -42,13 +42,14 @@ void about_dialog()
|
||||
case evReDraw:
|
||||
DefineAndDrawWindow(Form.left+Form.width/2,Form.top+Form.height/2-114,440,200+GetSkinHeight(),0x34,system.color.work,0);
|
||||
GetProcessInfo(#about_form, SelfInfo);
|
||||
if (Form.status_window>2) 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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 "” ©«"
|
||||
|
@ -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
|
@ -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<io.dir.count)
|
||||
{
|
||||
WriteText(5,i*8+3,0x80,0xFF00FF,io.dir.position(i));
|
||||
i++;
|
||||
}
|
||||
WriteText(10,110,0x80,0,#param);
|
||||
}
|
42
programs/cmm/examples/window.c
Normal file
42
programs/cmm/examples/window.c
Normal file
@ -0,0 +1,42 @@
|
||||
#define MEMSIZE 4096*10
|
||||
|
||||
#include "../lib/io.h"
|
||||
#include "../lib/gui.h"
|
||||
|
||||
void main()
|
||||
{
|
||||
word id;
|
||||
dword file;
|
||||
io.dir.load(0,DIR_ONLYREAL);
|
||||
loop() switch(WaitEvent())
|
||||
{
|
||||
case evButton:
|
||||
id=GetButtonID();
|
||||
if (id==1) ExitProcess();
|
||||
break;
|
||||
|
||||
case evKey:
|
||||
GetKeys();
|
||||
if (key_scancode == SCAN_CODE_ESC ) ExitProcess();
|
||||
break;
|
||||
|
||||
case evReDraw:
|
||||
draw_window();
|
||||
break;
|
||||
}
|
||||
}
|
||||
void draw_window()
|
||||
{
|
||||
proc_info Form;
|
||||
int i;
|
||||
DefineAndDrawWindow(215,100,350,300,0x34,0xFFFFFF,"Window header");
|
||||
GetProcessInfo(#Form, SelfInfo);
|
||||
for (i=0; i<io.dir.count; i++)
|
||||
{
|
||||
WriteText(5,i*8+3,0x80,0xFF00FF,io.dir.position(i));
|
||||
}
|
||||
DrawCaptButton(100, 10, 100, 22, 22, 0xCCCccc, 0x000000, "Button");
|
||||
WriteText(100,50,0x80,0,"Textline small");
|
||||
WriteText(100,70,0x90,0,"Textline big");
|
||||
DrawBar(100, 110, 100, 100, 0x66AF86);
|
||||
}
|
@ -96,6 +96,7 @@ char program_path[4096];
|
||||
#define KEY_LWIN 01000000000b
|
||||
#define KEY_RWIN 10000000000b
|
||||
|
||||
dword calc(EAX) { return EAX; }
|
||||
|
||||
inline fastcall word GetKey() //+Gluk fix
|
||||
{
|
||||
|
@ -4,7 +4,7 @@ struct _rgb
|
||||
byte r,g,b;
|
||||
void DwordToRgb();
|
||||
dword RgbToDword();
|
||||
} rgb;
|
||||
};
|
||||
|
||||
void _rgb::DwordToRgb(dword _dword)
|
||||
{
|
||||
@ -20,3 +20,20 @@ dword _rgb::RgbToDword()
|
||||
_g = g << 8;
|
||||
return _b + _g + r;
|
||||
}
|
||||
|
||||
dword MixColors(dword _base, _overlying, byte a)
|
||||
{
|
||||
_rgb rgb1, rgb2, rgb;
|
||||
byte n_a;
|
||||
|
||||
rgb1.DwordToRgb(_base);
|
||||
rgb2.DwordToRgb(_overlying);
|
||||
|
||||
n_a = 255 - a;
|
||||
|
||||
rgb.b = calc(rgb1.b*a/255) + calc(rgb2.b*n_a/255);
|
||||
rgb.g = calc(rgb1.g*a/255) + calc(rgb2.g*n_a/255);
|
||||
rgb.r = calc(rgb1.r*a/255) + calc(rgb2.r*n_a/255);
|
||||
|
||||
return rgb.RgbToDword();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user