Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
7491 leency 1
 
9510 leency 2
#define COPYFORM_H 100
3
#define PR_LEFT 14
7491 leency 4
#define PR_TOP  32
7658 leency 5
#define PR_W  COPYFORM_W-PR_LEFT-PR_LEFT
9510 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
checkbox remember_choice = { T_COPY_REMEMBER_CHOICE, false };
9510 leency 11
5804 punk_joker 12
 
6278 leency 13
	REDRAW_FLAG,
7878 leency 14
	COPY_FLAG,
6278 leency 15
	MOVE_FLAG,
16
	DELETE_FLAG,
17
};
18
5804 punk_joker 19
 
9510 leency 20
	BTN_ABORT=2,
21
	BTN_REPLACE,
22
	BTN_SKIP
23
};
24
25
 
7878 leency 26
{
5804 punk_joker 27
	dword title;
7491 leency 28
	dword event_mode;
9510 leency 29
	if (operation_flag==COPY_FLAG) {
7491 leency 30
		title = T_COPY_WINDOW_TITLE;
31
		copy_bar.progress_color = 0x00FF00;
32
		copy_bar.value = 0;
7878 leency 33
		copy_bar.max = 0;
34
	}
7491 leency 35
	else if (operation_flag==MOVE_FLAG) {
36
		title = T_MOVE_WINDOW_TITLE;
37
		copy_bar.progress_color = 0x00FF00;
38
		copy_bar.value = 0;
7878 leency 39
		copy_bar.max = 0;
40
	}
7491 leency 41
	else if (operation_flag==DELETE_FLAG) {
42
		title = T_DELETE_WINDOW_TITLE;
43
		copy_bar.progress_color = 0xF17A65;
44
		copy_bar.value = 0;
7878 leency 45
		copy_bar.max = 0;
46
	}
7491 leency 47
	copy_bar.frame_color = sc.work_graph;
7806 leency 48
9534 punk_joker 49
 
9510 leency 50
	else event_mode = #CheckEvent;
9534 punk_joker 51
	event_mode();
9510 leency 52
	switch(EAX)
53
	{
6278 leency 54
		 case evButton:
5804 punk_joker 55
			switch(GetButtonID())
9510 leency 56
			{
9471 punk_joker 57
				case 1:
9510 leency 58
				case BTN_ABORT:
59
					DialogExit();
9471 punk_joker 60
					break;
61
				case BTN_REPLACE:
9510 leency 62
					if (is_remember == true) {
9534 punk_joker 63
						saved_state = FILE_REPLACE;
64
					}
65
					copy_state = FILE_REPLACE;
9471 punk_joker 66
					break;
67
				case BTN_SKIP:
9510 leency 68
					if (is_remember == true) {
9534 punk_joker 69
						saved_state = FILE_SKIP;
70
					}
71
					copy_state = FILE_SKIP;
9471 punk_joker 72
					break;
73
				default:
9510 leency 74
					if (remember_choice.click(EAX+1)) {
75
						is_remember = remember_choice.checked;
9534 punk_joker 76
					}
9510 leency 77
					break;
9534 punk_joker 78
			}
9471 punk_joker 79
			break;
5804 punk_joker 80
		case evReDraw:
81
			DefineAndDrawWindow(Form.left+Form.width-200, Form.top+90, COPYFORM_W+9,
9510 leency 82
				skin_height+COPYFORM_H, 0x34, sc.work, title, 0);
83
			GetProcessInfo(#Dialog_Form, SelfInfo);
5804 punk_joker 84
			DrawCaptButton(COPYFORM_W-PR_LEFT-101, PR_TOP+PR_H+6, 100,26, BTN_ABORT, sc.button, sc.button_text, T_COPY_ABORT);
9510 leency 85
7491 leency 86
 
9471 punk_joker 87
			{
88
				#define REPLACEY PR_TOP+PR_H+48
9510 leency 89
				draw_icon_16w(PR_LEFT, REPLACEY-3, 20);
90
				WriteText(PR_LEFT+25, REPLACEY, 0x90, sc.work_text, T_OVERWRITE_ALERT);
91
				DrawCaptButton(PR_LEFT, REPLACEY+30, 100,26, BTN_REPLACE, sc.button, sc.button_text, T_COPY_REPLACE);
92
				DrawCaptButton(PR_LEFT+110, REPLACEY+30, 100,26, BTN_SKIP, sc.button, sc.button_text, T_COPY_SKIP);
93
				remember_choice.draw(PR_LEFT+225, REPLACEY+37);
94
			}
9471 punk_joker 95
96
 
7806 leency 97
	}
6278 leency 98
}
5804 punk_joker 99
100
 
101
	ActivateWindow(GetProcessSlot(Form.ID));
102
	ExitProcess();
103
}
104
105
 
6278 leency 106
	static int old_state;
9510 leency 107
	if (Dialog_Form.cwidth==0)
5804 punk_joker 108
	{
109
		copy_bar.value++;
110
		return;
111
	}
112
9510 leency 113
 
114
		old_state = copy_state;
115
		if (copy_state == FILE_EXISTS) MoveSize(OLD,OLD,OLD,skin_height+COPYFORM_H+70);
116
		if (copy_state == FILE_DEFAULT) MoveSize(OLD,OLD,OLD,skin_height+COPYFORM_H);
117
	}
118
119
 
7878 leency 120
7491 leency 121
 
5804 punk_joker 122
	if (copy_state == FILE_DEFAULT)
9471 punk_joker 123
	{
124
		DrawBar(PR_LEFT, PR_TOP-20, COPYFORM_W-PR_LEFT, 15, sc.work);
9510 leency 125
		progressbar_progress stdcall (#copy_bar);
9471 punk_joker 126
	}
127
	WriteTextWithBg(PR_LEFT, PR_TOP-20, 0xD0, sc.work_text, filename, sc.work);
9510 leency 128
7491 leency 129
 
7806 leency 130
		sprintf(#param, "%i/%i", copy_bar.value, copy_bar.max), sc.work);
131
}
5804 punk_joker 132