Login Page - Create Account

Support Board


Date/Time: Thu, 26 Dec 2024 12:52:40 +0000



Post From: Deleting all user drawn text drawings upon removing study

[2015-12-03 06:10:39]
KhaosTrader - Posts: 128
Hi,

Thank you for your help, I will answer the two points:

1) I have the function that changes the text drawing color/hide the drawing.. If I dont make it a user drawn drawing, it doesn't work.

This is because I use the GetUserDrawingByLineNumber, where drawings need to be userdrawings.. if there is another method of retrieving the drawing by linenumber, without using a fuction that requires the drawing to be a userdrawing, please let me know...



bool ChangeTextDrawingColor(SCStudyGraphRef& sc, s_UseTool& Tool_TextWriter, int NumberText, bool HideAddonTextLabels)


{
Tool_TextWriter.AddMethod = UTAM_ADD_OR_ADJUST;
sc.GetUserDrawingByLineNumber(sc.ChartNumber, NumberText, Tool_TextWriter, DRAWING_TEXT, 0);
Tool_TextWriter.TransparentLabelBackground = 1;
if (HideAddonTextLabels == true)
{
  Tool_TextWriter.Text = "";

}
{
  Tool_TextWriter.TextColor = RGB(88, 88, 88);

}
Tool_TextWriter.TextColor = RGB(88,88,88);
sc.UseTool(Tool_TextWriter);

return true;
}


2. I need to keep track of these drawing line numbers to access them. I have more than one drawing per bar, hence I need to create a variable to hold them. I do this by creating a persistent integer and then use the following code




Tool_TextWriter.ChartNumber = ++SC_TOOL_UniqueID;