Graphics

 View Only
  • 1.  Xpression SetTabPosition

    Posted 7 days ago
    I am working on a graphic that would allow my producers to set tabs in a series of left justified text fields to make columns.

    I previously had a similar graphic with tabs every 40 pixels that would lay out text into simple columns with CTRL-Tabs in our ENPS Xpression plugin.

    I built the following script (OnOnline,OnPreviewRender,OnRender)

    dim Output1, Output2, Output3, Output4, Output5, Output6, Output7, Output8 as xpTextObject
    dim TabPosition1, TabPosition2, TabPosition3, TabPosition4, TabPosition5, TabPosition6, TabPosition7, TabPosition8, TabPosition9, TabPosition10, TabPosition11, TabPosition12 as xpTextObject
    
    self.GetObjectByName("Output1",Output1)
    self.GetObjectByName("Output2",Output2)
    self.GetObjectByName("Output3",Output3)
    self.GetObjectByName("Output4",Output4)
    self.GetObjectByName("Output5",Output5)
    self.GetObjectByName("Output6",Output6)
    self.GetObjectByName("Output7",Output7)
    self.GetObjectByName("Output8",Output8)
    
    self.GetObjectByName("TabPosition1",TabPosition1)
    self.GetObjectByName("TabPosition2",TabPosition2)
    self.GetObjectByName("TabPosition3",TabPosition3)
    self.GetObjectByName("TabPosition4",TabPosition4)
    self.GetObjectByName("TabPosition5",TabPosition5)
    self.GetObjectByName("TabPosition6",TabPosition6)
    self.GetObjectByName("TabPosition7",TabPosition7)
    self.GetObjectByName("TabPosition8",TabPosition8)
    self.GetObjectByName("TabPosition9",TabPosition9)
    self.GetObjectByName("TabPosition10",TabPosition10)
    self.GetObjectByName("TabPosition11",TabPosition11)
    self.GetObjectByName("TabPosition12",TabPosition12)
    
    Output1.SetTabPosition(0,TabPosition1.posX)
    Output2.SetTabPosition(0,TabPosition1.posX)
    Output3.SetTabPosition(0,TabPosition1.posX)
    Output4.SetTabPosition(0,TabPosition1.posX)
    Output5.SetTabPosition(0,TabPosition1.posX)
    Output6.SetTabPosition(0,TabPosition1.posX)
    Output7.SetTabPosition(0,TabPosition1.posX)
    Output8.SetTabPosition(0,TabPosition1.posX)
    
    Output1.SetTabPosition(1,TabPosition2.posX)
    Output2.SetTabPosition(1,TabPosition2.posX)
    Output3.SetTabPosition(1,TabPosition2.posX)
    Output4.SetTabPosition(1,TabPosition2.posX)
    Output5.SetTabPosition(1,TabPosition2.posX)
    Output6.SetTabPosition(1,TabPosition2.posX)
    Output7.SetTabPosition(1,TabPosition2.posX)
    Output8.SetTabPosition(1,TabPosition2.posX)
    
    Output1.SetTabPosition(2,TabPosition3.posX)
    Output2.SetTabPosition(2,TabPosition3.posX)
    Output3.SetTabPosition(2,TabPosition3.posX)
    Output4.SetTabPosition(2,TabPosition3.posX)
    Output5.SetTabPosition(2,TabPosition3.posX)
    Output6.SetTabPosition(2,TabPosition3.posX)
    Output7.SetTabPosition(2,TabPosition3.posX)
    Output8.SetTabPosition(2,TabPosition3.posX)
    
    Output1.SetTabPosition(3,TabPosition4.posX)
    Output2.SetTabPosition(3,TabPosition4.posX)
    Output3.SetTabPosition(3,TabPosition4.posX)
    Output4.SetTabPosition(3,TabPosition4.posX)
    Output5.SetTabPosition(3,TabPosition4.posX)
    Output6.SetTabPosition(3,TabPosition4.posX)
    Output7.SetTabPosition(3,TabPosition4.posX)
    Output8.SetTabPosition(3,TabPosition4.posX)
    
    Output1.SetTabPosition(4,TabPosition5.posX)
    Output2.SetTabPosition(4,TabPosition5.posX)
    Output3.SetTabPosition(4,TabPosition5.posX)
    Output4.SetTabPosition(4,TabPosition5.posX)
    Output5.SetTabPosition(4,TabPosition5.posX)
    Output6.SetTabPosition(4,TabPosition5.posX)
    Output7.SetTabPosition(4,TabPosition5.posX)
    Output8.SetTabPosition(4,TabPosition5.posX)
    
    Output1.SetTabPosition(5,TabPosition6.posX)
    Output2.SetTabPosition(5,TabPosition6.posX)
    Output3.SetTabPosition(5,TabPosition6.posX)
    Output4.SetTabPosition(5,TabPosition6.posX)
    Output5.SetTabPosition(5,TabPosition6.posX)
    Output6.SetTabPosition(5,TabPosition6.posX)
    Output7.SetTabPosition(5,TabPosition6.posX)
    Output8.SetTabPosition(5,TabPosition6.posX)
    
    Output1.SetTabPosition(6,TabPosition7.posX)
    Output2.SetTabPosition(6,TabPosition7.posX)
    Output3.SetTabPosition(6,TabPosition7.posX)
    Output4.SetTabPosition(6,TabPosition7.posX)
    Output5.SetTabPosition(6,TabPosition7.posX)
    Output6.SetTabPosition(6,TabPosition7.posX)
    Output7.SetTabPosition(6,TabPosition7.posX)
    Output8.SetTabPosition(6,TabPosition7.posX)
    
    Output1.SetTabPosition(7,TabPosition8.posX)
    Output2.SetTabPosition(7,TabPosition8.posX)
    Output3.SetTabPosition(7,TabPosition8.posX)
    Output4.SetTabPosition(7,TabPosition8.posX)
    Output5.SetTabPosition(7,TabPosition8.posX)
    Output6.SetTabPosition(7,TabPosition8.posX)
    Output7.SetTabPosition(7,TabPosition8.posX)
    Output8.SetTabPosition(7,TabPosition8.posX)
    
    Output1.SetTabPosition(8,TabPosition9.posX)
    Output2.SetTabPosition(8,TabPosition9.posX)
    Output3.SetTabPosition(8,TabPosition9.posX)
    Output4.SetTabPosition(8,TabPosition9.posX)
    Output5.SetTabPosition(8,TabPosition9.posX)
    Output6.SetTabPosition(8,TabPosition9.posX)
    Output7.SetTabPosition(8,TabPosition9.posX)
    Output8.SetTabPosition(8,TabPosition9.posX)
    
    Output1.SetTabPosition(9,TabPosition10.posX)
    Output2.SetTabPosition(9,TabPosition10.posX)
    Output3.SetTabPosition(9,TabPosition10.posX)
    Output4.SetTabPosition(9,TabPosition10.posX)
    Output5.SetTabPosition(9,TabPosition10.posX)
    Output6.SetTabPosition(9,TabPosition10.posX)
    Output7.SetTabPosition(9,TabPosition10.posX)
    Output8.SetTabPosition(9,TabPosition10.posX)
    
    Output1.SetTabPosition(10,TabPosition11.posX)
    Output2.SetTabPosition(10,TabPosition11.posX)
    Output3.SetTabPosition(10,TabPosition11.posX)
    Output4.SetTabPosition(10,TabPosition11.posX)
    Output5.SetTabPosition(10,TabPosition11.posX)
    Output6.SetTabPosition(10,TabPosition11.posX)
    Output7.SetTabPosition(10,TabPosition11.posX)
    Output8.SetTabPosition(10,TabPosition11.posX)
    
    Output1.SetTabPosition(11,TabPosition12.posX)
    Output2.SetTabPosition(11,TabPosition12.posX)
    Output3.SetTabPosition(11,TabPosition12.posX)
    Output4.SetTabPosition(11,TabPosition12.posX)
    Output5.SetTabPosition(11,TabPosition12.posX)
    Output6.SetTabPosition(11,TabPosition12.posX)
    Output7.SetTabPosition(11,TabPosition12.posX)
    Output8.SetTabPosition(11,TabPosition12.posX)
    ​

    I could adjust my tab positions, but I noticed some strange behavior, where TabPosition12.posX didn't seem to be affecting the tab I thought it should.

    I decided that perhaps Index was the order that tabs had been created, so I deleted all but one tab and added new ones till I had twelve.

    Are Indices of the tabs the order of tabs in the tabs list...or order of creation...and does that mean infinite order of creation?

    Are my tab indices now 1,2,3,4,5,6,7,8,9,10,11,12 or something like 1,13,14,15,16,17,18,19,20,21,22,23?

    Does anybody have an idea what might be getting in my way?

    By the way, I also have SetTabAlign scripts on a set of TabAlignment text fields for left-, center-, and right- justified tabs.

    Thanks,
    James.

    ------------------------------
    James Hessler
    WAAY (HEARTLAND MEDIA)
    ------------------------------