Subversion Repositories Kolibri OS

Rev

Rev 5459 | Rev 5464 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5459 Rev 5463
Line 22... Line 22...
22
	?define APPLY_T "Apply"
22
	?define APPLY_T "Apply"
23
#endif
23
#endif
Line 24... Line 24...
24
 
24
 
25
int	mouse_ddd;
25
int	mouse_ddd;
26
char lineh_s[30]="18\0";
26
char lineh_s[30]="18\0";
27
edit_box LineHeight_ed = {52,10,90,0xffffff,0x94AECE,0xffc90E,0xffffff,2,4,#lineh_s,#mouse_ddd, 1000000000000000b,2,2};
-
 
28
checkbox2 ShowDeviceName_chb = {10*65536+15, 10*65536+15, 5, 0xffffff, 0x9098B0, 0x80000000, SET_1, CH_FLAG_MIDDLE, 0};
-
 
29
checkbox2 RealFileNamesCase_chb = {10*65536+15, 30*65536+15, 5, 0xffffff, 0x9098B0, 0x80000000, SET_2, CH_FLAG_MIDDLE, 0};
-
 
Line 30... Line 27...
30
checkbox2 InfoAfterCopy_chb = {10*65536+15, 50*65536+15, 5, 0xffffff, 0x9098B0, 0x80000000, SET_4, CH_FLAG_MIDDLE, 0};
27
edit_box LineHeight_ed = {52,10,97,0xffffff,0x94AECE,0xffc90E,0xffffff,2,4,#lineh_s,#mouse_ddd, 1000000000000000b,2,2};
31
 
28
 
32
void settings_dialog()
29
void settings_dialog()
33
{   
30
{   
34
	byte id;
31
	byte id;
Line 35... Line 32...
35
	unsigned int key;
32
	unsigned int key;
36
	proc_info settings_form;
33
	proc_info settings_form;
Line 37... Line -...
37
	
-
 
38
	if (active_settings) ExitProcess();
-
 
39
	active_settings=1;
-
 
40
 
-
 
41
	ShowDeviceName_chb.size_of_str = strlen(SET_1) * 6;
34
	
42
	RealFileNamesCase_chb.size_of_str = strlen(SET_2) * 6;
35
	if (active_settings) ExitProcess();
43
	InfoAfterCopy_chb.size_of_str = strlen(SET_4) * 6;
36
	active_settings=1;
44
 
37
 
45
	SetEventMask(0x27);
38
	SetEventMask(0x27);
Line 60... Line 53...
60
					ExitProcess();
53
					ExitProcess();
61
				}
54
				}
62
				if (id==5)
55
				if (id==5)
63
				{
56
				{
64
					RunProgram("tinypad", "/sys/settings/assoc.ini");
57
					RunProgram("tinypad", "/sys/settings/assoc.ini");
-
 
58
					break;
65
				}
59
				}
-
 
60
				if (id==20) show_dev_name ^= 1;
-
 
61
				if (id==21) real_files_names_case ^= 1;
-
 
62
				if (id==22) info_after_copy ^= 1;
-
 
63
				DrawSettingsCheckBoxes();
66
				break;
64
				break;
Line 67... Line 65...
67
				
65
				
68
		case evKey:
66
		case evKey:
69
				key = GetKey();
67
				key = GetKey();
Line 76... Line 74...
76
				EAX=key<<8;
74
				EAX=key<<8;
77
				edit_box_key stdcall(#LineHeight_ed);
75
				edit_box_key stdcall(#LineHeight_ed);
78
				break;
76
				break;
Line 79... Line 77...
79
				
77
				
80
		case evMouse:
-
 
81
				check_box_mouse stdcall (#ShowDeviceName_chb);
-
 
82
				check_box_mouse stdcall (#RealFileNamesCase_chb);
-
 
83
				check_box_mouse stdcall (#InfoAfterCopy_chb);
78
		case evMouse:
84
				edit_box_mouse stdcall (#LineHeight_ed);
79
				edit_box_mouse stdcall (#LineHeight_ed);
Line 85... Line 80...
85
				break;
80
				break;
86
			
81
			
87
		case evReDraw:
82
		case evReDraw:
Line 88... Line 83...
88
				DefineAndDrawWindow(Form.left + 100, 150, 300, 200+GetSkinHeight(),0x34,sc.work,TITLE_SETT);
83
				DefineAndDrawWindow(Form.left + 100, 150, 300, 210+GetSkinHeight(),0x34,sc.work,TITLE_SETT);
89
				GetProcessInfo(#settings_form, SelfInfo);
-
 
90
 
-
 
Line -... Line 84...
-
 
84
				GetProcessInfo(#settings_form, SelfInfo);
91
				ShowDeviceName_chb.flags |= 1 << show_dev_name;
85
 
92
				RealFileNamesCase_chb.flags |= 1 << real_files_names_case;
86
				DrawSettingsCheckBoxes();
93
				InfoAfterCopy_chb.flags |= 1 << info_after_copy;
-
 
94
 
-
 
95
				key = itoa(files.line_h);
-
 
96
				strcpy(#lineh_s, key);
-
 
97
				
87
 
98
				check_box_draw stdcall (#ShowDeviceName_chb);
88
				WriteText(10, 84, 0x80, 0x000000, SET_3);
99
				check_box_draw stdcall (#RealFileNamesCase_chb);
-
 
-
 
89
				key = itoa(files.line_h);
100
				check_box_draw stdcall (#InfoAfterCopy_chb);
90
				strcpy(#lineh_s, key);
-
 
91
				edit_box_draw stdcall (#LineHeight_ed);
101
				edit_box_draw stdcall (#LineHeight_ed);
92
				DrawRectangle(LineHeight_ed.left-1, LineHeight_ed.top-1, LineHeight_ed.width+2, 16, sc.work_graph);
102
				DrawRectangle(LineHeight_ed.left-1, LineHeight_ed.top-1, LineHeight_ed.width+2, 16, sc.work_graph);
93
 
103
				WriteText(10, 77, 0x80, 0x000000, SET_3);
94
				DrawFlatButton(9, 127, strlen(EDIT_FILE_ASSOCIATIONS)+4*6, 22, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS);
104
				DrawFlatButton(9, 120, strlen(EDIT_FILE_ASSOCIATIONS)+4*6, 22, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS);
95
 
Line -... Line 96...
-
 
96
				DrawFlatButton(128, settings_form.cheight - 34, 70, 22, 10, 0xE4DFE1, APPLY_T);
-
 
97
				DrawFlatButton(208, settings_form.cheight - 34, 70, 22, 11, 0xE4DFE1, CANCEL_T);
-
 
98
	}
-
 
99
}
-
 
100
 
-
 
101
void DrawSettingsCheckBoxes()
-
 
102
{
Line 105... Line 103...
105
				DrawFlatButton(128, settings_form.cheight - 34, 70, 22, 10, 0xE4DFE1, APPLY_T);
103
	CheckBox2(10, 11, 20, SET_1,  show_dev_name);
106
				DrawFlatButton(208, settings_form.cheight - 34, 70, 22, 11, 0xE4DFE1, CANCEL_T);
104
	CheckBox2(10, 33, 21, SET_2,  real_files_names_case);
107
	}
105
	CheckBox2(10, 55, 22, SET_3,  info_after_copy);
108
}
106
}
Line 123... Line 121...
123
	info_after_copy = EAX;
121
	info_after_copy = EAX;
124
}
122
}
Line 125... Line 123...
125
 
123
 
126
void SaveIniSettings()
124
void SaveIniSettings()
127
{
-
 
128
	show_dev_name = TestBit(ShowDeviceName_chb.flags, 1);
-
 
129
	real_files_names_case = TestBit(RealFileNamesCase_chb.flags, 1);
-
 
130
	info_after_copy = TestBit(InfoAfterCopy_chb.flags, 1);
125
{
131
	ini_set_int stdcall (eolite_ini_path, "Config", "ShowDeviceName", show_dev_name);
126
	ini_set_int stdcall (eolite_ini_path, "Config", "ShowDeviceName", show_dev_name);
132
	ini_set_int stdcall (eolite_ini_path, "Config", "RealFileNamesCase", real_files_names_case);
127
	ini_set_int stdcall (eolite_ini_path, "Config", "RealFileNamesCase", real_files_names_case);
133
	ini_set_int stdcall (eolite_ini_path, "Config", "InfoAfterCopy", info_after_copy);
128
	ini_set_int stdcall (eolite_ini_path, "Config", "InfoAfterCopy", info_after_copy);
134
	ini_set_int stdcall (eolite_ini_path, "Config", "LineHeight", atoi(#lineh_s));
129
	ini_set_int stdcall (eolite_ini_path, "Config", "LineHeight", atoi(#lineh_s));
Line 158... Line 153...
158
	sc.work_button_text = 0x000000;
153
	sc.work_button_text = 0x000000;
159
	col_padding = 0xC8C9C9;
154
	col_padding = 0xC8C9C9;
160
	//col_selec   = 0x94AECE;
155
	//col_selec   = 0x94AECE;
161
	col_lpanel  = 0x00699C;
156
	col_lpanel  = 0x00699C;
162
}
157
}
163
>
158
 
-
 
159
 
-
 
160
void CheckBox2(dword x, y, id, text, byte value) {
-
 
161
	CheckBox(x, y, 14, 14, id, text, sc.work_graph, sc.work_text, value);
-
 
162
}
-
 
163
>
164
>
164
>