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 Jon17, Today, 04:33 PM
        0 responses
        1 view
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        4 views
        0 likes
        Last Post Javierw.ok  
        Started by timmbbo, Today, 08:59 AM
        2 responses
        10 views
        0 likes
        Last Post bltdavid  
        Started by alifarahani, Today, 09:40 AM
        6 responses
        40 views
        0 likes
        Last Post alifarahani  
        Started by Waxavi, Today, 02:10 AM
        1 response
        19 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Working...
        X