Subversion Repositories Kolibri OS

Rev

Rev 5417 | Rev 5435 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. //Leency 2008-2015
  2.  
  3. #define EDITOR_PATH     "/sys/tinypad"
  4.  
  5. #ifdef LANG_RUS
  6.         ?define TITLE_SETT " áâனª¨"
  7.         ?define SET_1 "‚뢮¤¨âì ­ §¢ ­¨ï ª« áá  ãáâனáâ¢"
  8.         ?define SET_2 "®ª §ë¢ âì ¨¬¥­  ä ©«®¢ ­¥ ¬¥­ïï ॣ¨áâà"
  9.         ?define SET_3 "‚ëá®â  áâப¨ ¢ ᯨ᪥"
  10.         ?define CANCEL_T "Žâ¬¥­ "
  11.         ?define APPLY_T "à¨¬¥­¨âì"
  12. #else
  13.         ?define TITLE_SETT "Settings"
  14.         ?define SET_1 "Show device class name"
  15.         ?define SET_2 "Show real file names without changing case"
  16.         ?define SET_3 "List line height"
  17.         ?define CANCEL_T "Cancel"
  18.         ?define APPLY_T "Apply"
  19. #endif
  20.  
  21. int     mouse_ddd;
  22. char lineh_s[30]="18\0";
  23. edit_box LineHeight_ed = {50,10,70,0xffffff,0x94AECE,0x9098B0,0x9098B0,2,4,#lineh_s,#mouse_ddd, 1000000000000010b,2,2};
  24. checkbox2 ShowDeviceName_chb = {10*65536+15, 10*65536+15, 5, 0xffffff, 0x9098B0, 0x80000000, SET_1, 110b};
  25. checkbox2 RealFileNamesCase_chb = {10*65536+15, 30*65536+15, 5, 0xffffff, 0x9098B0, 0x80000000, SET_2, 100b};
  26.  
  27. void settings_dialog()
  28. {  
  29.         byte id;
  30.         unsigned int key;
  31.         dword eolite_ini_path = abspath("Eolite.ini");
  32.         if (active_about) ExitProcess();
  33.         active_about=1;
  34.         SetEventMask(0x27);
  35.         loop() switch(WaitEvent())
  36.         {
  37.                 case evButton:
  38.                                 id=GetButtonID();
  39.                                 if (id==10)
  40.                                 {
  41.                                         if ( asm test ShowDeviceName_chb.flags, 2) ini_set_int stdcall (eolite_ini_path, "Config", "ShowDeviceName", 1);
  42.                                         ELSE  ini_set_int stdcall (eolite_ini_path, "Config", "ShowDeviceName", 0);
  43.                                         if ( asm test RealFileNamesCase_chb.flags, 2) ini_set_int stdcall (eolite_ini_path, "Config", "RealFileNamesCase", 1);
  44.                                         ELSE ini_set_int stdcall (eolite_ini_path, "Config", "RealFileNamesCase", 0);
  45.                                         if (LineHeight_ed.size) ini_set_int stdcall (eolite_ini_path, "Config", "LineHeight", atoi(#lineh_s));
  46.                                         active_about=0;
  47.                                         action_buf = 300;
  48.                                         ExitProcess();
  49.                                 }                                      
  50.                                 if (id==1) || (id==11)
  51.                                 {
  52.                                         active_about=0;
  53.                                         ExitProcess();
  54.                                 }
  55.                                 break;
  56.                                
  57.                 case evKey:
  58.                                 key = GetKey();
  59.                                 if (key==27)
  60.                                 {
  61.                                         active_about=0;
  62.                                         action_buf = 300;
  63.                                         ExitProcess();
  64.                                 }
  65.                                 EAX=key<<8;
  66.                                 edit_box_key stdcall(#LineHeight_ed);
  67.                                 break;
  68.                                
  69.                 case evMouse:
  70.                                 check_box_mouse stdcall (#ShowDeviceName_chb);
  71.                                 check_box_mouse stdcall (#RealFileNamesCase_chb);
  72.                                 edit_box_mouse stdcall (#LineHeight_ed);
  73.                                 break;
  74.                        
  75.                 case evReDraw:
  76.                                 DefineAndDrawWindow(Form.left + 100, 150, 300, 200+GetSkinHeight(),0x34,sc.work,TITLE_SETT);
  77.                                
  78.                                 if (show_dev_name) ShowDeviceName_chb.flags = 110b;
  79.                                 ELSE  ShowDeviceName_chb.flags = 100b;
  80.                                
  81.                                 if (real_files_names_case) RealFileNamesCase_chb.flags = 110b;
  82.                                 ELSE RealFileNamesCase_chb.flags = 100b;
  83.                                
  84.                                 key = itoa(files.line_h);
  85.                                 strcpy(#lineh_s, key);
  86.                                
  87.                                 check_box_draw stdcall (#ShowDeviceName_chb);
  88.                                 check_box_draw stdcall (#RealFileNamesCase_chb);
  89.                                 edit_box_draw stdcall (#LineHeight_ed);
  90.                                 WriteText(10, 55, 0x80, 0x000000, SET_3);
  91.                                 DrawFlatButton(128,160,70,22,10,0xE4DFE1, APPLY_T);
  92.                                 DrawFlatButton(208,160,70,22,11,0xE4DFE1, CANCEL_T);
  93.         }
  94. }
  95.  
  96.  
  97. void GetIni()
  98. {
  99.         dword eolite_ini_path = abspath("Eolite.ini");
  100.         ini_get_color stdcall (eolite_ini_path, "Config", "SelectionColor", 0x94AECE);
  101.         edit2.shift_color = EAX;
  102.         col_selec = EAX;
  103.         ini_get_int stdcall (eolite_ini_path, "Config", "LineHeight", 18);
  104.         files.line_h = EAX;
  105.         ini_get_int stdcall (eolite_ini_path, "Config", "ShowDeviceName", 1);
  106.         show_dev_name = EAX;
  107.         ini_get_int stdcall (eolite_ini_path, "Config", "RealFileNamesCase", 0);
  108.         real_files_names_case = EAX;
  109. }
  110.  
  111.  
  112. void Write_Error(int error_number)
  113. {
  114.         char error_message[500];
  115.         dword ii;
  116.         if (files.current>=0) Line_ReDraw(0xFF0000, files.current);
  117.         pause(5);
  118.         strcpy(#error_message, "\"Eolite\n");
  119.         ii = get_error(error_number);
  120.         strcat(#error_message, ii);
  121.         strcat(#error_message, "\" -tE");
  122.         notify(#error_message);
  123. }
  124.  
  125.  
  126. void SetAppColors()
  127. {
  128.         sc.work = 0xE4DFE1;
  129.         sc.work_text = 0;
  130.         sc.work_graph  = 0x9098B0; //A0A0B8; //0x819FC5;
  131.         sc.work_button_text = 0x000000;
  132.         col_padding = 0xC8C9C9;
  133.         //col_selec   = 0x94AECE;
  134.         col_lpanel  = 0x00699C;
  135.         /*
  136.         sc.get();
  137.         for (i=0; i<=14; i++) col_palette[i] = sc.work;
  138.         toolbar_pal[0]= goto_about_pal[0] = sc.work = sc.work;
  139.         col_lpanel = sc.work_graph;
  140.         for (i=0; i<=99; i++) blue_hl_pal[i] = sc.work_graph;
  141.         */
  142. }