Subversion Repositories Kolibri OS

Rev

Rev 7806 | Rev 8947 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7806 Rev 7878
1
#define WIN_DIALOG_W 380
1
#define WIN_DIALOG_W 380
2
#define WIN_DIALOG_H 100
2
#define WIN_DIALOG_H 100
3
#define PR_LEFT 14
3
#define PR_LEFT 14
4
#define PR_TOP  32
4
#define PR_TOP  32
5
#define PR_W  WIN_DIALOG_W-PR_LEFT-PR_LEFT
5
#define PR_W  WIN_DIALOG_W-PR_LEFT-PR_LEFT
6
#define PR_H  18
6
#define PR_H  18
7
 
7
 
8
proc_info Dialog_Form;
8
proc_info Dialog_Form;
9
progress_bar copy_bar = {0,PR_LEFT,PR_TOP,PR_W,PR_H,0,0,1,0xFFFFFF,0x00FF00,0x555555};
9
progress_bar copy_bar = {0,PR_LEFT,PR_TOP,PR_W,PR_H,0,0,1,0xFFFFFF,0x00FF00,0x555555};
10
//sensor copying = {PR_LEFT,PR_TOP,WIN_DIALOG_W-PR_LEFT-PR_LEFT,19};
10
 
11
 
-
 
12
int operation_flag;
-
 
13
enum {
11
enum {
-
 
12
	REDRAW_FLAG,
14
	COPY_FLAG, 
13
	COPY_FLAG, 
15
	MOVE_FLAG, 
14
	MOVE_FLAG, 
16
	DELETE_FLAG, 
15
	DELETE_FLAG, 
17
	OPERATION_END
16
	OPERATION_END
18
};
17
};
19
 
18
 
20
void DisplayOperationForm()
19
void DisplayOperationForm(int operation_flag)
21
{
20
{
22
	dword title;
21
	dword title;
23
	if (operation_flag==COPY_FLAG) {
22
	if (operation_flag==COPY_FLAG) {
24
		title = T_COPY_WINDOW_TITLE;
23
		title = T_COPY_WINDOW_TITLE;
25
		copy_bar.progress_color = 0x00FF00;
24
		copy_bar.progress_color = 0x00FF00;
26
	}
25
		copy_bar.value = 0; 
-
 
26
		copy_bar.max = 0;
-
 
27
	}
27
	else if (operation_flag==MOVE_FLAG) {
28
	else if (operation_flag==MOVE_FLAG) {
28
		title = T_MOVE_WINDOW_TITLE;
29
		title = T_MOVE_WINDOW_TITLE;
29
		copy_bar.progress_color = 0x00FF00;
30
		copy_bar.progress_color = 0x00FF00;
30
	}
31
		copy_bar.value = 0; 
-
 
32
		copy_bar.max = 0;
-
 
33
	}
31
	else if (operation_flag==DELETE_FLAG) {
34
	else if (operation_flag==DELETE_FLAG) {
32
		title = T_DELETE_WINDOW_TITLE;
35
		title = T_DELETE_WINDOW_TITLE;
33
		copy_bar.progress_color = 0xF17A65;
36
		copy_bar.progress_color = 0xF17A65;
34
	}
37
		copy_bar.value = 0; 
-
 
38
		copy_bar.max = 0;
-
 
39
	}
35
	copy_bar.frame_color = sc.work_graph;
40
	copy_bar.frame_color = sc.work_graph;
36
	switch(CheckEvent())
41
	switch(CheckEvent())
37
	{
42
	{
38
		 case evButton:
43
		 case evButton:
39
			notify(T_CANCEL_PASTE);
44
			notify(T_CANCEL_PASTE);
40
			DialogExit();
45
			DialogExit();
41
			break;
46
			break;
42
			
47
			
43
		case evReDraw:
48
		case evReDraw:
44
			DefineAndDrawWindow(Form.left+Form.width-200,Form.top+90,WIN_DIALOG_W+9,skin_height+WIN_DIALOG_H,0x34,sc.work,title,0);
49
			DefineAndDrawWindow(Form.left+Form.width-200, Form.top+90, WIN_DIALOG_W+9,
45
			GetProcessInfo(#Dialog_Form, SelfInfo);
50
				skin_height+WIN_DIALOG_H, 0x34, sc.work, title, 0);
-
 
51
			GetProcessInfo(#Dialog_Form, SelfInfo);
46
			DrawCaptButton(WIN_DIALOG_W-PR_LEFT-101, PR_TOP+PR_H+6, 100,26, 2, 
52
			DrawCaptButton(WIN_DIALOG_W-PR_LEFT-101, PR_TOP+PR_H+6, 100,26, 2, 
47
				sc.button, sc.button_text, T_ABORT_WINDOW_BUTTON);
53
				sc.button, sc.button_text, T_ABORT_WINDOW_BUTTON);
48
 
54
 
49
			DrawRectangle3D(PR_LEFT-1, PR_TOP-1, PR_W+1, PR_H+1, sc.work_dark, sc.work_light);
55
			DrawRectangle3D(PR_LEFT-1, PR_TOP-1, PR_W+1, PR_H+1, sc.work_dark, sc.work_light);
50
			//copying.draw_wrapper();
56
	}
51
	}
-
 
52
}
57
}
53
 
58
 
54
void DialogExit() {
59
void DialogExit() {
55
	action_buf = OPERATION_END;
60
	action_buf = OPERATION_END;
56
	ActivateWindow(GetProcessSlot(Form.ID));
61
	ActivateWindow(GetProcessSlot(Form.ID));
57
	ExitProcess();
62
	ExitProcess();
58
}
63
}
59
 
64
 
60
void Operation_Draw_Progress(dword filename) {
65
void Operation_Draw_Progress(dword filename) {
61
	if (Dialog_Form.cwidth==0)
66
	if (Dialog_Form.cwidth==0)
62
	{
67
	{
63
		copy_bar.value++;
68
		copy_bar.value++;
64
		return;
69
		return;
65
	}
70
	}
66
	DisplayOperationForm();
71
	DisplayOperationForm(REDRAW_FLAG);
67
	DrawBar(PR_LEFT, PR_TOP-20, WIN_DIALOG_W-PR_LEFT, 15, sc.work);
72
	DrawBar(PR_LEFT, PR_TOP-20, WIN_DIALOG_W-PR_LEFT, 15, sc.work);
68
	WriteText(PR_LEFT, PR_TOP-20, 0x90, sc.work_text, filename);
73
	WriteText(PR_LEFT, PR_TOP-20, 0x90, sc.work_text, filename);
69
 
74
 
70
	progressbar_draw stdcall (#copy_bar);
75
	progressbar_draw stdcall (#copy_bar);
71
	progressbar_progress stdcall (#copy_bar);
76
	progressbar_progress stdcall (#copy_bar);
72
	//copy_bar.value++;
77
 
73
	//pause(1);
-
 
74
	//copying.draw_progress(copy_bar.value*copying.w/copy_bar.max, copy_bar.value, copy_bar.max-copy_bar.value, "");
-
 
75
 
-
 
76
	WriteTextWithBg(PR_LEFT, PR_TOP+PR_H+5, 0xD0, sc.work_text, 
78
	WriteTextWithBg(PR_LEFT, PR_TOP+PR_H+5, 0xD0, sc.work_text, 
77
		sprintf(#param, "%i/%i", copy_bar.value, copy_bar.max), sc.work);
79
		sprintf(#param, "%i/%i", copy_bar.value, copy_bar.max), sc.work);
78
}
80
}