Subversion Repositories Kolibri OS

Rev

Rev 8947 | Rev 9510 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7491 leency 1
 
2
#define WIN_DIALOG_H 100
7658 leency 3
#define PR_LEFT 14
7491 leency 4
#define PR_TOP  32
7658 leency 5
#define PR_W  WIN_DIALOG_W-PR_LEFT-PR_LEFT
7491 leency 6
#define PR_H  18
7658 leency 7
7491 leency 8
 
5804 punk_joker 9
progress_bar copy_bar = {0,PR_LEFT,PR_TOP,PR_W,PR_H,0,0,1,0xFFFFFF,0x00FF00,0x555555};
7491 leency 10
5804 punk_joker 11
 
6278 leency 12
	REDRAW_FLAG,
7878 leency 13
	COPY_FLAG,
6278 leency 14
	MOVE_FLAG,
15
	DELETE_FLAG,
16
};
17
5804 punk_joker 18
 
7878 leency 19
{
5804 punk_joker 20
	dword title;
7491 leency 21
	dword id;
9471 punk_joker 22
	if (operation_flag==COPY_FLAG) {
7491 leency 23
		title = T_COPY_WINDOW_TITLE;
24
		copy_bar.progress_color = 0x00FF00;
25
		copy_bar.value = 0;
7878 leency 26
		copy_bar.max = 0;
27
	}
7491 leency 28
	else if (operation_flag==MOVE_FLAG) {
29
		title = T_MOVE_WINDOW_TITLE;
30
		copy_bar.progress_color = 0x00FF00;
31
		copy_bar.value = 0;
7878 leency 32
		copy_bar.max = 0;
33
	}
7491 leency 34
	else if (operation_flag==DELETE_FLAG) {
35
		title = T_DELETE_WINDOW_TITLE;
36
		copy_bar.progress_color = 0xF17A65;
37
		copy_bar.value = 0;
7878 leency 38
		copy_bar.max = 0;
39
	}
7491 leency 40
	copy_bar.frame_color = sc.work_graph;
7806 leency 41
	switch(CheckEvent())
6278 leency 42
	{
43
		 case evButton:
5804 punk_joker 44
		 	id = GetButtonID();
9471 punk_joker 45
			switch(id)
46
			{
47
				case 2:
48
					DialogExit();
49
					break;
50
				case 3:
51
					copy_state = FILE_REPLACE;
52
					break;
53
				case 4:
54
					copy_state = FILE_SKIP;
55
					break;
56
			}
57
			break;
5804 punk_joker 58
		case evReDraw:
59
			DefineAndDrawWindow(Form.left+Form.width-200, Form.top+90, WIN_DIALOG_W+9,
7878 leency 60
				skin_height+WIN_DIALOG_H+70, 0x34, sc.work, title, 0);
9471 punk_joker 61
			GetProcessInfo(#Dialog_Form, SelfInfo);
5804 punk_joker 62
			DrawCaptButton(WIN_DIALOG_W-PR_LEFT-101, PR_TOP+PR_H+6, 100,26, 2,
7658 leency 63
				sc.button, sc.button_text, T_ABORT_WINDOW_BUTTON);
7806 leency 64
7491 leency 65
 
9471 punk_joker 66
			{
67
				WriteText(WIN_DIALOG_W-PR_LEFT-301, PR_TOP+PR_H+46, 0x90, sc.work_text, "File exists!!");
68
				DrawCaptButton(WIN_DIALOG_W-PR_LEFT-301, PR_TOP+PR_H+76, 100,26, 3,
69
					sc.button, sc.button_text, T_REPLACE_WINDOW_BUTTON);
70
				DrawCaptButton(WIN_DIALOG_W-PR_LEFT-101, PR_TOP+PR_H+76, 100,26, 4,
71
					sc.button, sc.button_text, T_SKIP_WINDOW_BUTTON);
72
			}
73
74
 
7806 leency 75
	}
6278 leency 76
}
5804 punk_joker 77
78
 
79
	ActivateWindow(GetProcessSlot(Form.ID));
80
	ExitProcess();
81
}
82
83
 
6278 leency 84
	if (Dialog_Form.cwidth==0)
5804 punk_joker 85
	{
86
		copy_bar.value++;
87
		return;
88
	}
89
	DisplayOperationForm(REDRAW_FLAG);
7878 leency 90
	DrawBar(PR_LEFT, PR_TOP-20, WIN_DIALOG_W-PR_LEFT, 15, sc.work);
7806 leency 91
	WriteText(PR_LEFT, PR_TOP-20, 0x90, sc.work_text, filename);
92
7491 leency 93
 
5804 punk_joker 94
	if (copy_state == FILE_DEFAULT)
9471 punk_joker 95
	{
96
		progressbar_progress stdcall (#copy_bar);
97
	}
98
7491 leency 99
 
7806 leency 100
		sprintf(#param, "%i/%i", copy_bar.value, copy_bar.max), sc.work);
101
}
5804 punk_joker 102