Custom colours (windows default).

TeeChart for ActiveX, COM and ASP
Post Reply
TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Custom colours (windows default).

Post by TonyVSUK » Tue Apr 07, 2009 9:22 am

Hello,

I would like to be able to define the custom colours as listed in the standard windows colour picker dialog.

Image

In windows it is fairly easily to set these

COLORREF* ccolor = GetSavedCustomColors();
for (int i=0; i < 16; i++)
{
GetRValue(ccolor);
GetGValue(ccolor);
GetBValue(ccolor);
}

Is there any way to set these in TChart? On loading my app, I read previously stored colours from the registry and apply them, but the TChart colour picker has 16 black entries instead of the default windows ones.

Many thanks,

Tony.

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Wed Apr 08, 2009 7:43 am

Hi TonyVSUK,

If we understand well you have custom colors in an array or somewhere and you want to use them to change a series color (or pointer, line,... etc). If so, have you tried the RGB function? Could you please take a look at this topic where there is an example?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Post by TonyVSUK » Wed Apr 08, 2009 8:02 am

No, that is not what I want to do.

If you access the properties for a chart, select the "Panel" tab, select "Background" tab, and now click "Color". This brings up the standard windows CColorDialog window, the custom colours here can be retrieved/defined using

COLORREF* ccolor = CColorDialog::GetSavedCustomColors();
for (int i=0; i < 16; i++)
{
//to get the colours
GetRValue(ccolor);
GetGValue(ccolor);
GetBValue(ccolor);

//to set the colours
ccolor = RGB(rCol,gCol,bCol);
}

I have some GUI development software, and elsewhere the user can define their own custom colours (I save them on a project by project basis). Ideally I could set them for the TChart elements as well so a user has a fixed set of custom colours available across the whole project they are working on.

I hope this makes sense.

Tony.

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Wed Apr 08, 2009 1:44 pm

Hi Tony,

I understand that you would like to add your custom color to the "custom colors list" of the color dialog. I've added it to the wish list to be implemented in further releases because I'm afraid it's not possible right now (TV52014070).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Post by TonyVSUK » Wed Apr 08, 2009 1:46 pm

ok, thanks.

Tony.

Post Reply