Login Page - Create Account

Support Board


Date/Time: Wed, 15 Jan 2025 16:23:29 +0000



Post From: ACSIL Drawings cannot be selected/moved in 1590

[2017-07-28 17:10:39]
onnb - Posts: 662
Your example works - I can select the line.

Using the code below I cannot select the line.


SCSFExport scsf_DrawingToolTest(SCStudyInterfaceRef sc)

{

  // Set configuration variables

  if (sc.SetDefaults)

  {
    sc.GraphName = "Drawing Tool Test";
    sc.GraphRegion = 0;
    sc.FreeDLL = 1;
    sc.AutoLoop = 0;

    return;

  }

  s_UseTool Tool;
  Tool.Clear();
  Tool.ChartNumber = sc.ChartNumber;
  Tool.AddAsUserDrawnDrawing = 1;

  Tool.DrawingType = DRAWING_HORIZONTALLINE;
  int &LineNumber = sc.GetPersistentInt(2);

  if (LineNumber != 0)
    Tool.LineNumber = LineNumber;

  int BarIndex = sc.ArraySize - 10;
  Tool.BeginValue = sc.Low[BarIndex];
  Tool.Region = sc.GraphRegion;
  Tool.Color = RGB(0, 0, 255);
  Tool.AddMethod = UTAM_ADD_OR_ADJUST;
  sc.UseTool(Tool); // Here we make the function call to add the line

  LineNumber = Tool.LineNumber;//Remember line number which has been automatically set
  s_UseTool ChartDrawing;

  sc.GetUserDrawingByLineNumber(sc.ChartNumber, LineNumber, ChartDrawing);
}