0 Replies Latest reply on Dec 19, 2014 1:41 AM by Sudha K

    UI Dynamic resize

    Sudha K Level 1

      Hi,

       

         I am changing my dialog as dynamic.  but the bounds are changed when i changing values from dropdownlist.  Whats wrong in code.  Can anyone help me???

       

      #targetengine 'testShowHidePanel' 

      var NULL_SIZE = [0,0], 

              MAX_SIZE = [2000,2000];

             

      var processTypes = ["Generate Report","Validation"];

      var panelSize = [0,0,300,100];

           

          var u, 

              w = new Window('palette'), 

             

      //~     procPanel = w.add('panel',u, 'Choose Process Type'),       

      //~     txtprocPanel = procPanel.add('statictext', u, 'Process Type :'),

      //~     ddList = procPanel.add('dropdownlist',u, processTypes ),//[100,10,250,45],[115,55,300,90],[156,90,250,105]

         

          procPanel = w.add('panel',[0,0,300,100], 'Choose Process Type'),       

          txtprocPanel = procPanel.add('statictext', [10,30,100,50], 'Process Type :'),

          ddList = procPanel.add('dropdownlist',[110,30,260,50], processTypes ),

       

      //~     reportPanel = w.add('panel'),

      //~     txtFolder = reportPanel.add('statictext', u, 'Choose Input Folder:'),

      //~     etxtFolder = reportPanel.add('edittext', u, ''),   

      //~     btnFolder = reportPanel.add('button', u, 'Browse'),           

       

          reportPanel = w.add('panel',panelSize, 'InDesign Input Folder'),

          txtFolder = reportPanel.add('statictext', [10,20,150,50], 'Choose Input Folder:'),

          etxtFolder = reportPanel.add('edittext', [10,50,200,70], ''),   

          btnFolder = reportPanel.add('button', [220,50,280,70], 'Browse'),           

         

       

          tcvalidationPanel = w.add('panel',panelSize,'Validation 1'),   

          txtTCInddCSV =tcvalidationPanel.add('statictext', u, 'Choose CSV 1 :'),

          etxtTCInddCSV = tcvalidationPanel.add('edittext', u, ''),   

          btnTCInddCSV = tcvalidationPanel.add('button', u, 'Browse'),

          txtTCCSV = tcvalidationPanel.add('statictext', u, 'Choose 2 : '),

          etxtTCCSV = tcvalidationPanel.add('edittext', u, ''),

          btnTCCSV = tcvalidationPanel.add('button', u, 'Browse'),

         

          rcvalidationPanel = w.add('panel',u, 'Validation 2');   

          txtRCInddCSV = rcvalidationPanel.add('statictext', u, 'Choose CSV '),

          etxtRCInddCSV = rcvalidationPanel.add('edittext', u, ''),

          btnRCInddCSV = rcvalidationPanel.add('button', u, 'Browse'),

          txtRCCSV = rcvalidationPanel.add('statictext', u, 'Choose Doc'),

          etxtRCCSV = rcvalidationPanel.add('edittext', u, ''),

          btnRCCSV = rcvalidationPanel.add('button',u, 'Browse'),

         

         

          btnGrp = w.add('panel'),

          btnGrp.orientation = 'row',

          RunBtn = btnGrp.add('button', u, 'Get Report'),

          CloseBtn = btnGrp.add('button', u, 'Close'),

          ddList.selection = 0;

       

              // ---         

          

       

          tcvalidationPanel.visible = false;

          rcvalidationPanel.visible = false;

          tcvalidationPanel.maximumSize = NULL_SIZE;

          rcvalidationPanel.maximumSize = NULL_SIZE; 

           

          ddList.onChange = function() 

          { 

             if(ddList.selection == 0)

             {              

                  tcvalidationPanel.visible = false;

                  rcvalidationPanel.visible = false;

                  reportPanel.maximumSize = reportPanel.visible ? NULL_SIZE : MAX_SIZE;

                  tcvalidationPanel.maximumSize = NULL_SIZE;

                  rcvalidationPanel.maximumSize = NULL_SIZE;

                  reportPanel.visible ^= 1; 

                   w.layout.layout(1); 

              }else

              {  

                  reportPanel.visible = false;           

                  tcvalidationPanel.maximumSize = tcvalidationPanel.visible ? NULL_SIZE : MAX_SIZE;

                  rcvalidationPanel.maximumSize = rcvalidationPanel.visible ? NULL_SIZE : MAX_SIZE;

                  reportPanel.maximumSize = NULL_SIZE;

                  tcvalidationPanel.visible ^= 1; 

                  rcvalidationPanel.visible ^= 1; 

                  w.layout.layout(1); 

                 

              }

          }; 

           

          w.show();