forked from KolibriOS/kolibrios
Eolite 1.90
fixed bug with crashing Eolite, while opening menu fixed list redraw while paste single file copy, cut, paste added to file menu text shadow in menu git-svn-id: svn://kolibrios.org@3695 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
703bc20999
commit
bd89ff2844
@ -1,7 +1,7 @@
|
||||
//Leency & Veliant 2008-2013
|
||||
//GNU GPL licence.
|
||||
|
||||
//êîïèðîâàòü ÷åðåç ïîòîê
|
||||
//êîïèðîâàòü ÷åðåç ïîòîê
|
||||
|
||||
//libraries
|
||||
#define MEMSIZE 0xA0000
|
||||
@ -22,8 +22,8 @@
|
||||
|
||||
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
|
||||
|
||||
#define TITLE "Eolite File Manager v1.89"
|
||||
#define ABOUT_TITLE "Eolite v1.89"
|
||||
#define TITLE "Eolite File Manager v1.90"
|
||||
#define ABOUT_TITLE "Eolite v1.90"
|
||||
dword col_work = 0xE4DFE1;
|
||||
dword col_border = 0x9098B0; //A0A0B8; //0x819FC5;
|
||||
dword col_padding = 0xC8C9C9;
|
||||
@ -59,15 +59,15 @@ edit_box edit2= {250,213,80,0xFFFFCC,0x94AECE,0xFFFFCC,0xffffff,0,248,#file_name
|
||||
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0};
|
||||
PathShow_data FileShow = {0, 56,215, 6, 100, 0, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
|
||||
|
||||
#include "include\copypaste.h"
|
||||
#include "include\some_code.h"
|
||||
#include "include\about_dialog.h"
|
||||
#include "include\sorting.h"
|
||||
#include "include\icons_f.h"
|
||||
#include "include\ini.h"
|
||||
#include "include\left_panel.h"
|
||||
#include "include\history.h"
|
||||
#include "include\file_menu.h"
|
||||
#include "include\copypaste.h"
|
||||
#include "include\about_dialog.h"
|
||||
|
||||
void main()
|
||||
{
|
||||
@ -84,7 +84,9 @@ void main()
|
||||
if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //add "/" to the end of the string
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(#path, "/rd/1/");
|
||||
}
|
||||
Open_Dir(#path,ONLY_OPEN);
|
||||
SetEventMask(0x27);
|
||||
loop() switch(WaitEvent())
|
||||
@ -112,11 +114,19 @@ void main()
|
||||
if (!m.lkm) && (!m.pkm) && (can_select)
|
||||
{
|
||||
can_select = 0;
|
||||
if (m.y<57) break;
|
||||
id = m.y - 57 / files.line_h;
|
||||
if (id!=m_selected) {can_show=0; break;}
|
||||
if (files.current!=id) List_Current(id-files.current);
|
||||
else Open();
|
||||
if (m.y>=57)
|
||||
{
|
||||
id = m.y - 57 / files.line_h;
|
||||
if (id!=m_selected)
|
||||
{
|
||||
can_show=0;
|
||||
break;
|
||||
}
|
||||
if (files.current!=id)
|
||||
List_Current(id-files.current);
|
||||
else
|
||||
Open();
|
||||
}
|
||||
};
|
||||
// } select/open file
|
||||
|
||||
@ -124,14 +134,15 @@ void main()
|
||||
if (!m.pkm) && (!m.lkm) && (can_show)
|
||||
{
|
||||
can_show = 0;
|
||||
if (m.y<57) break;
|
||||
SwitchToAnotherThread();
|
||||
CreateThread(#FileMenu,#menu_stak);
|
||||
if (m.y>=57)
|
||||
{
|
||||
SwitchToAnotherThread();
|
||||
CreateThread(#FileMenu,#menu_stak);
|
||||
}
|
||||
break;
|
||||
}
|
||||
// } file menu
|
||||
|
||||
|
||||
if (m.vert)
|
||||
{
|
||||
files.MouseScroll(m.vert);
|
||||
@ -444,8 +455,8 @@ void List_Current(int cur)
|
||||
void List_ReDraw()
|
||||
{
|
||||
int paint_y;
|
||||
//åñëè ìû â êîíöå ñïèñêà ôàéëîâ ðàçâåðí¸ì îêíî ïîÿâÿòüñÿ ïóñòÿå áåëûå êíîïêè
|
||||
//ýòî åñëè âûäåëåíèå ïîñëå ñõëîïûâàíèÿ îêíà çà êàäðîì
|
||||
//åñëè ìû â êîíöå ñïèñêà ôàéëîâ ðàçâåðí¸ì îêíî ïîÿâÿòüñÿ ïóñòÿå áåëûå êíîïêè
|
||||
//ýòî åñëè âûäåëåíèå ïîñëå ñõëîïûâàíèÿ îêíà çà êàäðîì
|
||||
if (files.count-files.first<files.visible) || (files.current>files.visible-1)
|
||||
{ files.first=files.count-files.visible; files.current=files.visible-1; }
|
||||
|
||||
|
@ -55,5 +55,6 @@ void Paste()
|
||||
ActivateWindow(GetProcessSlot(Form.ID));
|
||||
SendWindowMessage(evKey, 54);
|
||||
SelectFile(#copy_to+strrchr(#copy_to,'/'));
|
||||
pause(20);
|
||||
ExitProcess();
|
||||
}
|
||||
|
@ -5,21 +5,26 @@ char *captions[] = {
|
||||
"Open with...", "CrlEnt",
|
||||
"View as text", "F3",
|
||||
"View as HEX", "F4",
|
||||
//
|
||||
"Copy", "Crl+C",
|
||||
"Cut", "Crl+X",
|
||||
"Paste", "Crl+V",
|
||||
"Rename", "F2",
|
||||
"Delete", "Del",
|
||||
//"Refresh", "F5",
|
||||
0};
|
||||
0, 0};
|
||||
|
||||
proc_info MenuForm;
|
||||
|
||||
void FileMenu()
|
||||
{
|
||||
proc_info MenuForm;
|
||||
mouse mm;
|
||||
word id, key, slot;
|
||||
word id, key, slot, index;
|
||||
int ccount=0, cur, newi, linew=10, lineh=18, texty;
|
||||
for (i=0; captions[i]!=0; i+=2)
|
||||
for (index=0; captions[index]!=0; index+=2)
|
||||
{
|
||||
ccount++;
|
||||
if (strlen(captions[i])>linew) linew = strlen(captions[i]);
|
||||
if (strlen(captions[index])>linew) linew = strlen(captions[index]);
|
||||
}
|
||||
linew = linew + 3 * 6 + 50;
|
||||
texty = lineh/2-4;
|
||||
@ -45,12 +50,14 @@ void FileMenu()
|
||||
id=GetButtonID();
|
||||
if (id==100) Open();
|
||||
if (id==101) notify("Not compleated yet");
|
||||
if (id==102) FnProcess(3);
|
||||
if (id==103) FnProcess(4);
|
||||
if (id==104) FnProcess(2);
|
||||
if (id==105) Del_Form();
|
||||
if (id==106) FnProcess(5);
|
||||
SwitchToAnotherThread();
|
||||
if (id==102) FnProcess(3); //F3
|
||||
if (id==103) FnProcess(4); //F4
|
||||
if (id==104) Copy(#file_path, NOCUT);
|
||||
if (id==105) Copy(#file_path, CUT);
|
||||
if (id==106) CreateThread(#Paste,#copy_stak);
|
||||
if (id==107) FnProcess(2);
|
||||
if (id==108) Del_Form();
|
||||
if (id==109) FnProcess(5);
|
||||
ExitProcess();
|
||||
break;
|
||||
|
||||
@ -61,7 +68,6 @@ void FileMenu()
|
||||
case evReDraw: _MENU_DRAW:
|
||||
DefineAndDrawWindow(m.x+Form.left+5,m.y+Form.top+GetSkinHeight(),linew+3,ccount*lineh+6,0x01, 0, 0, 0x01fffFFF);
|
||||
GetProcessInfo(#MenuForm, SelfInfo);
|
||||
/* _PutImage(1,23, 16,44, #factions); //èêîíêè */
|
||||
DrawRectangle(0,0,linew+1,ccount*lineh+2,col_border);
|
||||
DrawBar(1,1,linew,1,0xFFFfff);
|
||||
PutShadow(linew+2,1,1,ccount*lineh+2,0,2);
|
||||
@ -70,13 +76,21 @@ void FileMenu()
|
||||
PutShadow(2,ccount*lineh+4,linew+1,1,0,1);
|
||||
|
||||
_ITEMS_DRAW:
|
||||
for (i=0; captions[i*2]!=0; i++)
|
||||
for (index=0; captions[index*2]!=0; index++)
|
||||
{
|
||||
DefineButton(1,i*lineh+1,linew,lineh-1,i+100+BT_HIDE+BT_NOFRAME,0xFFFFFF);
|
||||
DrawBar(1,i*lineh+2,1,lineh,0xFFFfff);
|
||||
if (i==cur) DrawBar(2,i*lineh+2,linew-1,lineh,0xFFFfff); else DrawBar(2,i*lineh+2,linew-1,lineh,col_work);
|
||||
WriteText(7,i*lineh+texty+2,0x80,0x000000,captions[i*2]);
|
||||
WriteText(-strlen(captions[i*2+1])*6-6+linew,i*lineh+texty+2,0x80,0x999999,captions[i*2+1]);
|
||||
DefineButton(1,index*lineh+1,linew,lineh-1,index+100+BT_HIDE+BT_NOFRAME,0xFFFFFF);
|
||||
DrawBar(1,index*lineh+2,1,lineh,0xFFFfff);
|
||||
if (index==cur)
|
||||
{
|
||||
DrawBar(2,index*lineh+2,linew-1,lineh,0xFFFfff);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawBar(2,index*lineh+2,linew-1,lineh,col_work);
|
||||
WriteText(8,index*lineh+texty+3,0x80,0xf2f2f2,captions[index*2]);
|
||||
}
|
||||
WriteText(7,index*lineh+texty+2,0x80,0x000000,captions[index*2]);
|
||||
WriteText(-strlen(captions[index*2+1])*6-6+linew,index*lineh+texty+2,0x80,0x888888,captions[index*2+1]);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user