2015-09-05 19:50:37 +02:00
|
|
|
|
2018-10-20 13:00:31 +02:00
|
|
|
#define WIN_DIALOG_W 380
|
2019-05-16 12:48:21 +02:00
|
|
|
#define WIN_DIALOG_H 100
|
2018-10-20 13:00:31 +02:00
|
|
|
#define PR_LEFT 14
|
2019-05-16 12:48:21 +02:00
|
|
|
#define PR_TOP 32
|
2018-10-20 13:00:31 +02:00
|
|
|
#define PR_W WIN_DIALOG_W-PR_LEFT-PR_LEFT
|
2019-05-16 12:48:21 +02:00
|
|
|
#define PR_H 18
|
2018-10-20 13:00:31 +02:00
|
|
|
|
|
|
|
proc_info Dialog_Form;
|
|
|
|
progress_bar copy_bar = {0,PR_LEFT,PR_TOP,PR_W,PR_H,0,0,1,0xFFFFFF,0x00FF00,0x555555};
|
|
|
|
//sensor copying = {PR_LEFT,PR_TOP,WIN_DIALOG_W-PR_LEFT-PR_LEFT,19};
|
2015-09-05 19:50:37 +02:00
|
|
|
|
|
|
|
int operation_flag;
|
2016-02-21 22:57:22 +01:00
|
|
|
enum {
|
|
|
|
COPY_FLAG,
|
|
|
|
MOVE_FLAG,
|
|
|
|
DELETE_FLAG,
|
|
|
|
OPERATION_END
|
|
|
|
};
|
2015-09-05 19:50:37 +02:00
|
|
|
|
|
|
|
void DisplayOperationForm()
|
|
|
|
{
|
2018-10-20 13:00:31 +02:00
|
|
|
dword title;
|
|
|
|
if (operation_flag==COPY_FLAG) {
|
|
|
|
title = T_COPY_WINDOW_TITLE;
|
|
|
|
copy_bar.progress_color = 0x00FF00;
|
|
|
|
}
|
|
|
|
else if (operation_flag==MOVE_FLAG) {
|
|
|
|
title = T_MOVE_WINDOW_TITLE;
|
|
|
|
copy_bar.progress_color = 0x00FF00;
|
|
|
|
}
|
|
|
|
else if (operation_flag==DELETE_FLAG) {
|
|
|
|
title = T_DELETE_WINDOW_TITLE;
|
|
|
|
copy_bar.progress_color = 0xF17A65;
|
|
|
|
}
|
|
|
|
copy_bar.frame_color = system.color.work_graph;
|
2016-02-21 22:57:22 +01:00
|
|
|
switch(CheckEvent())
|
|
|
|
{
|
2015-09-05 19:50:37 +02:00
|
|
|
case evButton:
|
|
|
|
notify(T_CANCEL_PASTE);
|
|
|
|
DialogExit();
|
|
|
|
break;
|
|
|
|
|
2016-02-21 22:57:22 +01:00
|
|
|
case evReDraw:
|
2018-10-20 13:00:31 +02:00
|
|
|
DefineAndDrawWindow(Form.left+Form.width-200,Form.top+90,WIN_DIALOG_W+9,skin_height+WIN_DIALOG_H,0x34,system.color.work,title,0);
|
2015-09-05 19:50:37 +02:00
|
|
|
GetProcessInfo(#Dialog_Form, SelfInfo);
|
2019-05-16 12:48:21 +02:00
|
|
|
DrawCaptButton(WIN_DIALOG_W-PR_LEFT-101, PR_TOP+PR_H+6, 100,26, 2,
|
2018-10-20 13:00:31 +02:00
|
|
|
system.color.work_button, system.color.work_button_text, T_ABORT_WINDOW_BUTTON);
|
|
|
|
|
|
|
|
DrawRectangle3D(PR_LEFT-1, PR_TOP-1, PR_W+1, PR_H+1, system.color.work_dark, system.color.work_light);
|
|
|
|
//copying.draw_wrapper();
|
2016-02-21 22:57:22 +01:00
|
|
|
}
|
2015-09-05 19:50:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void DialogExit() {
|
|
|
|
action_buf = OPERATION_END;
|
|
|
|
ActivateWindow(GetProcessSlot(Form.ID));
|
|
|
|
ExitProcess();
|
|
|
|
}
|
|
|
|
|
2016-02-21 22:57:22 +01:00
|
|
|
void Operation_Draw_Progress(dword filename) {
|
2015-09-05 19:50:37 +02:00
|
|
|
if (Dialog_Form.cwidth==0)
|
|
|
|
{
|
|
|
|
copy_bar.value++;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
DisplayOperationForm();
|
2019-05-16 12:48:21 +02:00
|
|
|
DrawBar(PR_LEFT, PR_TOP-20, WIN_DIALOG_W-PR_LEFT, 15, system.color.work);
|
|
|
|
WriteText(PR_LEFT, PR_TOP-20, 0x90, system.color.work_text, filename);
|
2018-10-20 13:00:31 +02:00
|
|
|
|
2015-09-05 19:50:37 +02:00
|
|
|
progressbar_draw stdcall (#copy_bar);
|
|
|
|
progressbar_progress stdcall (#copy_bar);
|
|
|
|
//copy_bar.value++;
|
2018-10-20 13:00:31 +02:00
|
|
|
//pause(1);
|
|
|
|
//copying.draw_progress(copy_bar.value*copying.w/copy_bar.max, copy_bar.value, copy_bar.max-copy_bar.value, "");
|
|
|
|
|
2019-05-16 12:48:21 +02:00
|
|
|
WriteTextWithBg(PR_LEFT, PR_TOP+PR_H+5, 0xD0, system.color.work_text,
|
|
|
|
sprintf(#param, "%i/%i", copy_bar.value, copy_bar.max), system.color.work);
|
2015-09-05 19:50:37 +02:00
|
|
|
}
|