Subversion Repositories Kolibri OS

Rev

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

  1. //Leency 2008-2013
  2.  
  3. #define EDITOR_PATH     "/sys/tinypad"
  4. #define BROWSER_PATH    "/sys/htmlv"
  5. #define BROWSER_LINK    "http://kolibri-n.org/index.php"
  6.  
  7. #ifdef LANG_RUS
  8.         ?define TITLE_SETT " áâனª¨"
  9.         ?define SET_1 "®ª §ë¢ âì ¨¬¥­  ãáâனáâ¢"
  10.         ?define SET_2 "¥ «ì­ë¥ ¨¬¥­ "
  11.         ?define SET_3 "‚ëá®â  ¢ë¤¥«¥­¨ï"
  12.         ?define CANCEL_T "Žâ¬¥­ "
  13.         ?define APPLY_T "à¨¬¥­¨âì"
  14. #elif LANG_EST
  15.         ?define TITLE_SETT "Programmis Eolite"
  16. #else
  17.         ?define TITLE_SETT "About Eolite"
  18.  
  19. #endif
  20.  
  21. int     mouse_ddd;
  22. char lineh_s[30]="18\0";
  23. edit_box LineHeight_ed = {50,10,70,0xffffff,0x94AECE,0x000000,0x000000,2,4,#lineh_s,#mouse_ddd, 1000000000000010b,2,2};
  24. checkbox2 ShowDeviceName_chb = {10*65536+15, 10*65536+15, 5, 0xffffff, 0x000000, 0x80000000, SET_1, 110b};
  25. checkbox2 RealFileNamesCase_chb = {10*65536+15, 30*65536+15, 5, 0xffffff, 0x000000, 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.                                         ExitProcess();
  48.                                 }                                      
  49.                                 IF (id==1) || (id==11)
  50.                                 {
  51.                                         active_about=0;
  52.                                         ExitProcess();
  53.                                 }
  54.                                 IF (id==23) RunProgram(BROWSER_PATH, BROWSER_LINK);
  55.                                 break;
  56.                                
  57.                 case evKey:
  58.                                 key = GetKey();
  59.                                 IF (key==27)
  60.                                 {
  61.                                         active_about=0;
  62.                                         ExitProcess();
  63.                                 }
  64.                                 EAX=key<<8;
  65.                                 edit_box_key stdcall(#LineHeight_ed);
  66.                                 break;
  67.                                
  68.                 case evMouse:
  69.                                 check_box_mouse stdcall (#ShowDeviceName_chb);
  70.                                 check_box_mouse stdcall (#RealFileNamesCase_chb);
  71.                                 edit_box_mouse stdcall (#LineHeight_ed);
  72.                                 break;
  73.                        
  74.                 case evReDraw:
  75.                                 DefineAndDrawWindow(600,150,281,228+GetSkinHeight(),0x34,sc.work,TITLE_SETT);
  76.                                
  77.                                 IF (show_dev_name) ShowDeviceName_chb.flags = 110b;
  78.                                 ELSE  ShowDeviceName_chb.flags = 100b;
  79.                                
  80.                                 IF (real_files_names_case) RealFileNamesCase_chb.flags = 110b;
  81.                                 ELSE RealFileNamesCase_chb.flags = 100b;
  82.                                
  83.                                 key = itoa(files.line_h);
  84.                                 strcpy(#lineh_s, key);
  85.                                
  86.                                 check_box_draw stdcall (#ShowDeviceName_chb);
  87.                                 check_box_draw stdcall (#RealFileNamesCase_chb);
  88.                                 edit_box_draw stdcall (#LineHeight_ed);
  89.                                 WriteText(10, 55, 0x80, 0x000000, SET_3);
  90.                                 DrawFlatButton(115,190,70,22,10,0xE4DFE1, APPLY_T);
  91.                                 DrawFlatButton(195,190,70,22,11,0xE4DFE1, CANCEL_T);
  92.         }
  93. }