forked from KolibriOS/kolibrios
Eolite 1.41: visual fix and undo deleting close window button
git-svn-id: svn://kolibrios.org@3052 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
dafa1f1f2e
commit
b23bcb33f0
@ -20,19 +20,19 @@ int BUTTON_HEIGHT=18;
|
||||
#define ONLY_OPEN 2
|
||||
|
||||
//ïåðåìåííûå
|
||||
#define title "Eolite File Manager v1.4"
|
||||
#define title "Eolite File Manager v1.41"
|
||||
dword selection_col = 0x94AECE;
|
||||
dword lpanel_col = 0x00699C;
|
||||
|
||||
|
||||
/*
|
||||
int f_visible,
|
||||
int
|
||||
f_count,
|
||||
f_first,
|
||||
f_current;
|
||||
*/
|
||||
|
||||
int but_num,
|
||||
int f_visible,
|
||||
count,
|
||||
za_kadrom,
|
||||
curbtn;
|
||||
@ -45,7 +45,8 @@ byte show_actions=1,
|
||||
show_dev_name=1,
|
||||
sort_num=2,
|
||||
isdir;
|
||||
char path[4096],
|
||||
unsigned char
|
||||
path[4096],
|
||||
edit_path[4096],
|
||||
file_path[4096],
|
||||
file_name[4096],
|
||||
@ -79,7 +80,7 @@ dword buf, off; //
|
||||
#include "include\sorting.h"
|
||||
#include "include\icons_f.h"
|
||||
#include "include\ini.h"
|
||||
#include "include\devices.h"
|
||||
#include "include\left_panel.h"
|
||||
#include "include\history.h"
|
||||
|
||||
void main()
|
||||
@ -132,7 +133,7 @@ void main()
|
||||
if (m.x>=Form.width-26) && (m.x<=Form.width-6) && (m.y>onTop(22,0)+1) && (m.y<onTop(22,0)+16)
|
||||
{
|
||||
IF (m.lkm==1) DrawRegion_3D(onLeft(26,0),onTop(21,0),14,14,0xC7C7C7,0xFFFFFF);
|
||||
while (m.lkm==1) && (za_kadrom<count-but_num)
|
||||
while (m.lkm==1) && (za_kadrom<count-f_visible)
|
||||
{
|
||||
Pause(10);
|
||||
za_kadrom++;
|
||||
@ -146,18 +147,18 @@ void main()
|
||||
IF (m.vert==65535) && (za_kadrom>0)
|
||||
{
|
||||
if (za_kadrom>0) za_kadrom--;
|
||||
if (curbtn<but_num-1) curbtn++;
|
||||
if (curbtn<f_visible-1) curbtn++;
|
||||
List_ReDraw();
|
||||
if (za_kadrom>0) za_kadrom--;
|
||||
if (curbtn<but_num-1) curbtn++;
|
||||
if (curbtn<f_visible-1) curbtn++;
|
||||
List_ReDraw();
|
||||
}
|
||||
IF (m.vert==1) && (za_kadrom<count-but_num)
|
||||
IF (m.vert==1) && (za_kadrom<count-f_visible)
|
||||
{
|
||||
if (za_kadrom<count-but_num) za_kadrom++;
|
||||
if (za_kadrom<count-f_visible) za_kadrom++;
|
||||
if (curbtn>0) curbtn--;
|
||||
List_ReDraw();
|
||||
if (za_kadrom<count-but_num) za_kadrom++;
|
||||
if (za_kadrom<count-f_visible) za_kadrom++;
|
||||
if (curbtn>0) curbtn--;
|
||||
List_ReDraw();
|
||||
}
|
||||
@ -172,7 +173,7 @@ void main()
|
||||
j= scroll_size/2;
|
||||
za_kadrom = m.y -j -57 * count;
|
||||
za_kadrom /= onTop(22,57);
|
||||
IF (but_num+za_kadrom>count) za_kadrom=count-but_num;
|
||||
IF (f_visible+za_kadrom>count) za_kadrom=count-f_visible;
|
||||
IF (id<>za_kadrom) List_ReDraw(); //÷òîá ëèøíèé ðàç íå ïåðåðèñîâûâàòü
|
||||
}
|
||||
break;
|
||||
@ -360,15 +361,15 @@ void main()
|
||||
List_ReDraw();
|
||||
break;
|
||||
case 181: //end
|
||||
za_kadrom=count-but_num;
|
||||
curbtn=but_num-1;
|
||||
za_kadrom=count-f_visible;
|
||||
curbtn=f_visible-1;
|
||||
List_ReDraw();
|
||||
break;
|
||||
case 183: //Page Down
|
||||
FileList_ReDraw(but_num-1);
|
||||
FileList_ReDraw(f_visible-1);
|
||||
break;
|
||||
case 184: //Page Up
|
||||
FileList_ReDraw(-but_num+1);
|
||||
FileList_ReDraw(-f_visible+1);
|
||||
break;
|
||||
case 051: //Íàæàòà F2
|
||||
REN_MARK:
|
||||
@ -486,8 +487,8 @@ void FileList_ReDraw(int curbtn_)
|
||||
}
|
||||
else //âíèç
|
||||
{
|
||||
IF (za_kadrom==count-but_num) && (curbtn==but_num-1) return;
|
||||
IF (but_num-curbtn>curbtn_)
|
||||
IF (za_kadrom==count-f_visible) && (curbtn==f_visible-1) return;
|
||||
IF (f_visible-curbtn>curbtn_)
|
||||
{
|
||||
Line_ReDraw(0xFFFFFF, curbtn); //áåëàÿ ïîëîñà
|
||||
curbtn+=curbtn_;
|
||||
@ -498,18 +499,18 @@ void FileList_ReDraw(int curbtn_)
|
||||
{
|
||||
IF(za_kadrom+curbtn+curbtn_>=count)
|
||||
{
|
||||
za_kadrom=count-but_num;
|
||||
za_kadrom=count-f_visible;
|
||||
curbtn=curbtn_-za_kadrom+curbtn;
|
||||
}
|
||||
ELSE
|
||||
{
|
||||
za_kadrom+=curbtn_+curbtn-but_num+1;
|
||||
curbtn=but_num-1;
|
||||
za_kadrom+=curbtn_+curbtn-f_visible+1;
|
||||
curbtn=f_visible-1;
|
||||
}
|
||||
|
||||
IF (curbtn<0) || (curbtn>but_num)
|
||||
IF (curbtn<0) || (curbtn>f_visible)
|
||||
{
|
||||
curbtn=but_num-1;
|
||||
curbtn=f_visible-1;
|
||||
}
|
||||
List_ReDraw();
|
||||
}
|
||||
@ -521,11 +522,11 @@ void FileList_ReDraw(int curbtn_)
|
||||
|
||||
void List_ReDraw()
|
||||
{
|
||||
int paint_x=but_num*BUTTON_HEIGHT+57;
|
||||
IF (count-za_kadrom<but_num) || (curbtn>but_num-1) //åñëè ìû â êîíöå ñïèñêà ôàéëîâ ğàçâåğí¸ì îêíî ïîÿâÿòüñÿ ïóñòÿå áåëûå êíîïêè
|
||||
{ za_kadrom=count-but_num; curbtn=but_num-1; } //ıòî åñëè âûäåëåíèå ïîñëå ñõëîïûâàíèÿ îêíà çà êàäğîì
|
||||
int paint_x=f_visible*BUTTON_HEIGHT+57;
|
||||
IF (count-za_kadrom<f_visible) || (curbtn>f_visible-1) //åñëè ìû â êîíöå ñïèñêà ôàéëîâ ðàçâåðí¸ì îêíî ïîÿâÿòüñÿ ïóñòÿå áåëûå êíîïêè
|
||||
{ za_kadrom=count-f_visible; curbtn=f_visible-1; } //ýòî åñëè âûäåëåíèå ïîñëå ñõëîïûâàíèÿ îêíà çà êàäðîì
|
||||
|
||||
FOR (j=0; j<but_num; j++) IF (curbtn<>j) Line_ReDraw(0xFFFFFF, j); ELSE Line_ReDraw(selection_col, curbtn);
|
||||
FOR (j=0; j<f_visible; j++) IF (curbtn<>j) Line_ReDraw(0xFFFFFF, j); ELSE Line_ReDraw(selection_col, curbtn);
|
||||
DrawBar(192,paint_x,onLeft(27,192),onTop(paint_x,6),0xFFFFFF); //çàëèâêà áåëûì äîêîíöà
|
||||
DrawBar(onLeft(168,0),paint_x,1,onTop(paint_x,6),0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 1
|
||||
DrawBar(onLeft(95,0),paint_x,1,onTop(paint_x,6),0xE4DFE1); //ïîëîñà ñåðàÿ âåðòèêàëüíàÿ 2
|
||||
@ -612,9 +613,9 @@ void Open_Dir(dword temp_, redraw){
|
||||
KEdit();
|
||||
HistoryPath(ADD_NEW_PATH);
|
||||
IF (!strcmp(".",buf+72)) {count--; memmov(buf,buf+304,count*304);} //ôèëüòðóåì ýëåìåíò "."
|
||||
FOR (j=0;j<but_num;j++) DeleteButton(201+j); //óäàëÿåì ñòàğûå
|
||||
but_num=onTop(6,57)/BUTTON_HEIGHT;
|
||||
IF (count<but_num) but_num=count;
|
||||
FOR (j=0;j<f_visible;j++) DeleteButton(201+j); //óäàëÿåì ñòàðûå
|
||||
f_visible=onTop(6,57)/BUTTON_HEIGHT;
|
||||
IF (count<f_visible) f_visible=count;
|
||||
//ñòðåëî÷êà ñîðòèðîâêè
|
||||
IF (sort_num==1) WriteText(Form.width+60/2,45,0x80,0x4E78AC,"\x19",0);
|
||||
IF (sort_num==2) WriteText(Form.width-115,45,0x80,0x4E78AC,"\x19",0);
|
||||
@ -622,7 +623,7 @@ void Open_Dir(dword temp_, redraw){
|
||||
IF (redraw<>ONLY_SHOW) Sorting(); //äëÿ áîëüøèõ ïàïîê ïðè ðåïåèíòå îêíà
|
||||
IF (redraw<>ONLY_OPEN) List_ReDraw();
|
||||
}
|
||||
IF (count==-1) && (redraw<>ONLY_OPEN) {but_num=count=0; List_ReDraw();}
|
||||
IF (count==-1) && (redraw<>ONLY_OPEN) {f_visible=count=0; List_ReDraw();}
|
||||
}
|
||||
|
||||
|
||||
|
@ -38,7 +38,7 @@ void about_dialog()
|
||||
DefineAndDrawWindow(600,150,181,256,0x34,0x10EFEBEF,"About Eolite");
|
||||
DrawBar(0,0,172,50,0x8494C4); //ãîëóáîå ñçàäè
|
||||
PutPaletteImage(#logo,85,85,43,7,#logo_pal);
|
||||
WriteText(49,100,0x90,0xBF40BF,"Eolite v1.4",0);
|
||||
WriteText(46,100,0x90,0xBF40BF,"Eolite v1.41",0);
|
||||
$add ebx, 1<<16
|
||||
$int 0x40
|
||||
WriteText(55,120,0x80,0,"Developers:",0);
|
||||
|
@ -51,7 +51,7 @@ void DrawSystemDiscs()
|
||||
char disc_name[100];
|
||||
int i, dev_icon;
|
||||
|
||||
for (i=0; i<20; i++) DeleteButton(i);
|
||||
for (i=0; i<20; i++) DeleteButton(100+i);
|
||||
//ñïèñîê äèñêîâ
|
||||
Tip(56, "Devices", 78, "=");
|
||||
for (i=0;i<disc_num;i++)
|
||||
@ -144,7 +144,6 @@ void LeftPanelBackground()
|
||||
{
|
||||
DrawBar(2,start_y,190,onTop(start_y,6+268),lpanel_col);
|
||||
PutPaletteImage(#blue_hl, 190, 268, 2, onTop(268,6), #blue_hl_pal);
|
||||
if (onTop(268,6)>300) PutPaletteImage(#blue_hl, 190, 87, 2, start_y+100, #blue_hl_pal);
|
||||
}
|
||||
}
|
||||
|
@ -29,9 +29,9 @@ inline fastcall void TVScroll() { //
|
||||
dword on_y;
|
||||
if (count<=0) {DrawFlatButton(onLeft(27,0),57,16,onTop(22,58),0,0xE4DFE1,""); return;}
|
||||
on_y = za_kadrom * onTop(22,57) / count +57;
|
||||
scroll_size=onTop(22,57) * but_num - but_num / count;
|
||||
scroll_size=onTop(22,57) * f_visible - f_visible / count;
|
||||
if (scroll_size<20) scroll_size = 20; //óñòàíàâëèâàåì ìèíèìàëüíûé ðàçìåð ñêðîëëà
|
||||
if (scroll_size>onTop(22,57)-on_y+56) || (za_kadrom+but_num>=count) on_y=onTop(23+scroll_size,0); //äëÿ áîëüøîãî ñïèñêà
|
||||
if (scroll_size>onTop(22,57)-on_y+56) || (za_kadrom+f_visible>=count) on_y=onTop(23+scroll_size,0); //äëÿ áîëüøîãî ñïèñêà
|
||||
DrawFlatButton(onLeft(27,0),on_y,16,scroll_size,0,0xE4DFE1,"");//ïîëçóíîê
|
||||
DrawBar(onLeft(26,0),57,15,on_y-57,0xCED0D0);//ïîëå äî ïîëçóíêà
|
||||
DrawBar(onLeft(26,0),on_y+scroll_size+1,15,onTop(22,57)-scroll_size-on_y+56,0xCED0D0); //ïîëå ïîñëå ïîëçóíêà
|
||||
|
Loading…
Reference in New Issue
Block a user