Page 1 of 1

Suppression of Format Tabs in Run-Time Chart Editor

Posted: Fri Mar 11, 2005 6:07 pm
by 8573615
Note: TeeChart 6 w/Delphi 7

I've been having problems getting the format tab(s) to show up in the run time chart editor for certain series (e.g., Point3D). Adding TeeEditPRO has had no effect.

I remember in older versions of TeeChart, there were problems where using certain Delphi units would suppress chart options (e.g., I believe QDialogs used to be a problem). As a test, I created a new application and added all of the units one by one, checking each time to see when I had access to the format tabs and when I did not.

It turns out that 4 of my units are causing the problem. If any of these 4 units is declared in the uses clause, the format tabs are suppressed. If all 4 are eliminated, the format tabs appear. These 4 units have nothing obvious in common and nothing obvious which would cause this. Does anyone have any idea what sort of things I might be declaring or doing within these units that is suppressing the format tabs?

I can't simply eliminate these from the uses clause, yet access to the format tabs is important if I TChart is actually to be a useful platform.

Posted: Mon Mar 14, 2005 10:29 am
by narcis
Hi MSRosenberg,

So that we can reproduce the reported problem here, would you be so kind to tell us which units are the 4 problematic ones and which format tabs are not visible when using those units?

Thanks in advance.

Posted: Mon Mar 14, 2005 6:08 pm
by 8573615
I'm sorry, perhaps I wasn't clear. The four problematic units are ones which I created. The problem is as follows. As a test, I created an application which only has a TChart and a TChartEditor on it. The chart contains a single Point3D series. Clicking on the chart brings up the editor. TeeEditPro is included in the uses clause. I then declared about two dozen units from Delphi and my primary program in the uses clause. When four of these units (PasMain, PasDefs, PasOutput, and PasDataFunctions) are declared the "Format" and "Point" tabs do not appear under the "Series" tab during runtime. Any one of these units will cause this problem. If all four units are left out of the uses clause, the Format and Point tabs appear normally. The order and placmenet (implementation vs interface) of these units and TeeEditPRO have no effect.

The other units, all similarly named (e.g., PasMath, PasImportMap, PasDefs), do not cause this problem. Unfortunately, I cannot simply send you these 4 units to debug, becuase they all use other units across the project; I'd have to provide essentially the entire project. Looking at the code in TeeEditPRO and TeePo3DEdit, I see nothing that appears to conflict (no identically named functions, procedures, or variables).

I've been using TChart since version 4, and recall other problems similar to this in the past. In Nov/Dec 2002 I reported (and had it later confirmed by Steema support) that declaring the QDialogs unit would suppress the Format tab for even a simple point series. Given my experience, I'm surprised others haven't encountered this problem.

I've also gone through each of the 4 problem units and cannot see anything that should conflict with TeeChartEditors registration of the Point3D edit tabs. Of course, I admit that I don't completely understand how this works (and thus how I could accidentally suppress it). In case it helps, following is the interface section of PasOutput. It is one of the least complicated of the problem units:

Code: Select all

unit PasOutput;

interface

uses
  Windows, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
  ComCtrls;

type
  TpasOutPrompt = (fpAppend,fpReplace,fpPrompt);
  TpasOutStyle = (osRTF,osTXT);

  TOutputForm = class(TForm)
    OutMemo: TRichEdit;
    SaveDialog: TSaveDialog;
    FontDialog: TFontDialog;
    PrintDialog: TPrintDialog;
    procedure FormCreate(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    { Private declarations }
    function DashLine(cnt : integer) : string;
  public
    { Public declarations }
    DoLog,DoScreen : boolean;
    LogFile : TextFile;
    LogName : string;
    DefFont : TFont;
    function StartLog(filen : string; FilePerm : TpasOutPrompt) : boolean;
    procedure StopLog;
    procedure AddLine(outstr : string);
    procedure AddBlankLine;
    procedure AddBoldLine(instr : string);
    procedure AddUnderLine(instr : string);
    procedure AddItalLine(instr : string);
    procedure AddBatchLine(instr : string);
    procedure AddBoldItalLine(instr : string);
    procedure AddBoldUnderLine(instr : string);
    procedure RunSave;
    procedure SaveOutput(filen : string; FilePerm : TpasOutPrompt; SaveType : TpasOutStyle);
    procedure PrintOutput;
    procedure PrintOutputDialog;
    procedure RunFontDialog;
  end;

var
  OutputForm: TOutputForm;

P.S.--As an addendum, I tried downloading the trial version of TeeChart v7 and the problem persists there, so it is not simply a probelm with v6.

Posted: Mon Mar 14, 2005 10:42 pm
by 8573615
I found the problem...it is the same problem I reported over two years ago but apparently has still not been fixed. The units I was using used other units which used other units, etc, etc, until eventually, somewhere in my project, was a unit which used QDialogs.

For some reason QDialogs is incompatible with TeeChart (or at least parts of TChart).

Simple steps for proof:

1) Create a new application.
2) Add a chart, a button, and a TChartEditor component
3) Create code to run editor when the button is pressed
4) Add a point series or 3d point series to the chart.
5) Run. Note that when the button is pressed you have access to a "Format" tab under the Series Tab. This allows you to control the size, shape, color, etc. of the points.
6) Add "uses QDialogs;" to the implementation (or the interface)
7) Run. Note that the "Format" tab is no longer available.

This whole thing infuriates me a bit, because I reported this bug over two years ago, but it has clearly never been addressed. QDialogs is not the most essential unit, but there is no good reason to have a basic, persistent incompatibility with Delphi code.

Here is the entire test code:

Code: Select all

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, TeeEdit, TeEngine, Series, StdCtrls, ExtCtrls, TeeProcs, Chart;

type
  TForm1 = class(TForm)
    Chart1: TChart;
    Button1: TButton;
    Series1: TPointSeries;
    ChartEditor1: TChartEditor;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

uses QDialogs;

procedure TForm1.Button1Click(Sender: TObject);
begin
     ChartEditor1.Execute;
end;

end.