home *** CD-ROM | disk | FTP | other *** search
- unit Series_TextSource;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- Base, StdCtrls, TeEngine, Series, TeeURL, ExtCtrls, TeeProcs, Chart;
-
- type
- TSeriesTextSourceForm = class(TBaseForm)
- SeriesTextSource1: TSeriesTextSource;
- Series1: TBarSeries;
- Memo2: TMemo;
- Button1: TButton;
- Button2: TButton;
- Edit1: TEdit;
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- Procedure UpdateMemo;
- end;
-
- implementation
-
- {$R *.DFM}
-
- Uses TeeStore, TeeConst;
-
- procedure TSeriesTextSourceForm.Button1Click(Sender: TObject);
- begin
- Series1.Clear;
- SeriesTextSource1.LoadFromStrings(Memo2.Lines);
- end;
-
- procedure TSeriesTextSourceForm.Button2Click(Sender: TObject);
- begin
- Series1.Clear;
- Screen.Cursor:=crHourGlass;
- try
- With SeriesTextSource1 do
- begin
- { get points from the web... }
- LoadFromURL(Edit1.Text);
-
- { now set the SeriesTextSource properties }
- { to match the retrieved file... }
- HeaderLines:=0;
- FieldSeparator:=#9; { tab }
- Fields.Clear;
- AddField(TeeMsg_Text,1);
- AddField('X',2);
- AddField('Bar',3);
- end;
- { change the Memo contents with the Web file }
- UpdateMemo;
- finally
- Screen.Cursor:=crDefault;
- end;
- end;
-
- Procedure TSeriesTextSourceForm.UpdateMemo;
- begin
- { TSeriesDataText object is used to export Series }
- { values to Text }
- With TSeriesDataText.Create(Chart1,Series1) do
- try
- Memo2.Lines.Text:=AsString;
- finally
- Free;
- end;
- end;
-
- initialization
- RegisterClass(TSeriesTextSourceForm);
- end.
-