Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Ignore whitespace Rev 7461 → Rev 7462

/programs/cmm/eolite/Eolite.c
26,8 → 26,7
 
#include "../lib/patterns/history.h"
 
//images
#include "imgs/left_p.txt"
#include "imgs/images.h"
 
//Button IDs
enum {
51,7 → 50,7
ONLY_OPEN
};
 
dword col_padding=0, col_selec, col_lpanel, col_work, col_graph, col_list_line=0xDDD7CF;
dword col_selec, col_lpanel, col_work, col_graph, col_list_line=0xDDD7CF;
 
int toolbar_buttons_x[7]={9,46,85,134,167,203};
 
117,10 → 116,10
byte cmd_free=0;
#include "include\translations.h"
 
#include "include\gui.h"
#include "include\settings.h"
#include "include\progress_dialog.h"
#include "include\copy.h"
#include "include\gui.h"
#include "include\sorting.h"
#include "include\icons.h"
#include "include\left_panel.h"
264,8 → 263,8
 
if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+16) && (mouse.y>files.y-17) && (mouse.y<files.y)
{
if (mouse.lkm==1) DrawRectangle3D(files.x+files.w+1,files.y-16,14,14,0xC7C7C7,0xFFFFFF);
WHILE (mouse.lkm==1) && (files.first>0)
if (mouse.lkm) DrawRectangle3D(files.x+files.w+1,files.y-16,14,14,system.color.work_dark,system.color.work_light);
WHILE (mouse.lkm) && (files.first>0)
{
pause(8);
files.first--;
272,13 → 271,13
List_ReDraw();
mouse.get();
}
DrawRectangle3D(files.x+files.w+1,files.y-16,14,14,0xFFFFFF,0xC7C7C7);
DrawRectangle3D(files.x+files.w+1,files.y-16,14,14,system.color.work_light,system.color.work_dark);
}
 
if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+16) && (mouse.y>files.y+files.h-16) && (mouse.y<files.y+files.h)
{
if (mouse.lkm==1) DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,0xC7C7C7,0xFFFFFF);
while (mouse.lkm==1) && (files.first<files.count-files.visible)
if (mouse.lkm) DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,system.color.work_dark,system.color.work_light);
while (mouse.lkm) && (files.first<files.count-files.visible)
{
pause(8);
files.first++;
285,12 → 284,12
List_ReDraw();
mouse.get();
}
DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,0xFFFFFF,0xC7C7C7);
DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,system.color.work_light,system.color.work_dark);
}
 
//Scrooll
if (!mouse.lkm) && (scroll_used) { scroll_used=false; Scroll(); }
if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+18) && (mouse.y>files.y) && (mouse.y<files.y+files.h-18) && (mouse.lkm) && (!scroll_used) {scroll_used=true; Scroll();}
if (scroll_used) && (mouse.up) { scroll_used=false; Scroll(); }
if (scroll_used)
{
379,9 → 378,7
FnProcess(id-50);
break;
case 61: // Set path as default
ini.path = GetIni(#eolite_ini_path, "EOLITE.INI");
ini.section = "Config";
ini.SetString("DefaultPath", #path, strlen(#path));
SetDefaultPath(#path);
break;
case 100...120:
SystemDiscs.Click(id-100);
552,12 → 549,6
}
}
 
void DrawFavButton(int x)
{
_PutImage(x,10,20,22,#fav);
DefineHiddenButton(x+1,11,20-2,22-3,61);
}
 
void draw_window()
{
int i;
568,17 → 559,21
if (Form.height < 350) { MoveSize(OLD,OLD,OLD,350); return; }
if (Form.width < 480) { MoveSize(OLD,OLD,480,OLD); return; }
GetProcessInfo(#Form, SelfInfo); //if win_size changed
_PutImage(0,0,246,34,#toolbar);
ESDWORD[#toolbar_pal] = col_work;
ESDWORD[#toolbar_pal+4] = MixColors(0, col_work, 35);
PutPaletteImage(#toolbar, 246, 34, 0, 0, 8, #toolbar_pal);
DrawBar(127, 8, 1, 25, col_graph);
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);
DrawDot(Form.cwidth-17,12);
DrawDot(Form.cwidth-17,12+6);
DrawDot(Form.cwidth-17,12+12);
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
for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_palette[8-i]);
DrawRectangle(0,39,Form.cwidth-1,-show_status_bar.checked*status_bar_h + Form.cheight - 40,col_work_gradient[4]); //bg
for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_work_gradient[11-i]);
llist_copy(#files_active, #files);
strcpy(#active_path, #path);
DrawStatusBar();
597,7 → 592,7
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;
WriteText(sorting_arrow_x,files.y-12,0x80,col_graph,"\x19");
WriteText(sorting_arrow_x,files.y-12,0x80, system.color.work_text,"\x19");
DrawBar(files.x+files.w,files.y,1,files.h,col_graph);
if (two_panels.checked) && (files.x<5) DrawBar(files.x+files.w+16,files.y,1,files.h,col_graph);
}
608,7 → 603,7
int go_up_folder_exists=0;
if (!show_status_bar.checked) return;
if (files.count>0) && (strcmp(file_mas[0]*304+buf+72,"..")==0) go_up_folder_exists=1;
DrawBar(1, Form.cheight - status_bar_h-1, Form.cwidth-2, status_bar_h, system.color.work);
DrawBar(0, Form.cheight - status_bar_h, Form.cwidth, status_bar_h, system.color.work);
sprintf(#status_bar_str, STATUS_STR, files.count-go_up_folder_exists, count_dir-go_up_folder_exists, files.count-count_dir, selected_count);
WriteText(6,Form.cheight - 13,0x80,system.color.work_text,#status_bar_str);
}
/programs/cmm/eolite/imgs/icons.txt
File deleted
\ No newline at end of file
/programs/cmm/eolite/imgs/left_p.txt
File deleted
/programs/cmm/eolite/imgs/fav.raw
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/cmm/eolite/imgs/dots.raw
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/cmm/eolite/imgs/images.h
0,0 → 1,41
unsigned char blue_hl[]= FROM "imgs\blue_hl8.raw";
dword blue_hl_pal[]= {0x01699C,0x00699C,0x026A9C,0x02699C,
0x036A9C,0x046B9C,0x046A9C,0x056B9D,0x046B9D,0x066C9D,
0x066C9E,0x056C9D,0x076D9E,0x086E9F,0x066D9E,0x086D9E,
0x096E9F,0x076C9E,0x0A6FA0,0x0B6FA0,0x0A6E9F,0x0B70A1,
0x096F9F,0x0A6F9F,0x0C70A1,0x0B70A0,0x0D71A1,0x0C71A1,
0x0D71A2,0x0E71A2,0x086D9F,0x0F72A2,0x0E72A2,0x1072A2,
0x1172A2,0x0C70A0,0x1273A2,0x1373A2,0x1374A2,0x1474A3,
0x1475A3,0x1474A2,0x1272A2,0x1575A3,0x1676A4,0x1576A3,
0x1576A4,0x1777A4,0x1777A5,0x1878A5,0x1877A5,0x1776A4,
0x1675A3,0x1978A6,0x1978A5,0x1A78A6,0x1B78A6,0x1676A3,
0x0D70A1,0x1A77A6,0x1977A5,0x1977A6,0x1876A4,0x1876A5,
0x1776A5,0x1675A4,0x1775A4,0x1574A3,0x1574A2,0x1473A2,
0x0E71A1,0x1775A3,0x1674A3,0x1A79A6,0x1B79A7,0x1B79A6,
0x1A78A5,0x1C7AA7,0x1C79A7,0x1A77A5,0x1D7AA8,0x1D7AA7,
0x1173A2,0x1E7BA8,0x1D7BA8,0x1977A4,0x1F7CA8,0x1F7BA8,
0x1E7AA8,0x1C79A6,0x1575A4,0x207CA8,0x1E7AA7,0x1D79A7,
0x1976A4,0x217CA8,0x227CA8,0x207BA8,0x1976A5,0x1473A3,0};
 
unsigned char logo[] = FROM "imgs\logo.raw";
dword logo_pal[] = {0x00FF00,0x7C047C,0x940494,0x902C90,
0xBD8185,0xD43CD4,0x8C048C,0x9C689C,0xD858D8,0xA912A9,
0xC737C7,0xAC2CAC,0x850585,0x94148C,0xC444B4,0xBA2ABA,
0x9C049C,0x7C1C7C,0xB092AE,0xB42494,0xE96A1B,0xF19904,
0xFBA804,0xFCB70C,0x9B0594,0x740474,0xFCC729};
 
unsigned char toolbar[] = FROM "imgs\toolbar.raw";
dword toolbar_pal[] = { 0x00DD00,0xEE00FF,0x7BA9BE,0x809E4A,
0x6E6C6E,0x8A8889,0x508EA3,0xE1F0F8,0xF8F8FF,0x608722,
0xEEECEE,0xFCFCFF,0xD1D1D2,0x805F1E,0xF5F5F4,0x8FB3C5,
0x7995A2,0xBFCFA4,0x8BA65E,0xBC9341,0xF8EEBE,0xF8FBF1,
0xE5E4E4,0xEFF5E0,0xADABAD,0x9599A1,0x5A5A5A,0xF8E3A6,
0x5F8FA2,0xD2E7ED,0xE1E9CD,0xC0D9E3,0xC6DFE9,0xCFDDB7,
0x77983A,0xB3CFDB,0xF9D993,0x1C7093,0x659DB3,0xB5C98E,
0x9AC1D2,0x136C8E,0x4287A0,0xF8D382,0x64881E,0xA3BA76,
0x6C8F2A,0x116384,0xF7CA69,0x5A7F18,0x277B9E,0xE4B659,
0x075778,0x527B10,0x567BA2,0x257597,0x87BAEE,0x7AADE0,
0x3D6890,0x6A9CD0,0x125B7C,0x456E00};
 
unsigned char devices[]= FROM "imgs\dev.raw";
unsigned char factions[] = FROM "imgs\actions.raw";
/programs/cmm/eolite/imgs/logo.raw
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/programs/cmm/eolite/imgs/png/icons.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/cmm/eolite/imgs/png/dots.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/cmm/eolite/imgs/png/fav.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/cmm/eolite/imgs/png/Eolite-Sun.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/programs/cmm/eolite/imgs/png/toolbar.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/programs/cmm/eolite/imgs/toolbar.raw
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/programs/cmm/eolite/include/about.h
33,16 → 33,17
break;
case evReDraw:
DefineAndDrawWindow(Form.left+Form.width/2,Form.top+Form.height/2-114,310,300+skin_height,0x34,system.color.work,NULL,0);
DefineAndDrawWindow(Form.left+Form.width/2,Form.top+Form.height/2-114,300,300+skin_height,0x34,system.color.work,T_ABOUT,0);
GetProcessInfo(#about_form, SelfInfo);
if (about_form.status_window>2) break;
logo_pal[0] = system.color.work;
ESDWORD[#logo_pal+16] = system.color.work_dark;
PutPaletteImage(#logo,86,86,about_form.cwidth-86/2,10,8,#logo_pal);
about_x = -strlen(ABOUT_TITLE)*18+about_form.cwidth/2;
WriteTextB(about_x+2,107,0x82,0xD49CD2,ABOUT_TITLE);
WriteTextB(about_x,105,0x82,0x9D129D,ABOUT_TITLE);
DrawRectangle3D(0,154,about_form.cwidth,1,system.color.work_dark,system.color.work_light);
WriteTextLines(7,163,0x90,system.color.work_text,"KolibriOS File Manager\nAuthors: Leency, Veliant\nPunk_Joker, Pavelyakov\n(c) 2008 - 2018",20);
WriteTextLines(7,163,0x90,system.color.work_text,"KolibriOS File Manager\nAuthors: Leency, Veliant\nPunk_Joker, Pavelyakov\n2008 - 2018",20);
#ifdef LANG_RUS
DrawStandartCaptButton(60,about_form.cheight-38,11,"ˆáâ®à¨ï ࠧࠡ®âª¨");
#endif
/programs/cmm/eolite/include/breadcrumbs.h
6,8 → 6,10
DrawBar(PathShow.start_x-3, PathShow.start_y-6, PathShow.area_size_x+3, 19, 0xFFFfff);
DrawRectangle(PathShow.start_x-4,PathShow.start_y-7,PathShow.area_size_x+4,20,col_graph);
DefineHiddenButton(PathShow.start_x-4+1,PathShow.start_y-7+1,PathShow.area_size_x+4-2,20-2,PATH_BTN);
DrawBar(PathShow.start_x-4, PathShow.start_y+14, PathShow.area_size_x+4, 1, MixColors(col_work,0xFFFfff,120));
DrawFavButton(PathShow.start_x+PathShow.area_size_x);
DrawBar(PathShow.start_x-4, PathShow.start_y+14, PathShow.area_size_x+5+18, 1, system.color.work_light);
 
DrawFlatButtonSmall(PathShow.start_x+PathShow.area_size_x,PathShow.start_y-7,18,20, 61, "\26");
 
PathShow_prepare stdcall(#PathShow);
PathShow_draw stdcall(#PathShow);
}
/programs/cmm/eolite/include/gui.h
1,5 → 1,5
 
dword col_palette[14] = {0xD2D3D3,0xD4D4D4,0xD6D5D6,0xD8D7D8,0xDAD8D9,0xDCDADB,0xDFDCDD,0xE1DDDE,0xE2DEE0,0xE4DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1};
dword col_work_gradient[14];
 
void Scroll() {
dword i;
23,9 → 23,9
}
//slider
DrawRectangle(sc_x,sc_slider_y,16,sc_slider_h,col_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]);
DrawRectangle3D(sc_x+1,sc_slider_y+1,14,sc_slider_h-2, system.color.work_light , system.color.work_dark);
if (!scroll_used) for (i=0; i<13; i++) DrawBar(sc_x + 2 + i, sc_slider_y+2, 1, sc_slider_h-3, col_work_gradient[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_work_gradient[i]);
//area before slider
if (sc_slider_y > sc_y + 1)
{
45,11 → 45,11
void DrawFlatButtonSmall(dword x,y,width,height,id,text)
{
DrawRectangle(x,y,width,height,col_graph);
DrawRectangle3D(x+1,y+1,width-2,height-2,0xFEFEFE,col_padding);
PutPixel(x+width-1, y+1, col_padding);
DrawRectangle3D(x+1,y+1,width-2,height-2, system.color.work_light , system.color.work_dark);
PutPixel(x+width-1, y+1, system.color.work_dark);
DrawFilledBar(x+2, y+2, width-3, height-3);
if (id) DefineButton(x+1,y+1,width-2,height-2,id+BT_HIDE,0xEFEBEF);
WriteText(-strlen(text)*6+width/2+x+1,height/2+y-3,0x80,0x333333,text);
if (id) DefineHiddenButton(x+1,y+1,width-2,height-2,id);
WriteText(-strlen(text)*6+width/2+x+1,height/2+y-3,0x80,system.color.work_text,text);
}
 
void DrawFilledBar(dword x, y, w, h)
56,8 → 56,8
{
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]);
for (i=0; i<fill_h; i++) DrawBar(x, y+i, w, 1, col_work_gradient[14-i]);
DrawBar(x, y+i, w, h-fill_h, col_work_gradient[14-i]);
}
 
int popin_w=260;
68,4 → 68,14
DrawPopup(popin_x, 160, popin_w, 95, 1, system.color.work, col_graph);
but_x = DrawStandartCaptButton(popin_x+23, 215, POPUP_BTN1, b1_text);
DrawStandartCaptButton(popin_x+23 + but_x, 215, POPUP_BTN2, b2_text);
}
 
void DrawDot(dword x,y) {
dword col_pxl = MixColors(col_graph, col_work, 60);
DrawBar(x+1,y,2,4,col_graph);
DrawBar(x,y+1,4,2,col_graph);
PutPixel(x,y,col_pxl);
PutPixel(x+3,y,col_pxl);
PutPixel(x,y+3,col_pxl);
PutPixel(x+3,y+3,col_pxl);
}
/programs/cmm/eolite/include/left_panel.h
197,14 → 197,24
DrawLeftPanelBg();
}
 
dword col_palette_inner[14] = {0xD2D3D3,0xD4D4D4,0xD6D5D6,0xD8D7D8,0xDAD8D9,0xDCDADB,
0xDFDCDD,0xE1DDDE,0xE2DEE0,0xE4DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1};
void DrawFilledBarInner(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_inner[14-i]);
DrawBar(x, y+i, w, h-fill_h, col_palette_inner[14-i]);
}
 
void Tip(int y, dword caption, id, arrow)
{
DrawBar(17,y,160,1,0xEFEDEE);
DrawFilledBar(17, y+1, 160, 16);
DrawFilledBarInner(17, y+1, 160, 16);
WriteText(25,y+5,0x80,0x000000,caption);
if (id) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0); //arrow button
WriteText(165,y+5,0x80,0x000000,arrow); //arrow
DrawBar(17,y+17,160,1,col_graph);
DrawBar(17,y+17,160,1,0x7E87A3);
}
 
void ActionsDraw()
/programs/cmm/eolite/include/menu.h
100,6 → 100,11
{
int start_y=0;
int index;
 
dword m_col_bg;
dword m_col_text;
dword m_col_sh_text;
 
for (index=0; file_captions[index*3]!=0; index++)
{
if ((itdir) && (file_captions[index*3+2]>=200)) continue;
108,14 → 113,19
if (start_y/rbmenu.item_h==rbmenu.cur_y)
{
cur_action_buf = file_captions[index*3+2];
DrawBar(2,start_y+2,rbmenu.w-1,rbmenu.item_h,0xFFFfff);
m_col_bg = 0xFFFfff;
m_col_sh_text = 0xFAFAFA;
m_col_text = 0;
}
else
{
DrawBar(2,start_y+2,rbmenu.w-1,rbmenu.item_h,col_work);
WriteText(8,start_y+rbmenu.text_y+4,rbmenu.font_type,0xf2f2f2,file_captions[index*3]);
m_col_bg = col_work;
m_col_text = system.color.work_text;
m_col_sh_text = system.color.work_light;
}
WriteText(7, start_y + rbmenu.text_y + 3, rbmenu.font_type, 0, file_captions[index*3]);
DrawBar(2, start_y+2, rbmenu.w-1, rbmenu.item_h, m_col_bg);
WriteText(8, start_y + rbmenu.text_y + 4, rbmenu.font_type, m_col_sh_text, file_captions[index*3]);
WriteText(7, start_y + rbmenu.text_y + 3, rbmenu.font_type, m_col_text, file_captions[index*3]);
WriteText(-strlen(file_captions[index*3+1])-1*rbmenu.font_w + rbmenu.w, start_y + rbmenu.text_y + 3, rbmenu.font_type, 0x888888, file_captions[index*3+1]);
start_y+=rbmenu.item_h;
}
/programs/cmm/eolite/include/settings.h
82,7 → 82,7
}
else if (id==7)
{
ini.SetString("DefaultPath", #path_start,strlen(#path_start));
SetDefaultPath(#path_start);
break;
}
show_dev_name.click(id);
216,17 → 216,20
 
void SetAppColors()
{
int i;
system.color.get();
//system.color.work = 0xE4DFE1;
//system.color.work_text = 0;
//system.color.work_graph = 0x7E87A3; //A0A0B8;
//system.color.work_button = 0x7E87A3;
//system.color.work_button_text = 0x000000
 
for (i=0; i<=14; i++) col_work_gradient[14-i]= MixColors(0, system.color.work, i);
col_work = system.color.work;
col_graph = system.color.work_graph;
system.color.work_dark = MixColors(0, system.color.work, 35);
 
/*
col_work = 0xE4DFE1;
col_padding = 0xC8C9C9;
col_graph = 0x7E87A3;
*/
col_lpanel = 0x00699C;
col_selec = 0x94AECE;
col_lpanel = 0x00699C;
col_graph = 0x7E87A3;
}
 
 
261,3 → 264,9
}
BigFontsChange();
}
 
void SetDefaultPath(dword p)
{
ini.SetString("DefaultPath", p, strlen(p));
notify("'Default path has been set' -O");
}
/programs/cmm/eolite/include/translations.h
1,5 → 1,5
#define TITLE "Eolite File Manager v3.96d"
#define ABOUT_TITLE "EOLITE 3.96d"
#define TITLE "Eolite File Manager 4.0"
#define ABOUT_TITLE "EOLITE 4.0"
 
#ifdef LANG_RUS
?define T_FILE "” ©«"
31,6 → 31,7
?define DEL_MORE_FILES_2 " èâ.)?"
?define STATUS_STR "«¥¬¥­â®¢: %d  ¯®ª: %d ” ©«®¢: %d ‚뤥«¥­­®: %d"
?define COPY_PATH_STR "'ãâì ¯ ¯ª¨ ᪮¯¨à®¢ ­ ¢ ¡ãä¥à ®¡¬¥­ ' -I"
?define T_ABOUT "Ž ¯à®£à ¬¬¥"
#else
?define T_FILE "File"
?define T_TYPE "Type"
62,4 → 63,5
?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"
?define T_ABOUT "About"
#endif
/programs/cmm/txtread/prepare_page.h
34,7 → 34,7
if (mode==DRAW_BUF) {
EBX = bufoff-line_start;
strlcpy(#line, line_start, EBX);
kfont.WriteIntoBuffer(8,stroka_y,list.w,kfont.size.height, 0xFFFFFF, 0, kfont.size.pt, #line);
kfont.WriteIntoBuffer(8,stroka_y,list.w,kfont.size.height, bg_color, text_color, kfont.size.pt, #line);
stroka_y += list.item_h;
line_start = bufoff;
line_length = 30;
42,7 → 42,7
}
}
if (mode==COUNT_BUF_HEIGHT) list.count+=2;
if (mode==DRAW_BUF) kfont.WriteIntoBuffer(8,stroka_y,list.w,kfont.size.height, 0xFFFFFF, 0, kfont.size.pt, line_start);
if (mode==DRAW_BUF) kfont.WriteIntoBuffer(8,stroka_y,list.w,kfont.size.height, bg_color, text_color, kfont.size.pt, line_start);
}
 
void PreparePage()
/programs/cmm/txtread/txtread.c
20,7 → 20,7
#define DEFAULT_EDITOR "/sys/tinypad"
 
#define INTRO_TEXT "This is a plain Text Reader.\nTry to open some text file."
#define VERSION "Text Reader v1.21a"
#define VERSION "Text Reader v1.22"
#define ABOUT "Idea: Leency, punk_joker
Code: Leency, Veliant, KolibriOS Team
 
30,7 → 30,7
Ctrl+Up - bigger font
Ctrl+Down - smaller font
Ctrl+Tab - select charset
Ctrl+E - edit current document
Ctrl+E - reopen current file in another app
Press any key..."
 
45,6 → 45,7
 
bool help_opened = false;
int charsets_menu_left = 0;
int reopenin_menu_left = 0;
 
enum {
OPEN_FILE,
58,10 → 59,12
 
int encoding;
 
dword bg_color = 0xF0F0F0;
dword text_color = 0;
 
#include "ini.h"
#include "prepare_page.h"
 
 
void InitDlls()
{
load_dll(boxlib, #box_lib_init, 0);
97,12 → 100,7
HandleButtonEvent();
break;
case evReDraw:
if (menu.cur_y) {
encoding = menu.cur_y - 10;
OpenFile(#param);
PreparePage();
menu.cur_y = NULL;
};
EventMenuClick();
draw_window();
}
}
133,10 → 131,10
EventMagnifyMinus();
break;
case CHANGE_ENCODING:
EventChangeEncoding();
EventShowEncodingList();
break;
case RUN_EDIT:
EventRunEdit();
EventShowEdit();
break;
case SHOW_INFO:
EventShowInfo();
173,7 → 171,7
EventMagnifyMinus();
break;
case SCAN_CODE_KEY_E:
EventRunEdit();
EventShowEdit();
break;
case SCAN_CODE_TAB:
EventChangeEncoding();
218,7 → 216,7
char ss_param[4096];
if (!param) return;
sprintf(#ss_param, "-p %s", #param);
io.run("/sys/File managers/Eolite", #ss_param);
RunProgram("/sys/File managers/Eolite", #ss_param);
}
 
void EventMagnifyPlus()
239,12 → 237,14
PreparePage();
}
 
void EventRunEdit()
void EventShowEdit()
{
io.run(DEFAULT_EDITOR, #param);
menu.selected = 0;
menu.show(Form.left+5 + reopenin_menu_left, Form.top+29+skin_height, 130,
"Tinypad\nTextEdit\nWebView\nFB2Read\nHexView", 20);
}
 
void EventChangeEncoding()
void EventShowEncodingList()
{
menu.selected = encoding + 1;
menu.show(Form.left+5 + charsets_menu_left, Form.top+29+skin_height, 130,
258,6 → 258,47
WriteTextLines(list.x + 10, list.y+40, 10110000b, 0, ABOUT, 20);
}
 
void EventChangeEncoding(dword id)
{
encoding = id;
OpenFile(#openfile_path);
PreparePage();
draw_window();
}
 
void EventOpenFileInAnotherProgram(dword _app)
{
RunProgram(_app, #param);
}
 
void EventMenuClick()
{
switch(menu.cur_y)
{
//Encoding
case 10...15:
EventChangeEncoding(menu.cur_y-10);
break;
//Reopen
case 20:
EventOpenFileInAnotherProgram("/sys/tinypad");
break;
case 21:
EventOpenFileInAnotherProgram("/sys/develop/t_edit");
break;
case 22:
EventOpenFileInAnotherProgram("/sys/network/webview");
break;
case 23:
EventOpenFileInAnotherProgram("/sys/fb2read");
break;
case 24:
EventOpenFileInAnotherProgram("/sys/develop/heed");
break;
}
menu.cur_y = 0;
}
 
/* ------------------------------------------- */
 
 
302,7 → 343,8
DrawToolbarButton(MAGNIFY_PLUS, x.inc(TOOLBAR_BUTTON_WIDTH - 1));
DrawToolbarButton(CHANGE_ENCODING, x.inc(TOOLBAR_BUTTON_WIDTH + PADDING + PADDING));
charsets_menu_left = x.n;
DrawToolbarButton(RUN_EDIT, x.inc(TOOLBAR_BUTTON_WIDTH + PADDING));
DrawToolbarButton(RUN_EDIT, x.inc(TOOLBAR_BUTTON_WIDTH + PADDING + PADDING));
reopenin_menu_left = x.n;
DrawToolbarButton(SHOW_INFO, Form.cwidth - 34);