Subversion Repositories Kolibri OS

Rev

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

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