I added a file steema_shimon.zip to demonstrate my problem.
I need that the grid lines will be only on back and when there is a curosr line on the same line, then the cursor line will get priority and will be before the grid line.
In other words in the Z order : the cursor line should be on top and the grid lines should be lower.
Thanks,
Shimon
How to bring TCursorTool in front of the grid lines
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Shimon,
TCursorTool is already drawn over the axis grid lines. However, when its pen is set to certain colors it produces the effect you mention. You could try using TPenMode:
According to Delphi's documentation:
TPenMode indicates how a pen color interacts with the color of the canvas it is writing on. The following table lists the possible values:
Mode Pixel color
pmBlack Always black
pmWhite Always white
pmNop Unchanged
pmNot Inverse of canvas background color
pmCopy Pen color specified in Color property
pmNotCopy Inverse of pen color
pmMergePenNot Combination of pen color and inverse of canvas background
pmMaskPenNot Combination of colors common to both pen and inverse of canvas background.
pmMergeNotPen Combination of canvas background color and inverse of pen color
pmMaskNotPen Combination of colors common to both canvas background and inverse of pen
pmMerge Combination of pen color and canvas background color
pmNotMerge Inverse of pmMerge: combination of pen color and canvas background color
pmMask Combination of colors common to both pen and canvas background
pmNotMask Inverse of pmMask: combination of colors common to both pen and canvas background
pmXor Combination of colors in either pen or canvas background, but not both
pmNotXor Inverse of pmXor: combination of colors in either pen or canvas background, but not both
You can try if any of this possible values gives you a better result.
TCursorTool is already drawn over the axis grid lines. However, when its pen is set to certain colors it produces the effect you mention. You could try using TPenMode:
Code: Select all
ChartTool1.Pen.Mode:=pmXor;
TPenMode indicates how a pen color interacts with the color of the canvas it is writing on. The following table lists the possible values:
Mode Pixel color
pmBlack Always black
pmWhite Always white
pmNop Unchanged
pmNot Inverse of canvas background color
pmCopy Pen color specified in Color property
pmNotCopy Inverse of pen color
pmMergePenNot Combination of pen color and inverse of canvas background
pmMaskPenNot Combination of colors common to both pen and inverse of canvas background.
pmMergeNotPen Combination of canvas background color and inverse of pen color
pmMaskNotPen Combination of colors common to both canvas background and inverse of pen
pmMerge Combination of pen color and canvas background color
pmNotMerge Inverse of pmMerge: combination of pen color and canvas background color
pmMask Combination of colors common to both pen and canvas background
pmNotMask Inverse of pmMask: combination of colors common to both pen and canvas background
pmXor Combination of colors in either pen or canvas background, but not both
pmNotXor Inverse of pmXor: combination of colors in either pen or canvas background, but not both
You can try if any of this possible values gives you a better result.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
I have tried many modes - e.g.
Cursor.Pen.Color := clRed;
Cursor.Pen.Mode := pmBlack;
I am using TCursorTool which is created dynamically.
I can see that the color setting is done OK but the Mode is ignored and I guess it is always xoring but I want pmCopy.
Even when I tries pmBlack I received a red line...
Cursor.Pen.Color := clRed;
Cursor.Pen.Mode := pmBlack;
I am using TCursorTool which is created dynamically.
I can see that the color setting is done OK but the Mode is ignored and I guess it is always xoring but I want pmCopy.
Even when I tries pmBlack I received a red line...
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Shimon,
Yes, this seems a bug to me and I added it (TV52013671) to the list to be fixed for future releases.
Yes, this seems a bug to me and I added it (TV52013671) to the list to be fixed for future releases.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Shimon,
No, it's the same creating cursor tool at designtime. There's no workaround I can think of for now.
No, it's the same creating cursor tool at designtime. There's no workaround I can think of for now.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Shimon,
You're welcome.
You're welcome.
I'm sorry but I can't provide an estimate date yet.1. When do you think a fix version will be released ?
Yes, you can use annotation tool set to custom position in cursor's OnChange event:2. Another related issue. Can I add some label which attached to the line. I am currently using TAnnotationTool but I need to manage its coordinates manually....
Code: Select all
procedure TForm1.ChartTool1Change(Sender: TCursorTool; x, y: Integer;
const XValue, YValue: Double; Series: TChartSeries; ValueIndex: Integer);
begin
With ChartTool2.Shape do
begin
CustomPosition:=True;
Left:=Chart1.Axes.Bottom.CalcXPosValue(ChartTool1.XValue);
Top:=Chart1.Axes.Left.CalcYPosValue(ChartTool1.YValue);
end;
end;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: How to bring TCursorTool in front of the grid lines
Hi Shimon,
I've been investigating TV52013671 and found that this is by design. The pen mode is set to pmXor when drawing the cursor probably for performance reasons.
I've been investigating TV52013671 and found that this is by design. The pen mode is set to pmXor when drawing the cursor probably for performance reasons.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |