Graphics

 View Only
  • 1.  Visual Logic - If Empty

    Posted 12-10-2015 21:47

    Hello Everyone,

    We are in the process of creating a new graphics package and I am doing my best to simplify the amount of templates we have. Instead of having a template per amount of lines we need in certain fullscreens, I am trying to keep them all into one template.
    I was successful enough to create a 6 Line Comparison graphic and move into a 5 Line graphic by using the 'if empty' option in visual logic. I am trying to apply the same logic to make it a 4 Line graphic and have the lines move up. My problem right now is that it only does either or. Is it possible to make some sort of rule that says if Line 6 is empty, move to Line 5 settings, and if Line 5 is empty move to Line 4 settings?

    I am attaching a few images to make myself more clear. I would really appreciate the help. I feel like I've tried a lot of different combinations but I am not a pro at visual logic.



    Thank you in advance.
    Mildred

     



  • 2.  RE: Visual Logic - If Empty

    Posted 12-17-2015 18:19

    Hi Mildred,

    Are you comfortable with scripting? This might be easier to accomplish using scripting instead of visual logic. Try putting this script on the "onOnline" and "onPreviewRender" - be sure to change the values after .PosY to where you want the text to show up



    dim line1, line2, line3, line4, line5, line6 as xpTextObject

    'Get all of the text fields
    self.GetObjectByName("Category 1", line1)
    self.GetObjectByName("Category 2", line2)
    self.GetObjectByName("Category 3", line3)
    self.GetObjectByName("Category 4", line4)
    self.GetObjectByName("Category 5", line5)
    self.GetObjectByName("Category 6", line6)


    'Check to see if the last row has any text
    if line6.text = ""
    line1.visible = true
    line2.visible = true
    line3.visible = true
    line4.visible = true
    line5.visible = true
    line6.visible = false

    line1.PosY = 100.00
    line2.PosY = 150.00
    line3.PosY = 200.00
    line4.PosY = 250.00
    line5.PosY = 300.00

    else if line5.text = ""
    line1.visible = true
    line2.visible = true
    line3.visible = true
    line4.visible = true
    line5.visible = false
    line6.visible = false

    line1.PosY = 100.00
    line2.PosY = 150.00
    line3.PosY = 200.00
    line4.PosY = 250.00

    else if line4.text = ""
    line1.visible = true
    line2.visible = true
    line3.visible = true
    line4.visible = false
    line5.visible = false
    line6.visible = false

    line1.PosY = 100.00
    line2.PosY = 150.00
    line3.PosY = 200.00

    'If every row is full, show all rows
    else
    line1.visible = true
    line2.visible = true
    line3.visible = true
    line4.visible = true
    line5.visible = true
    line6.visible = true

    line1.PosY = 100.00
    line2.PosY = 150.00
    line3.PosY = 200.00
    line4.PosY = 250.00
    line5.PosY = 300.00
    line6.PosY = 350.00
    end if



    Let me know if that helps-
    Rob


    #XPression


  • 3.  RE: Visual Logic - If Empty

    Posted 12-18-2015 11:10

    Hey,

    If you're keen to use visual logic you could use something like this.

    I'm using a group for shift of the position but you can use the same logic.


    #XPression