Support Board
Date/Time: Sun, 25 Oct 2026 03:43:47 +0000
Post From: v2960 Cannot set Horizontal Ray TextColor from s_UseTool
| [2026-09-29 14:14:20] |
| User719512 - Posts: 513 |
|
Here is an even better repro. Log ... | Created 1 * ... | chartDrawing1.TextColor 0x00FFFFFF, should be 0x0000FF00 (and it's probably 0x00FFFFFF) * ... | chartDrawing2.TextColor 0x0000FF00, should be 0x0000FF00 * Code SCSFExport scsf_DrawingTest(SCStudyInterfaceRef sc) { int& r_Created = sc.GetPersistentIntFast(0); if (sc.SetDefaults) { return; } if (sc.Index == 0) { r_Created = 0; } if (!r_Created) { ++r_Created; const int beginIndex = sc.ArraySize - 10; s_UseTool newRay; newRay.ChartNumber = sc.ChartNumber; newRay.DrawingType = DRAWING_HORIZONTAL_RAY; newRay.LineNumber = 1; newRay.AddMethod = UTAM_ADD_OR_ADJUST; newRay.Region = 0; newRay.BeginIndex = beginIndex; newRay.BeginValue = sc.Close[beginIndex]; newRay.Color = RGB(255, 0, 0); newRay.LineWidth = 1; newRay.Text = "TextColor probe"; newRay.TextColor = RGB(0, 255, 0); newRay.FontSize = 12; newRay.TransparentLabelBackground = 1; sc.UseTool(newRay); SCString msg; msg.Format("Created %d", newRay.LineNumber); sc.AddMessageToLog(msg, 1); s_UseTool chartDrawing1; const int found1 = sc.GetACSDrawingByLineNumber( sc.ChartNumber, 1, chartDrawing1 ); msg.Format("chartDrawing1.TextColor 0x%08X, should be 0x%08X (and it's probably 0x%08X)", chartDrawing1.TextColor, RGB(0, 255, 0), ~s_UseTool::DEFAULT_COLOR_VALUE ); sc.AddMessageToLog(msg, 1); // hack, get it, set color again chartDrawing1.TextColor = RGB(0, 255, 0); sc.UseTool(chartDrawing1); s_UseTool chartDrawing2; const int found2 = sc.GetACSDrawingByLineNumber( sc.ChartNumber, 1, chartDrawing2 ); msg.Format("chartDrawing2.TextColor 0x%08X, should be 0x%08X", chartDrawing2.TextColor, RGB(0, 255, 0) ); sc.AddMessageToLog(msg, 1); } } |
