Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw.Text(...) hung NT

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

    Draw.Text(...) hung NT

    My indicator allows the user to choose the color Draw.Text will use for the text. Works fine -- you choose "Magneta" and you get Magenta text. I noticed the first entry in the color chooser is "Gradient Brush" so, on a whim, I chose that. I was curious to see what the result of drawing text with a gradient brush would be.

    The result was that NT completely hung. Windows soon put up its dialog saying the process was unresponsive. I chose to let it continue a while longer, but it never came back so I had to eventually kill it.

    Sounds like a bug to me. If Gradient Brush is going to kill Draw.Text, it had better check for that. As a side note: should "Gradient Brush" really be in the color chooser to begin with?

    --EV

    #2
    Hello,

    Thank you for the note.

    Can you provide the syntax for the property you are using for the user selection?

    I would suspect this is caused by a different type being passed to the Draw statement than it is expecting so I would like to test using the same code you are to confirm this.

    If there is a problem I can submit a bug report on the item after I have confirmed the reason for the error.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello,

      Thank you for the note.

      Can you provide the syntax for the property you are using for the user selection?

      I would suspect this is caused by a different type being passed to the Draw statement than it is expecting so I would like to test using the same code you are to confirm this.

      If there is a problem I can submit a bug report on the item after I have confirmed the reason for the error.

      I look forward to being of further assistance.
      Here is the property
      Code:
              private Brush barNumberBrush = Brushes.DarkGray;
              [DefaultValue("DarkGray")]
              [XmlIgnore]                                     // DO not serialize directly -- use the serializer for that
              [Browsable(debugBrowsable)]                        // Do show in the indicator property dialog
              [Display(Order = chartDataBase + 6, Name = "Bar number color", GroupName = dataDisplayCategory, ResourceType = typeof(Custom.Resource),
                  Description = "Bar numbers will be drawn on the chart using this color.")]
              public Brush BarNumberBrush
              {
                  get
                  {
                      return barNumberBrush;
                  }
                  set
                  {
                      barNumberBrush = value;
                  }
              }
      
              // Necessary; to serialize the BarNumberBrushproperty
              [Browsable(false)]
              public string BarNumberBrushSerialize
              {
                  get { return Serialize.BrushToString(BarNumberBrush); }
                  set { BarNumberBrush = Serialize.StringToBrush(value); }
              }
      Here is the Draw code
      Code:
                          Draw.Text(this, "BarNumber" + CurrentBar, true, CurrentBar.ToString(), 0, BarsArray[0].GetLow(CurrentBar), -5,
                                      BarNumberBrush, new SimpleFont("Arial", 12), TextAlignment.Center, Brushes.Transparent, Brushes.Transparent, 0);
      --EV

      Comment


        #4
        ETF,

        Again sorry for the delay thank you for the patience.

        Any 'custom' brush created by the skin will show up at the top of the list and is expected.

        Gradient Brush is technically possible, however in Beta 5 we resolved several issues in regards to Draw.Text(). I just tested your scenario and works here with B5.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by WHICKED, Today, 12:45 PM
        2 responses
        16 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Started by GussJ, 03-04-2020, 03:11 PM
        15 responses
        3,271 views
        0 likes
        Last Post xiinteractive  
        Started by Tim-c, Today, 02:10 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Taddypole, Today, 02:47 PM
        0 responses
        2 views
        0 likes
        Last Post Taddypole  
        Started by chbruno, 04-24-2024, 04:10 PM
        4 responses
        51 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Working...
        X