2015-02-19 10:42:42 +03:00
|
|
|
|
//Leency 2008-2015
|
2015-02-17 19:46:38 +03:00
|
|
|
|
|
|
|
|
|
#define EDITOR_PATH "/sys/tinypad"
|
|
|
|
|
|
|
|
|
|
#ifdef LANG_RUS
|
2015-02-20 18:25:51 +03:00
|
|
|
|
?define EDIT_FILE_ASSOCIATIONS "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>樠樨 䠩<><E4A0A9><EFBFBD>"
|
2015-02-17 19:46:38 +03:00
|
|
|
|
?define TITLE_SETT "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ன<EFBFBD><EFBFBD>"
|
2015-03-18 14:59:32 +03:00
|
|
|
|
?define SHOW_DEVICE_CLASS "<EFBFBD>뢮<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ன<EFBFBD><E0AEA9><EFBFBD>"
|
|
|
|
|
?define SHOW_REAL_NAMES "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> ॣ<><E0A5A3><EFBFBD><EFBFBD>"
|
2015-03-19 16:49:26 +03:00
|
|
|
|
?define USE_BIG_FONTS "<EFBFBD>ᯮ<EFBFBD>짮<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㢥<><E3A2A5>祭<EFBFBD><E7A5AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
2015-03-18 14:59:32 +03:00
|
|
|
|
?define LIST_LINE_HEIGHT "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD> <20> ᯨ᪥"
|
|
|
|
|
?define NOTIFY_COPY_END "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><E8A5AD> <20><><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD>"
|
2015-02-17 20:01:43 +03:00
|
|
|
|
?define CANCEL_T "<EFBFBD>⬥<EFBFBD><EFBFBD>"
|
|
|
|
|
?define APPLY_T "<EFBFBD>ਬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
2015-07-16 04:44:30 +03:00
|
|
|
|
?define T_DOUBLE_CLICK "<EFBFBD>६<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28> <20><><EFBFBD><EFBFBD><EFBFBD>)"
|
2015-02-17 19:46:38 +03:00
|
|
|
|
#else
|
2015-02-20 18:25:51 +03:00
|
|
|
|
?define EDIT_FILE_ASSOCIATIONS "Edit file associations"
|
2015-02-19 10:42:42 +03:00
|
|
|
|
?define TITLE_SETT "Settings"
|
2015-03-18 14:59:32 +03:00
|
|
|
|
?define SHOW_DEVICE_CLASS "Show device class name"
|
|
|
|
|
?define SHOW_REAL_NAMES "Show real file names without changing case"
|
2015-03-19 16:49:26 +03:00
|
|
|
|
?define USE_BIG_FONTS "Use big fonts"
|
2015-03-18 14:59:32 +03:00
|
|
|
|
?define LIST_LINE_HEIGHT "List line height"
|
|
|
|
|
?define NOTIFY_COPY_END "Notify when copying finished"
|
2015-02-19 10:42:42 +03:00
|
|
|
|
?define CANCEL_T "Cancel"
|
|
|
|
|
?define APPLY_T "Apply"
|
2015-07-16 04:44:30 +03:00
|
|
|
|
?define T_DOUBLE_CLICK "Time double click (in hundredths)"
|
2015-02-17 19:46:38 +03:00
|
|
|
|
#endif
|
|
|
|
|
|
2015-03-18 14:59:32 +03:00
|
|
|
|
char confir_section = "Config";
|
|
|
|
|
|
2015-02-17 19:46:38 +03:00
|
|
|
|
|
|
|
|
|
void settings_dialog()
|
|
|
|
|
{
|
|
|
|
|
byte id;
|
|
|
|
|
unsigned int key;
|
2015-02-20 18:25:51 +03:00
|
|
|
|
proc_info settings_form;
|
2015-02-24 15:48:22 +03:00
|
|
|
|
|
2015-07-16 04:44:30 +03:00
|
|
|
|
if (active_settings){cmd_free = 4;ExitProcess();}
|
2015-02-24 15:48:22 +03:00
|
|
|
|
active_settings=1;
|
2015-07-16 04:44:30 +03:00
|
|
|
|
SetEventMask(0x27);
|
|
|
|
|
|
|
|
|
|
loop(){
|
|
|
|
|
switch(WaitEvent())
|
2015-02-17 19:46:38 +03:00
|
|
|
|
{
|
2015-07-16 04:44:30 +03:00
|
|
|
|
case evMouse:
|
|
|
|
|
|
|
|
|
|
break;
|
2015-02-17 19:46:38 +03:00
|
|
|
|
case evButton:
|
|
|
|
|
id=GetButtonID();
|
|
|
|
|
if (id==10)
|
|
|
|
|
{
|
2015-02-21 15:24:30 +03:00
|
|
|
|
SaveIniSettings();
|
2015-02-24 15:48:22 +03:00
|
|
|
|
active_settings=0;
|
2015-02-19 10:42:42 +03:00
|
|
|
|
action_buf = 300;
|
2015-07-16 04:44:30 +03:00
|
|
|
|
cmd_free = 4;
|
2015-02-17 19:46:38 +03:00
|
|
|
|
ExitProcess();
|
|
|
|
|
}
|
2015-02-19 10:42:42 +03:00
|
|
|
|
if (id==1) || (id==11)
|
2015-02-17 19:46:38 +03:00
|
|
|
|
{
|
2015-02-24 15:48:22 +03:00
|
|
|
|
active_settings=0;
|
2015-07-16 04:44:30 +03:00
|
|
|
|
cmd_free = 4;
|
2015-02-17 19:46:38 +03:00
|
|
|
|
ExitProcess();
|
|
|
|
|
}
|
2015-02-20 18:25:51 +03:00
|
|
|
|
if (id==5)
|
|
|
|
|
{
|
|
|
|
|
RunProgram("tinypad", "/sys/settings/assoc.ini");
|
2015-02-24 20:47:47 +03:00
|
|
|
|
break;
|
2015-02-20 18:25:51 +03:00
|
|
|
|
}
|
2015-02-24 20:47:47 +03:00
|
|
|
|
if (id==20) show_dev_name ^= 1;
|
|
|
|
|
if (id==21) real_files_names_case ^= 1;
|
|
|
|
|
if (id==22) info_after_copy ^= 1;
|
2015-03-19 16:49:26 +03:00
|
|
|
|
if (id==23) use_big_fonts ^= 1;
|
2015-02-26 20:20:30 +03:00
|
|
|
|
if (id==25) files.line_h++;
|
|
|
|
|
if (id==26) && (files.line_h>8) files.line_h--;
|
2015-07-16 04:44:30 +03:00
|
|
|
|
if (id==27) MOUSE_TIME++;
|
|
|
|
|
if (id==28) && (MOUSE_TIME>30) MOUSE_TIME--;
|
2015-02-24 20:47:47 +03:00
|
|
|
|
DrawSettingsCheckBoxes();
|
2015-02-17 19:46:38 +03:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evKey:
|
|
|
|
|
key = GetKey();
|
2015-02-19 10:42:42 +03:00
|
|
|
|
if (key==27)
|
2015-02-17 19:46:38 +03:00
|
|
|
|
{
|
2015-03-18 14:59:32 +03:00
|
|
|
|
active_settings = 0;
|
2015-02-19 10:42:42 +03:00
|
|
|
|
action_buf = 300;
|
2015-07-16 04:44:30 +03:00
|
|
|
|
cmd_free = 4;
|
2015-02-17 19:46:38 +03:00
|
|
|
|
ExitProcess();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evReDraw:
|
2015-07-16 04:44:30 +03:00
|
|
|
|
DefineAndDrawWindow(Form.left + Form.width/2, Form.top + Form.height/2 - 75, 300, 232+GetSkinHeight(),0x34,sc.work,TITLE_SETT);
|
2015-02-20 18:25:51 +03:00
|
|
|
|
GetProcessInfo(#settings_form, SelfInfo);
|
2015-02-24 20:47:47 +03:00
|
|
|
|
DrawSettingsCheckBoxes();
|
2015-07-16 04:44:30 +03:00
|
|
|
|
DrawFlatButton(9, 168, strlen(EDIT_FILE_ASSOCIATIONS)+4*6, 22, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS);
|
|
|
|
|
DrawFlatButton(128, settings_form.cheight - 30, 70, 22, 10, 0xE4DFE1, APPLY_T);
|
|
|
|
|
DrawFlatButton(208, settings_form.cheight - 30, 70, 22, 11, 0xE4DFE1, CANCEL_T);
|
|
|
|
|
}
|
2015-02-17 19:46:38 +03:00
|
|
|
|
}
|
2015-02-19 10:42:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
2015-02-24 20:47:47 +03:00
|
|
|
|
void DrawSettingsCheckBoxes()
|
|
|
|
|
{
|
2015-03-18 14:59:32 +03:00
|
|
|
|
CheckBox2(10, 11, 20, SHOW_DEVICE_CLASS, show_dev_name);
|
|
|
|
|
CheckBox2(10, 33, 21, SHOW_REAL_NAMES, real_files_names_case);
|
|
|
|
|
CheckBox2(10, 55, 22, NOTIFY_COPY_END, info_after_copy);
|
2015-03-21 02:40:49 +03:00
|
|
|
|
CheckBox2(10, 77, 23, USE_BIG_FONTS, use_big_fonts);
|
|
|
|
|
MoreLessBox(10, 104, 18, 25, 26, #sc, files.line_h, LIST_LINE_HEIGHT);
|
2015-07-16 04:44:30 +03:00
|
|
|
|
MoreLessBox(10, 134, 18, 27, 28, #sc, MOUSE_TIME, T_DOUBLE_CLICK);
|
2015-02-24 20:47:47 +03:00
|
|
|
|
}
|
|
|
|
|
|
2015-02-19 10:42:42 +03:00
|
|
|
|
|
2015-02-21 15:24:30 +03:00
|
|
|
|
void LoadIniSettings()
|
2015-02-19 10:42:42 +03:00
|
|
|
|
{
|
2015-03-19 16:49:26 +03:00
|
|
|
|
ini_get_color stdcall (eolite_ini_path, #confir_section, "SelectionColor", 0x94AECE); edit2.shift_color = col_selec = EAX;
|
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #confir_section, "ShowDeviceName", 1); show_dev_name = EAX;
|
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #confir_section, "RealFileNamesCase", 0); real_files_names_case = EAX;
|
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #confir_section, "InfoAfterCopy", 0); info_after_copy = EAX;
|
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #confir_section, "UseBigFonts", 0); use_big_fonts = EAX;
|
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #confir_section, "LineHeight", 18); files.line_h = EAX;
|
2015-07-12 02:45:19 +03:00
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #confir_section, "TimeDoubleClick", 50); MOUSE_TIME = EAX;
|
|
|
|
|
|
2015-03-19 16:49:26 +03:00
|
|
|
|
if (use_big_fonts)
|
|
|
|
|
{
|
|
|
|
|
font_type = 0x90;
|
|
|
|
|
PathShow.font_size_x = FileShow.font_size_x = 8;
|
|
|
|
|
PathShow.font_number = FileShow.font_number = 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
font_type=0x80;
|
|
|
|
|
PathShow.font_size_x = FileShow.font_size_x = 8;
|
|
|
|
|
PathShow.font_number = FileShow.font_number = 0;
|
|
|
|
|
}
|
2015-02-19 10:42:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
2015-02-21 15:24:30 +03:00
|
|
|
|
void SaveIniSettings()
|
|
|
|
|
{
|
2015-03-18 14:59:32 +03:00
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #confir_section, "ShowDeviceName", show_dev_name);
|
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #confir_section, "RealFileNamesCase", real_files_names_case);
|
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #confir_section, "InfoAfterCopy", info_after_copy);
|
2015-03-19 16:49:26 +03:00
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #confir_section, "UseBigFonts", use_big_fonts);
|
2015-03-18 14:59:32 +03:00
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #confir_section, "LineHeight", files.line_h);
|
2015-07-16 04:44:30 +03:00
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #confir_section, "TimeDoubleClick", MOUSE_TIME);
|
2015-02-21 15:24:30 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2015-02-19 10:42:42 +03:00
|
|
|
|
|
|
|
|
|
void Write_Error(int error_number)
|
|
|
|
|
{
|
|
|
|
|
char error_message[500];
|
|
|
|
|
dword ii;
|
|
|
|
|
if (files.current>=0) Line_ReDraw(0xFF0000, files.current);
|
|
|
|
|
pause(5);
|
2015-07-16 04:44:30 +03:00
|
|
|
|
sprintf(#error_message,"\"%s\n%s\" -%s","Eolite",get_error(error_number),"tE");
|
2015-02-19 10:42:42 +03:00
|
|
|
|
notify(#error_message);
|
2015-07-16 04:44:30 +03:00
|
|
|
|
|
2015-02-19 10:42:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SetAppColors()
|
|
|
|
|
{
|
|
|
|
|
sc.work = 0xE4DFE1;
|
|
|
|
|
sc.work_text = 0;
|
|
|
|
|
sc.work_graph = 0x9098B0; //A0A0B8; //0x819FC5;
|
2015-03-21 02:40:49 +03:00
|
|
|
|
sc.work_button = 0xD2D3D3;
|
2015-02-19 10:42:42 +03:00
|
|
|
|
sc.work_button_text = 0x000000;
|
|
|
|
|
col_padding = 0xC8C9C9;
|
|
|
|
|
//col_selec = 0x94AECE;
|
|
|
|
|
col_lpanel = 0x00699C;
|
2015-02-24 20:47:47 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CheckBox2(dword x, y, id, text, byte value) {
|
|
|
|
|
CheckBox(x, y, 14, 14, id, text, sc.work_graph, sc.work_text, value);
|
2015-02-17 19:46:38 +03:00
|
|
|
|
}
|