?? unit1.pas
字號:
unit Unit1;
// (C) 2005 MYTHcode.org
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ToolWin, SubUtils,CSSParser;
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: TCSSParser;
ParentNode: TTreeNode;
s:integer;
begin
if OpenDialog1.Execute then
begin
Parser:=TCSSParser.Create(File_(OpenDialog1.FileName));
try
ParentNode:=nil;
with Parser, TreeView1.Items do
while Next do
case ItemType of
itHead: ParentNode:=AddChild(nil, Parser.Item);
itSimple, itLast: AddChild(ParentNode, Parser.Item);
itComment: AddChild(ParentNode, '//'+Parser.Item);
end;
finally
Parser.Free;
end;
end;
end;
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -