Login Page - Create Account

Support Board


Date/Time: Fri, 18 Oct 2024 08:29:19 +0000



Post From: sc.GetLineNumberOfSelectedUserDrawnDrawing() works but not for drawing from other chart.

[2024-07-28 15:45:16]
User629079 - Posts: 7
Hello,
(Sierrachart ver 2661, Win10)

I have tested this new (GetSelectedUserDrawnDrawingFromChart) function and it does not work as it supposed to. There are three issues.

1. Very easy issue is that new implemented function throws an exception when there is none drawing selected. Intuitively it should:
case a) when there is any selected drawing then function should return 1 and update the s_UseTool& ChartDrawing
case b) when there is none selected drawing then function should return 0 and NOT update the s_UseTool& ChartDrawing, but in this case unfortunately it throws an exception.
If function cannot find selected drawing then do not throw an exception, just return zero as an indication that there was none selected drawing found.


2. Medium issue is that it automatically changes the position of the drawing in horizontal.
Example: I just want to change ONLY the color of selected drawing to red in chart 1.
and, here is the simple code which do this:
  s_UseTool ChartDrawing;
  if (sc.GetSelectedUserDrawnDrawingFromChart(1, ChartDrawing))
  {
    ChartDrawing.Color = RGB(255, 0, 0);
    sc.UseTool(ChartDrawing);
  }
result:
It changes the selected drawing to color red (which is correct), but unfortunately additionally it moves that drawing to the left by 2hours.
Probably it is an issue related with timezone (this is my guess, maybe I am wrong).
I use only Global timezone in my charts and in my case it is Brussel +2h.
New function GetSelectedUserDrawnDrawingFromChart probably updates s_UseTool& ChartDrawing with SCDateTimeMS BeginDateTime, EndDateTime, ThirdDateTime in UTC timezone instead of ChartNumber's timezone.
If my suspicion is correct, please correct the updating of s_UseTool& ChartDrawing by converting (BeginDateTime, EndDateTime, ThirdDateTime) from UTC timezone to ChartNumber' timezone.



3. Main issue: new function is able to find selected drawings but still ONLY these which belongs to the particular chart. Simple example:
In Chart 1 manually I draw 5 TRIANGLES
In Chart 2 manually I draw 5 RECTANGLES
In Chart 2 I use feature: (Chart Settings -> Chart Drawings -> Copy Chart Drawings From Chart #'s = 1) to copy drawings from Chart 1 to Chart 2
so,
In Chart 1 I see only 5 TRIANGLES
In Chart 2 I see 5 RECTANGLES and additional 5 TRIANGLES which are copied from Chart 1
and now,
case a) If (simply by mouse click) I select TRIANGLE in Chart 1 then the new function GetSelectedUserDrawnDrawingFromChart(1, ChartDrawing) works well. Return 1 and s_UseTool& ChartDrawing is updated with selected TRIANGLE's data.
case b) If (simply by mouse click) I select RECTANGLE in Chart 2 then the new function GetSelectedUserDrawnDrawingFromChart(2, ChartDrawing) works well. Return 1 and s_UseTool& ChartDrawing is updated with selected RECTANGLE's data.
case c) If (simply by mouse click) I select TRIANGLE in Chart 2 then the new function GetSelectedUserDrawnDrawingFromChart(2, ChartDrawing) does NOT work. It should: Return 1 and s_UseTool& ChartDrawing should be updated with selected TRIANGLE's data.
Date Time Of Last Edit: 2024-07-30 13:45:58