Announcement

Collapse
No announcement yet.

Drawing functions Q

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Alex,

    Do you have an working example that you can share with us, because my Help file downloaded today, with Build 779[last update 4/21] does not have Shape.RESET.
    Do you have it in your Help file?

    I want to stress again, my efs is working if "y" is traditionally made, but not with AboveBar/BelowBar, although Text.PRESET is part of my flags.
    Note: I am referring to DrawTextRelative function.

    Thank you.
    Mihai
    Mihai Buta

    Comment


    • #17
      Mihai
      You can use the example posted by Chris which uses drawTextRelative() with the Text.PRESET flag and the AboveBar location setting
      As I have already said in my previous reply if your efs is not working post the code.
      Alex



      Originally posted by mbuta
      Alex,

      Do you have an working example that you can share with us, because my Help file downloaded today, with Build 779[last update 4/21] does not have Shape.RESET.
      Do you have it in your Help file?

      I want to stress again, my efs is working if "y" is traditionally made, but not with AboveBar/BelowBar, although Text.PRESET is part of my flags.
      Note: I am referring to DrawTextRelative function.

      Thank you.
      Mihai

      Comment


      • #18
        I looked and tried again, but I doubt it can work and I will more than happy to explain why: I think the definition [source code] of AboveBar/BelowBar/TopRow/BottomRow needs to be reviewed. If the definition were correct, would not need Text.PRESET or Shape.PRESET as part of the flags.

        Mihai
        Mihai Buta

        Comment


        • #19
          Well it certainly works on my end and I am still using 7.91. Try the attached script.

          Chris
          Attached Files

          Comment


          • #20
            Thank you Chris,

            I will try after market closes.
            Note: You may know if Help file [inside efs editor] was not updated yet to show Shape.PRESET, because this is what got with 8.0 download.

            Thanks again,
            Mihai
            Mihai Buta

            Comment


            • #21
              Chris,

              Here are the results: AboveBar/BelowBar work if the following limitations and restrictions [which I recommend to be made, somehow, public information] are observed:

              1. AboveBar/BelowBar cannot be passed as parameters, not as var [obviously] and not as text [when everything plot as TopRow1].
              In other words, you cannot have something like:
              if Cond1 {AboveBarX} else {BelowBarx}
              You must explicitly have two functions
              if Cond1 {DrawText{BarOffset, AboveBarX, ...}
              else {DrawText(BarIOffset,BelowBarX,...}

              2. Text.PRESET and Shape.PRESET cannot be passed as parameter, as part of a general TxtFlags var. It must be explicitly declared inside the DrawText/DrawShape function.
              But you can ORed it with a var that specifies all other Text.XXXX flags.
              In other words,
              var TxtFlgs = Text.PRESET | Text.XXX | Text.YYY
              drawText(...., TxtFlgs,...}
              will NOT work, but
              var TxtFlgs = Text.XXX | Text.YYY
              drawText(..., Text.Preset | TxtFlgs,...}
              will work.

              3. Row size is not [as I expected] a function of my FontSize, but a constant [probably, 14 pixels or so].

              4. As AboveBar/BelowBar are calculated based on the BarOffset inside the Draw function, you cannot have a Shape and a Text associated with that bar, because they will overlap.

              Note: all these limitations/Restriction could dissapear if AboveBarX/BelowBarX would accept [like close/low/etc] BarOffset as parameter.
              Furthermore, if in draing functions [x] [y] would be allowed to mix bar related info with Ppixels, we would not need so many draing functions.
              For example:
              x = Base [BarOffset] + Delta [in pixels]
              y = Base [high/low, etc] + Delta [in pixels]

              Thank you for providing that example that helped me clarify all these issues. Thank you to everyone else who contributed.

              Mihai
              Mihai Buta

              Comment

              Working...
              X