2 Replies Latest reply on Jan 16, 2009 1:51 PM by mikem75

    lineHeight property

    mikem75 Level 1
      Has anyone had any difficulty with setting the "lineHeight" property in Lingo, or am I just missing something? I'm attempting to format text for buttons at run time. The text can change with varying lengths of text so I need to adjust kerning and fontsize during runtime. I would also like to adjust the lineHeight property to ensure the text stays centered and looks nice on the button. Here's my code:

      on mFormat_text()
      member("Button" & t-1, "Timeout cast").wordwrap = FALSE
      member("Button" & t-1, "Timeout cast").charspacing = 0
      member("Button" & t-1, "Timeout cast").fontsize = 24
      member("Button" & t-1, "Timeout cast").lineHeight = 28

      mem_length = member("Button" & t-1, "Timeout cast").text.length
      mem_width = member("Button" & t-1, "Timeout cast").charpostoloc(mem_length)

      if mem_width.locH > 200 then
      member("Button" & t-1, "Timeout cast").charspacing = - 1
      end if
      if mem_width.locH > 215 then
      member("Button" & t-1, "Timeout cast").charspacing = 0
      member("Button" & t-1, "Timeout cast").fontsize = 20
      member("Button" & t-1, "Timeout cast").lineHeight = 22
      end if
      if mem_width.locH > 260 then
      member("Button" & t-1, "Timeout cast").wordwrap = TRUE
      member("Button" & t-1, "Timeout cast").charspacing = -2
      member("Button" & t-1, "Timeout cast").fontsize = 20
      -- member("Button" & t-1, "Timeout cast").lineHeight = 22
      end if
      if mem_width.locH > 300 then
      member("Button" & t-1, "Timeout cast").wordwrap = TRUE
      member("Button" & t-1, "Timeout cast").charspacing = 0
      member("Button" & t-1, "Timeout cast").fontsize = 16
      -- member("Button" & t-1, "Timeout cast").lineHeight = 18
      end if
      if mem_width.locH > 325 then
      member("Button" & t-1, "Timeout cast").wordwrap = TRUE
      member("Button" & t-1, "Timeout cast").charspacing = 0
      member("Button" & t-1, "Timeout cast").fontsize = 14
      -- member("Button" & t-1, "Timeout cast").lineHeight = 16
      end if


      Whenever I try to set the lineHeight property I get a "property undefined" error. What am I doing wrong??

      Mike