Code Viewer

./WindowHandlers/Preferences_handler.js File Size: 3.58 KB

  1. /*
  2. *
  3. *      Preferences.xml : Preferences
  4. *     
  5. */
  6.  
  7. function OnPreferencesEvent_CtrlClicked(pPlusWnd, sControlId) {
  8.         var m = /^btnBread(\d)(Arrow)?$/.exec(sControlId);
  9.         if (m) {
  10.                 //Collect the information from the RegExp
  11.                 var nLevel = 1*m[1];
  12.                 var bMenu = (m[2] !== "");
  13.                 if (bMenu) {
  14.                         /* Open the menu */
  15.                         //Get the position for the menu
  16.                         var BtnPos = GetWindowPos(pPlusWnd.GetControlHandle(sControlId) );
  17.                         var Point = [BtnPos.Left + (_lang.IsRtl ? BtnPos.Width : 0), BtnPos.Top + BtnPos.Height ];
  18.                         //Create the menu
  19.                         var BreadcrumbMenu = new Menu(MenuCallback);
  20.                         //Get the item at the left of the clicked arrow button
  21.                         var sParent = objPrefTemp['Breadcrumb'][nLevel-2];
  22.                         if (sParent === "Preferences") sParent = "PrefDashboard";
  23.                         //Fill the menu with the childs of the menu
  24.                         for (var i=0; i<objChildInfo[sParent].childs.length; i++) {
  25.                                 var child = objChildInfo[sParent].childs[i];
  26.                                 BreadcrumbMenu.AddMenuItem("Menu."+child, _lang.text['Breadcrumb_'+child] );
  27.                         }
  28.                         //Open the menu
  29.                         BreadcrumbMenu.Open(Point, null, _lang.IsRtl );
  30.                 } else {
  31.                         /* Open the parent */
  32.                         var ChildName = objPrefTemp['Breadcrumb'][nLevel-1];
  33.                         if (ChildName === "Preferences") ChildName = "PrefDashboard";
  34.                         Preferences_ShowChild(ChildName);
  35.                 }
  36.         }
  37.  
  38.         function MenuCallback(sId, Param) {
  39.                 var m = /^Menu\.(.+)$/.exec(sId);
  40.                 if (!m) return;
  41.                 var ChildName = m[1];
  42.                 Preferences_ShowChild(ChildName);
  43.                 BreadcrumbMenu.Destroy();
  44.         }
  45. }
  46.  
  47. function OnPreferencesEvent_Cancel(pPlusWnd) { return bIsFtpTesting; }
  48.  
  49. function OnPreferencesEvent_Destroyed(pPlusWnd, nExitCode) {
  50.         if (nExitCode !== 6) {
  51.                 if (objPrefTemp['ChildOpen'] === 'PrefHkAddEdit') _hotkey.PauseHotkeyHandling(false);
  52.                 objPrefTemp = {};
  53.                 CloseWindow(pPlusWnd.WindowId);
  54.                 return false;
  55.         }
  56. }
  57.  
  58.  

Version

  • 5.0.0070_20100325_publicbeta1

Developers

Project Details

  • Folders8
  • Files122
  • Total Lines11,867
  • Repository Version70

User Count

  • 162