Page 1 of 1

clwindowtext error

Posted: Fri Mar 14, 2014 9:17 pm
by 16464432
Hello,

I am using your latest version of TChartPro with Embarcadero Delphi XE5.

I would like to report what I believe is an error in your latest release. There are a couple of instances where I set my chart fonts (title, axis titles, etc) to clwindowtext but the chart that is created does not use what I have set as my clwindowtext (black) but is instead some grey/green color. I think this is an error with how you are accessing clwindowtext and other cl* colors for two reasons...

One, when I use clwindowtext in other places in my Delphi code unrelated to any steema tcharts, I am obtaining the appropriate color.

Two, in my program I am able to read in old steema tchart objects that I saved to binary files; with previous version of TeeChart, when I have done this everything looks fine, but in the latest version the color being read back in is not clwindowtext but white.

If this is instead an error on my part, I would very much appreciate it if you could point me in the right direction for correcting this error.

Thanks!
SDE

Re: clwindowtext error

Posted: Mon Mar 17, 2014 2:20 pm
by yeray
Hello SDE,

I've added it to the bug list:
http://bugs.teechart.net/show_bug.cgi?id=641
Don't hesitate to add your mail account to the CC list so you can be automatically notified when an update arrives.

Re: clwindowtext error

Posted: Tue Mar 18, 2014 4:09 pm
by 16464432
Hi Yeray,

Thanks for submitting the bug! I see from the history of bug 641, this is as designed and will not be fixed. The workaround "Font.Color:=ColorToRGB(clwindowtext);" does work well. However, clwindowtext is the default font color for the TFont type and so this means having to remember to add that line every time you have the code "Font.Create;". Is there any chance you would be willing to change your default font color for TFont to clblack or to add the ColorToRGB code to your Font.Create routine?

On a second note, I noticed you only had the issue for GDI+ and not GDI and that it is not supposed to be an issue for GDI. I am using GDI and was having the problem. I have removed all mention of GDI+ from my .pas and .dfm files and in my Delphi Options under Third Party TeeChart have the rendering set to GDI on chart gallery and new chart. Do you know of anywhere else I need to have GDI set? Because the rendering does look like GDI. I didn't like GDI+ and switched back to GDI...but my clwindowtext is not working which leads me to believe I might not be using GDI fully. Is that possible?

Thanks!
SDE

Re: clwindowtext error

Posted: Wed Mar 19, 2014 2:28 pm
by yeray
Hi SDE,

We're studying this and we'll be back to you here asap.

Re: clwindowtext error

Posted: Wed Mar 19, 2014 4:51 pm
by yeray
Hi SDE,
SDE wrote: However, clwindowtext is the default font color for the TFont type and so this means having to remember to add that line every time you have the code "Font.Create;". Is there any chance you would be willing to change your default font color for TFont to clblack or to add the ColorToRGB code to your Font.Create routine?
We are already initializing the font color to clBlack at TTeeFont.Create. Maybe you are using an old version that has saved the clwindowtext colors in the dfms.
Or maybe there's something else we are missing here. In that case, could you please arrange a simple example project we can run as-is to reproduce the problem here? Thanks in advance.
SDE wrote:On a second note, I noticed you only had the issue for GDI+ and not GDI and that it is not supposed to be an issue for GDI. I am using GDI and was having the problem. I have removed all mention of GDI+ from my .pas and .dfm files and in my Delphi Options under Third Party TeeChart have the rendering set to GDI on chart gallery and new chart. Do you know of anywhere else I need to have GDI set? Because the rendering does look like GDI. I didn't like GDI+ and switched back to GDI...but my clwindowtext is not working which leads me to believe I might not be using GDI fully. Is that possible?
That's strange. The settings you have modified should be enough to fully use GDI. A simple example project may also help us to reproduce the situation here.

Note with GDI this problem doesn't happen (or shouldn't, and doesn't for us) because GDI only uses the last 3 bytes (RGB) in the color. The 4th byte (Alpha) is ignored.

Code: Select all

clWindowText = $FF000008
GDI sees it as 00,00,08 while GDI+ sees it as FF,00,00,08
FF total transparency. That's why GDI+ shows nothing.

Re: clwindowtext error

Posted: Thu Mar 20, 2014 3:00 pm
by 16464432
Hi Yeray,

That is very odd. Unfortunately, the software I'm writing is pretty complex and large and is also on a separate, secure network. A sample project probably wouldn't capture what's happening in my program, and it's not possible for me to share the actual code here. The clwindowtext itself isn't really a big deal. But I do feel like there's something off with our rendering. We just recently released an alpha version of our software to our users and the charts they are creating look different for different users. Some have the thicker lines indicative of the GDI+ while others (myself included) have the old, crisper GDI look. I'll go beat on this some more.

Thanks for all of your help with this!
SDE