2 Problems in new VCL vs old VCL 7.07

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
walter0316
Newbie
Newbie
Posts: 37
Joined: Mon Jul 13, 2015 12:00 am

2 Problems in new VCL vs old VCL 7.07

Post by walter0316 » Wed Jul 29, 2015 1:42 pm

HI, in the old version 7.07 I could run following:

Code: Select all

procedure TForm7.Button3Click(Sender: TObject);
begin
  inherited;

  // Show 3D Gallery:
  with TFormTee3D.CreateChart(Self,Chart1) do
  try
    Align:=alNone;
    BorderStyle:=TeeBorderStyle;  // bsDialog
    Position:=poScreenCenter;
    PageControl1.ActivePage:=TabViews;
    PageControl1Change(PageControl1);
    ResetTab3D:=False;
    ShowModal;
  finally
    Free;
  end;
end;
That is not working anymore. What can I do?

Secondly, I could change the source in the old Library that there is a STyle psInvRainbow.
In the new Lib there is also no Inverse Rainbow Style. How can I add it again?
Could you add this Style-feature to the next update?
Thanks a lot.

Walter

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: 2 Problems in new VCL vs old VCL 7.07

Post by Narcís » Wed Jul 29, 2015 2:22 pm

Hi Walter,
walter0316 wrote: That is not working anymore. What can I do?
That was changed in the earliest v9 (aka v201x) development stage. Now you can do this:

Code: Select all

  // Show 3D Gallery:
  with TFormTee3D.Create(Self) do
  try
    ThePanel:=Chart1;
    Align:=alNone;
    BorderStyle:=TeeBorderStyle;  // bsDialog
    Position:=poScreenCenter;
    PageControl1.ActivePage:=TabViews;
    PageControl1Change(PageControl1);
    ResetTab3D:=False;
    ShowModal;
  finally
    Free;
  end;
walter0316 wrote: Secondly, I could change the source in the old Library that there is a STyle psInvRainbow.
In the new Lib there is also no Inverse Rainbow Style. How can I add it again?
I can not find psInvRainbow in our sources history, the only mention of it I find is from a customer at this forum as a custom palette suggestion. As suggested there you can create as a custom palette.

psRainbow palette being:

Code: Select all

  RainbowPalette:Array[0..24] of TColor=
  (
    $000099,
    $0000C3,
    $0000EE,
    $001AFF,
    $0046FF,
    $0073FF,
    $009FFF,
    $00CBFF,
    $00F7FF,
    $08F4E3,
    $11E7C3,
    $1BDAA3,
    $25CD83,
    $2EC063,
    $38B342,
    $42A622,
    $4B9A02,
    $6A870C,
    $8A751A,
    $AA6328,
    $CB5036,
    $EB3E44,
    $FF2A61,
    $FF1596,
    $FF00CC
  );
and code creating psRainbow below, will probably help you creating it.

Code: Select all

  procedure SetRainbowPalette;

    // Special case, internal Rainbow palette is in VCL format:
    {$IFDEF FMX}
    function InvertColor(const AColor:TColor):TColor;
    begin
      with TRGBA(result) do
      begin
        Red:=TRGBA(AColor).Blue;
        Green:=TRGBA(AColor).Green;
        Blue:=TRGBA(AColor).Red;

        // FMX opacity is inverted from VCL:
        if TRGBA(AColor).Alpha=0 then
           Alpha:=255;
      end;
    end;
    {$ENDIF}

  var t : Integer;
  begin
    if Assigned(ParentChart) then
    begin

      // Wish: Instead of using "Length(RainbowPalette)" here use: NumSteps.
      //
      // ie: Needs to calculate "middle" colors in between
      // if the NumSteps is bigger than 25.
      SetLength(ParentChart.ColorPalette,Length(RainbowPalette));
      for t:=0 to High(RainbowPalette) do
          ParentChart.ColorPalette[t]:={$IFDEF FMX}InvertColor{$ENDIF}(RainbowPalette[t]);

      // Default:
      for t:=0 to NumSteps-1 do
          DoAddPalette(tmpMin+ScaleValue*t,ParentChart.GetDefaultColor(t));

      ParentChart.ColorPalette:=nil; // should be OLD palette !!
    end;
  end;
walter0316 wrote: Could you add this Style-feature to the next update?
I added it to the wish-list (ID1259) to be considered for inclusion in 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
Image Image Image Image Image Image
Instructions - How to post in this forum

walter0316
Newbie
Newbie
Posts: 37
Joined: Mon Jul 13, 2015 12:00 am

Re: 2 Problems in new VCL vs old VCL 7.07

Post by walter0316 » Wed Jul 29, 2015 3:01 pm

Thanks a lot! I will try it tomorrow! :D

walter0316
Newbie
Newbie
Posts: 37
Joined: Mon Jul 13, 2015 12:00 am

Re: 2 Problems in new VCL vs old VCL 7.07

Post by walter0316 » Wed Jul 29, 2015 3:30 pm

if Assigned(ParentChart) then
ParentChart is not known. What I have to do?
thanks

walter0316
Newbie
Newbie
Posts: 37
Joined: Mon Jul 13, 2015 12:00 am

Re: 2 Problems in new VCL vs old VCL 7.07

Post by walter0316 » Wed Jul 29, 2015 3:47 pm

Is it correct, when I define PartenChart as my Chart1?
More Q:

WHen I define a User Palette. WHat must I define for MPISeries.PaletteStyle?

walter0316
Newbie
Newbie
Posts: 37
Joined: Mon Jul 13, 2015 12:00 am

Re: 2 Problems in new VCL vs old VCL 7.07

Post by walter0316 » Wed Jul 29, 2015 3:48 pm

I have doen this:

Code: Select all

  with MPISeries do
    begin
      PaletteSteps := 24;
      //PaletteStyle := psInvRainbow; InvRainbow wäre richtig, doch nicht im neuer Lib
      //PaletteStyle := psRainbow;
      SetINvRainbowPalette(Chart1);
      //StartColor := 8404992;
      StartColor := clGreen;
      UseColorRange := False;
      UsePalette := True;
      UsePaletteMin := True;
      PaletteStep := Lipo9Satz.MPiMAX / 23;
    end;

walter0316
Newbie
Newbie
Posts: 37
Joined: Mon Jul 13, 2015 12:00 am

Re: 2 Problems in new VCL vs old VCL 7.07

Post by walter0316 » Wed Jul 29, 2015 3:55 pm

Hey, I found in the EDIT CHART Window an INVERT BUtton!!! I think I can use this for inverting the Rainbow and then it is defined as user pallete. right?

walter0316
Newbie
Newbie
Posts: 37
Joined: Mon Jul 13, 2015 12:00 am

Re: 2 Problems in new VCL vs old VCL 7.07

Post by walter0316 » Wed Jul 29, 2015 6:55 pm

I get an ACCESS VIALOTION after SHOWMODAL!!
Could you reproduse this? Please help.

Thanks

Code: Select all

procedure TForm7.Button3Click(Sender: TObject);
begin
  //inherited;

  // Show 3D Gallery:
  with TFormTee3D.Create(Self) do
  try
    ThePanel:=Chart1;
    Align:=alNone;
    BorderStyle:=TeeBorderStyle;  // bsDialog
    Position:=poScreenCenter;
    PageControl1.ActivePage:=TabViews;
    PageControl1Change(PageControl1);
    ResetTab3D:=False;
    ShowModal;
  finally
    Free;
  end;
  
(*      problem in new vcl
  
  // Show 3D Gallery:
  with TFormTee3D.CreateChart(Self,Chart1) do
  try
    Align:=alNone;
    BorderStyle:=TeeBorderStyle;  // bsDialog
    Position:=poScreenCenter;
    PageControl1.ActivePage:=TabViews;
    PageControl1Change(PageControl1);
    ResetTab3D:=False;
    ShowModal;
  finally
    Free;
  end;
  *)
end;

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: 2 Problems in new VCL vs old VCL 7.07

Post by Narcís » Thu Jul 30, 2015 7:57 am

walter0316 wrote:Is it correct, when I define PartenChart as my Chart1?
This is at series level, it should be series' ParentChart property, for example:

Code: Select all

Chart1[0].ParentChart
walter0316 wrote:WHen I define a User Palette. WHat must I define for MPISeries.PaletteStyle?
Nothing. You should define your custom palette as in the example here or the example at All Features\Welcome!\Chart Styles\Extended\Contour\Palette and Color range in the new features demo, available at TeeChart's program group.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: 2 Problems in new VCL vs old VCL 7.07

Post by Narcís » Thu Jul 30, 2015 8:01 am

walter0316 wrote:Hey, I found in the EDIT CHART Window an INVERT BUtton!!! I think I can use this for inverting the Rainbow and then it is defined as user pallete. right?
Where did you found that exactly?

Thanks.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: 2 Problems in new VCL vs old VCL 7.07

Post by Narcís » Thu Jul 30, 2015 8:04 am

walter0316 wrote:I get an ACCESS VIALOTION after SHOWMODAL!!
Could you reproduse this?
No, I can't reproduce it. Which Delphi version are you using? Can you please attach a simple example project we can run "as-is" to reproduce the problem here?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

walter0316
Newbie
Newbie
Posts: 37
Joined: Mon Jul 13, 2015 12:00 am

Re: 2 Problems in new VCL vs old VCL 7.07

Post by walter0316 » Thu Jul 30, 2015 8:22 am

You can find the INVERT BUtton on the

Edit Chart by clicking on the chart and then select the Series and then see my attached Screenshoot.
You just have to select Rainbow and then click on INVERT button.
Attachments
paletteinvbutton.gif
paletteinvbutton.gif (18.3 KiB) Viewed 24165 times

walter0316
Newbie
Newbie
Posts: 37
Joined: Mon Jul 13, 2015 12:00 am

Re: 2 Problems in new VCL vs old VCL 7.07

Post by walter0316 » Thu Jul 30, 2015 8:44 am

here I have done a sample with the ACCESS VIOLATION. I use Delphi XE6 with the latest VCL Teechart.
Attachments
bug_ACCESS_VIOLAT.zip
source only, EXE is 5MB to large for uplaod
(56.88 KiB) Downloaded 812 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: 2 Problems in new VCL vs old VCL 7.07

Post by Narcís » Thu Jul 30, 2015 10:01 am

walter0316 wrote: Edit Chart by clicking on the chart and then select the Series and then see my attached Screenshoot.
You just have to select Rainbow and then click on INVERT button.
Excellent! Chart editor is so extensive... :wink:
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: 2 Problems in new VCL vs old VCL 7.07

Post by Narcís » Thu Jul 30, 2015 10:30 am

Hi Walter,
walter0316 wrote:here I have done a sample with the ACCESS VIOLATION. I use Delphi XE6 with the latest VCL Teechart.
Sorry, my bad, I was not choosing any options in the editor. I have added it (Bug #1260) to the bug 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
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply