Page 1 of 1

Tchart on a pagecontrol with XP Manifest included

Posted: Wed Jun 27, 2007 10:10 am
by 8443014
Hello, I have a chart on a pagecontrol and the xpman on it.
While the tabsheets of the pagecontrol appear white on XP the TChart still stays in clbtnface. This look bad. Is there a way to avoid this and using the XP look ?

Posted: Wed Jun 27, 2007 10:30 am
by narcis
Hi Thomas,

Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.

Posted: Wed Jun 27, 2007 11:22 am
by 8443014
I upladed the sample project on your upload page. Please make sure that you test it on Windows XP.
Please notice, that you have a personal message.

Posted: Wed Jun 27, 2007 1:05 pm
by narcis
Hello,

Thanks for the example project but I'm not able to reproduce what you report here. Using the project you sent the form, tabcontrol and chart are all in the same colour (default colour). Could you please check the project you sent? Should I do any special step to reproduce the issue here?

Thanks in advance.

Posted: Thu Jun 28, 2007 6:06 am
by 9241760
Hello,
the project is ok. Please make sure that you have a Windows XP system with Luna activated (ricght mousebutton on desktop, properties, design =Windows XP).
I also send you a screen shot of the programm on a clear XP system.
If you recompile my demo, make sure that you use Delphi 2006

Posted: Thu Jun 28, 2007 6:11 am
by 9349911
Hi Frank & Narcís,

I use XPman, too. And on my XP system is Luna activated. If I use XPMan in a project all things around TChart have the new style except TChart ...

@Narcís:
If you use my time Axis demo and put on a XPMan component you can see it, too. (My setup here D7 pro, XP with Luna).

Posted: Thu Jun 28, 2007 11:44 am
by narcis
Hi Frank,

Thanks for the information. I've been able to reproduce the issue here and a solution is making the chart transparent by setting its color to clNone:

Code: Select all

   Chart1.Color:=clNone;

Posted: Thu Jun 28, 2007 12:28 pm
by 9241760
Hi Narcís,
if I use color:=clnone; then the Chart appear white. Even on a windows 2000 OS. This is not what I want. If the user choose a XP theme with e.g. blue notebooks the chart background should appear blue. I guess the chart shoul look for the parent color.

Posted: Thu Jun 28, 2007 2:16 pm
by narcis
Hi Frank,

Thanks for the information but the problem seems to be at TPanel. TChart inherits from TPanel component and it doesn't work with XPman either as reported in Quality Central issues below:

http://qc.borland.com/wc/qcmain.aspx?d=2534
http://qc.borland.com/wc/qcmain.aspx?d=6795

Anyway, we haven't been able to get them working with your example application and a TPanel in BDS 2006. Can you please try if suggestions here work fine at your end?

Posted: Thu Jun 28, 2007 3:05 pm
by narcis
Hi Frank,

Following up to this issue, another option is making the chart transparent modifying your example like this:

Code: Select all

unit Unit12;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, TeeProcs, TeEngine, Chart, ComCtrls, XPMan, TeeComma,
  StdCtrls;

type
  TForm12 = class(TForm)
    PageControl1: TPageControl;
    TabSheet1: TTabSheet;
    TabSheet2: TTabSheet;
    XPManifest1: TXPManifest;
    Chart1: TChart;
    procedure FormCreate(Sender: TObject);
    procedure Chart1BeforeDrawChart(Sender: TObject);
  private
    { Private-Deklarationen }
    Back : TBitmap;
  public
    { Public-Deklarationen }
  end;

var
  Form12: TForm12;

implementation

{$R *.dfm}


procedure TForm12.Chart1BeforeDrawChart(Sender: TObject);
var rr: TRect;
begin
  if not Assigned(Back) then
  begin
    Back:=TBitmap.Create;
    Back.Width:=Chart1.Width;
    Back.Height:=Chart1.Height;
    rr := Chart1.BoundsRect;
    rr.Top:= rr.Top + 50;
    Back.Canvas.CopyRect(Chart1.ClientRect,Canvas,rr);
  end;

  if Chart1.Color=clNone then
     Chart1.Canvas.Draw(0,0,Back);
end;

procedure TForm12.FormCreate(Sender: TObject);
begin
  Chart1.Color:=clNone;
end;

end.

Posted: Fri Jun 29, 2007 4:46 am
by 9241760
Hi Narcís,
perfect. This one works fine for me.
Regards Frank Kneffel