Login Page - Create Account

Support Board


Date/Time: Sun, 22 Dec 2024 08:59:00 +0000



Post From: drawing in fill space questions

[2015-04-02 21:08:25]
onnb - Posts: 662
Below is the smallest code I can do that reproduces it on my end.
When add the study below, lock the fill space and scroll the chart to the left, the blue line covers the text that says "hi".


SCSFExport scsf_strategy_alerts_test(SCStudyGraphRef sc)
{

  int& line_number = sc.PersistVars->i1;
  int& text_number = sc.PersistVars->i2;

  if (sc.SetDefaults)
  {
    sc.GraphName = "test";
    sc.StudyDescription = "";
    sc.AutoLoop = 1; // true
    sc.GraphRegion = 0;
    sc.FreeDLL = 1;

    return;
  }

  if (sc.Index == 0)
  {

    // draw line
    s_UseTool tool;

    tool.ChartNumber = sc.ChartNumber;
    tool.DrawingType = DRAWING_LINE;

    tool.BeginValue = sc.BaseData[SC_LAST][sc.ArraySize - 1];
    tool.EndValue = sc.BaseData[SC_LAST][sc.ArraySize - 1];

    tool.BeginIndex = 0;
    tool.EndIndex = sc.ArraySize - 1;

    tool.Color = COLOR_BLUE;
    tool.LineWidth = 3;
    tool.LineStyle = LINESTYLE_SOLID;
    tool.AddMethod = UTAM_ADD_OR_ADJUST;

    sc.UseTool(tool);
    line_number = tool.LineNumber;

    // draw text
    tool.Clear();
    tool.ChartNumber = sc.ChartNumber;
    tool.Region = 0;
    tool.DrawingType = DRAWING_TEXT;
    tool.Text = "hi";
    tool.TextAlignment = DT_LEFT | DT_VCENTER;
    tool.AddMethod = UTAM_ADD_OR_ADJUST;
    tool.BeginDateTime = -2;
    tool.BeginValue = sc.BaseData[SC_LAST][sc.ArraySize - 1];
    tool.FontSize = 12;
    tool.FontBold = 1;
    tool.FontFace = "Ariel";
    tool.Color = COLOR_BLUE;
    tool.AddAsUserDrawnDrawing = 0;
    sc.UseTool(tool);

    text_number = tool.LineNumber;
  }


  // update
  
  if (sc.Index == sc.ArraySize - 2)
  {
    s_UseTool tool;
    tool.LineNumber = line_number;
    tool.EndIndex = sc.ArraySize - 1;
    tool.AddMethod = UTAM_ADD_OR_ADJUST;
    sc.UseTool(tool);
  }
}

Date Time Of Last Edit: 2015-04-02 21:08:50