PDA

View Full Version : Bugs with DrawTextFixed and saving templates with configurable fonts


Wizard
12-04-2007, 11:17 AM
Hi, I encountered 2 problems (bugs) while using 6.5 beta 4:

Bug #1: DrawTextFixed does not honor alpha values intended to make the background of the text box that it draws somewhat transparent so that we can still somewhat see the chart behind it.

Bug #2: Having a configurable font as part of an indicator makes it impossible to save a chart template that includes the indicator. I get a pop-up that says "NinjaTrader has detected a problem and needs to shut down." It took me a while to isolate the reason that this was happening.

Attached is some code that illustrates these bugs. I hope that you guys can correct these soon.

Thanks!

NinjaTrader_Ray
12-04-2007, 11:23 AM
Thanks, this post has been referred to development for further review.

Wizard
12-04-2007, 01:49 PM
On a related note: Drawing objects on the chart, such as text and arrows, are drawn on top of the DrawTextFixed box, while price bars are drawn below it. It would be better and more consistent if the DrawTextFixed box was drawn on top of both the price bars and the chart's drawing objects.

NinjaTrader_Christian
12-05-2007, 03:29 AM
Hi Wizard !

First, many thanks for the most helpful way to point us to the error(s) !

1) Problem on save workspace:
The crash is a bug and will be fixed in the next beta.

It is not possible to serialize a Font, a Pen or a Color property. Instead, you have to add a [XmlIgnore()] to your Font property, and add a additional property, which saves the Font.

So it have to look like:

[Description("Font used for report text.")]
[XmlIgnore()]
[Category("Parameters")]
[Gui.Design.DisplayNameAttribute("Report Font")]
public Font ReportFont
{
get { return ReportFont_; }
set { ReportFont_ = value; }
}

/// <summary>
/// </summary>
[Browsable(false)]
public string ReportFontSerialize
{
get { return Gui.Design.SerializableFont.ToString(ReportFont_); }
set { ReportFont_ = Gui.Design.SerializableFont.FromString(value); }
}

2) Alpha value of DrawTextFixed: Please try a value between 1 and 9, as stated in the documentation:
http://www.ninjatrader-support.com/HelpGuideV6/DrawText.html

3) Drawing DrawTextFixed on top of objects: We added this to our list for further development.

Thanks again for reporting,
Christian

NinjaTrader_Christian
12-12-2007, 08:57 AM
3) Drawing DrawTextFixed on top of objects: Will be available in the next NT6.5 beta.