?? unit1.pas
字號:
unit Unit1;
// (C) 2005 MYTHcode.org
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ToolWin, SubUtils, XMLParser;
type
TForm1 = class(TForm)
ToolBar1: TToolBar;
ToolButton1: TToolButton;
OpenDialog1: TOpenDialog;
TreeView1: TTreeView;
procedure ToolButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ToolButton1Click(Sender: TObject);
var
Parser: TXMLParser;
ParentNode: TTreeNode;
begin
if OpenDialog1.Execute then
begin
Parser:=TXMLParser.Create(File_(OpenDialog1.FileName));
try
ParentNode:=nil;
with Parser, TreeView1.Items do
while Next do
case TagType of
ttBeginTag: ParentNode:=AddChild(ParentNode, StepCode);
ttEndTag: if ParentNode<>nil then ParentNode:=ParentNode.Parent;
else AddChild(ParentNode, StepCode);
end;
finally
Parser.Free;
end;
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -