8
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
9
EditBtn, ExtCtrls, ComCtrls, ShellCtrls;
13
{ TformCorelExplorer }
15
TformCorelExplorer = class(TForm)
20
labelFilename: TLabel;
21
shellInput: TShellTreeView;
22
procedure buttonQuitClick(Sender: TObject);
23
procedure shellInputSelectionChanged(Sender: TObject);
25
{ private declarations }
26
function CheckInput(): Boolean;
28
{ public declarations }
32
formCorelExplorer: TformCorelExplorer;
37
fpvectorial, cdrvectorialreader, svgvectorialwriter, //pdfvectorialreader,
42
{ TformCorelExplorer }
44
procedure TformCorelExplorer.buttonQuitClick(Sender: TObject);
49
procedure TformCorelExplorer.shellInputSelectionChanged(Sender: TObject);
51
Vec: TvVectorialDocument;
52
Reader: TvCDRVectorialReader;
53
lFormat: TvVectorialFormat;
54
lChunk, lCurChunk: TCDRChunk;
57
// First check the in input
58
if not CheckInput() then Exit;
60
// Now read the data from the input file
61
Reader := TvCDRVectorialReader.Create;
63
Reader.ExploreFromFile(shellInput.GetSelectedNodePath(), lChunk);
65
labelFilename.Caption := 'Filename: ' + shellInput.GetSelectedNodePath();
66
if (lChunk.ChildChunks <> nil) and (lChunk.ChildChunks.First <> nil) then
69
lCurChunk := TCDRChunk(lChunk.ChildChunks.First);
70
Str := TCDRChunkVRSN(lCurChunk).VersionStr;
71
labelVersion.Caption := 'Version: ' + Str;
74
lCurChunk := TCDRChunk(lChunk.ChildChunks.Items[1]);
75
//labelSize.Caption := 'Size: ' + ;
82
function TformCorelExplorer.CheckInput(): Boolean;
86
lPath := shellInput.GetSelectedNodePath();
87
Result := (ExtractFileExt(lPath) = STR_CORELDRAW_EXTENSION);