📄 unit1.dfm
字号:
' procedure Button1Click(Sender: TObject);'
' procedure Timer1Timer(Sender: TObject);'
' private'
' { Private declarations }'
' procedure ReadSkinfile( apath : string );'
' procedure Loadskin(aname:string);'
' public'
' { Public declarations }'
' Ep:integer;'
' end;'
''
'var'
' Form1: TForm1;'
' root:string;'
''
'implementation'
''
'uses Unit2;'
''
'{$R *.dfm}'
''
'procedure TForm1.Exit1Click(Sender: TObject);'
'begin'
' close;'
'end;'
''
'procedure TForm1.Button2Click(Sender: TObject);'
'begin'
'// button1.enabled:= not button1.enabled;'
'// sf1.dolog('#39'**************'#39');'
' sd1.active:= not sd1.active;'
' if sd1.active then button4.caption:='#39'Unskin'#39
' else button4.caption:='#39'Skin'#39';'
'end;'
''
'procedure TForm1.ReadSkinfile( apath : string );'
'var'
' sts: Integer ;'
' SR: TSearchRec;'
' list: Tstringlist;'
''
' procedure AddFile;'
' begin'
' list.add(sr.name);'
' end;'
''
'begin'
' list:=Tstringlist.create;'
' sts := FindFirst( apath + '#39'*.skn'#39' , faAnyFile , SR );'
' if sts = 0 then begin'
' if ( SR.Name <> '#39'.'#39' ) and ( SR.Name <> '#39'..'#39' ) then begin'
' if pos('#39'.'#39', SR.Name) <> 0 then'
' Addfile;'
' end;'
' while FindNext( SR ) = 0 do begin'
' if ( SR.Name <> '#39'.'#39' ) and ( SR.Name <> '#39'..'#39' ) then beg' +
'in'
' //Put User Feedback here if desired'
'// Application.ProcessMessages;'
' if Pos('#39'.'#39', SR.Name) <> 0 then Addfile;'
' end;'
' end;'
' end ;'
' FindClose( SR ) ;'
' list.sort;'
' combobox1.items.assign(list);'
' list.free;'
'end;'
''
'procedure TForm1.FormCreate(Sender: TObject);'
'var i,j:integer;'
'begin'
' root:= ExtractFilePath(ParamStr(0));'
' readskinfile('#39'..\..\skins\'#39');'
''
'// load skin file from TSkinStore'
' Sd1.LoadFromCollection(skinstore1,2);'
' Sd2.LoadFromCollection(skinstore1,1);'
' if not sd1.active then sd1.active:=true;'
''
' with stringgrid1 do begin'
' rowcount:=combobox1.items.count+1;'
' colcount:=7;'
' for i:= 0 to colcount-1 do'
' cells[i,0]:=format('#39'column%1d'#39',[i]);'
' for i:= 1 to rowcount-1 do begin'
' cells[0,i]:=format('#39'skin file%1d'#39',[i]);'
' cells[1,i]:=combobox1.items[i-1];'
' end;'
' fixedcolor:=sd1.colors[csButtonFace];'
' end;'
'end;'
''
'procedure TForm1.ComboBox1Click(Sender: TObject);'
'begin'
' sd1.skinfile:='#39'..\..\skins\'#39'+combobox1.text;'
' stringgrid1.fixedcolor:=sd1.colors[csButtonFace];'
' if not sd1.active then sd1.active:=true;'
'end;'
''
'procedure TForm1.sf1CaptionBtnClick(Sender: TObject; action: Int' +
'eger);'
'begin'
' showmessage('#39'Custom Caption Button Click No:'#39'+inttostr(acti' +
'on));'
'end;'
''
'procedure TForm1.SpeedButton1Click(Sender: TObject);'
'begin'
'// sd1.skinfile:='#39'..\skins\'#39'+combobox1.items[1];'
'// stringgrid1.fixedcolor:=sd1.colors[csButtonFace];'
'// skinaddlog('#39'****************************'#39');'
' timer1.enabled:= not timer1.enabled; '
'end;'
''
'procedure TForm1.LoadBtnClick(Sender: TObject);'
'begin'
' Dialog1.filter:='#39'Skin files (*.skn)|*.SKN'#39';'
' Dialog1.initialdir:='#39'..\..\skins\'#39';'
' if Dialog1.execute then'
' sd1.skinfile:=dialog1.filename;'
' if not sd1.Active then'
' sd1.Active:=true;'
''
'end;'
''
'procedure TForm1.ExceptionBtnClick(Sender: TObject);'
'var i:integer;'
'begin'
' i:=1;'
' Ep:= 100 div (i-1);'
'end;'
''
'procedure TForm1.MessageBtnClick(Sender: TObject);'
'begin'
' MessageDlg('#39'VclSkin2.0 Demo !'#39'#13'#39'Message Window Skin Demo.'#39','
' mtInformation,[mbOk], 0);'
'end;'
''
'procedure TForm1.Skin21Click(Sender: TObject);'
'begin'
' Dialog2.execute;'
'end;'
''
'procedure TForm1.Skin31Click(Sender: TObject);'
'begin'
' Dialog3.execute;'
'end;'
''
'procedure TForm1.PrintDialog2Click(Sender: TObject);'
'begin'
' Dialog4.execute;'
'end;'
''
'procedure TForm1.Loadskin(aname:string);'
'var RS: TResourceStream;'
'begin'
' RS := TResourceStream.Create(HInstance,aname,RT_RCDATA);'
' sd1.loadfromstream(rs);'
' rs.free;'
'end;'
''
'procedure TForm1.Skin12Click(Sender: TObject);'
'var i:integer;'
'begin'
' i:=Tcomponent(sender).tag;'
' Sd1.LoadFromCollection(skinstore1,i);'
'end;'
''
'procedure TForm1.Button1Click(Sender: TObject);'
'begin'
' if form2=nil then'
' Application.CreateForm(TForm2, Form2);'
' form2.show;'
'end;'
''
'procedure TForm1.Timer1Timer(Sender: TObject);'
'begin'
' ProgressBar1.position:=ProgressBar1.position+1;'
' if ProgressBar1.position>99 then'
' ProgressBar1.position:=0;'
'end;'
''
'end.')
ParentFont = False
ReadOnly = True
ScrollBars = ssBoth
TabOrder = 0
WordWrap = False
end
end
object TabSheet3: TTabSheet
Caption = 'TListbox'
ImageIndex = 2
object ListBox1: TListBox
Left = 0
Top = 0
Width = 409
Height = 189
Align = alClient
ItemHeight = 13
Items.Strings = (
'unit Unit1;'
''
'interface'
''
'uses'
' Windows, Messages, SysUtils, Classes, Graphics, Controls, Form' +
's,'
' Dialogs, ComCtrls, StdCtrls, Menus, WinSkinForm, WinSkinData;'
''
'type'
' TForm1 = class(TForm)'
' PageControl1: TPageControl;'
' TabSheet1: TTabSheet;'
' TabSheet2: TTabSheet;'
' CheckBox1: TCheckBox;'
' CheckBox2: TCheckBox;'
' RadioButton1: TRadioButton;'
' RadioButton2: TRadioButton;'
' StatusBar1: TStatusBar;'
' MainMenu1: TMainMenu;'
' File1: TMenuItem;'
' view1: TMenuItem;'
' Help1: TMenuItem;'
' Open1: TMenuItem;'
' Save1: TMenuItem;'
' Close1: TMenuItem;'
' N1: TMenuItem;'
' Exit1: TMenuItem;'
' Skin11: TMenuItem;'
' Skin21: TMenuItem;'
' Skin31: TMenuItem;'
' Content1: TMenuItem;'
' Homepage1: TMenuItem;'
' About1: TMenuItem;'
' sf1: TWinSkinForm;'
' sd1: TSkinData;'
' ComboBox1: TComboBox;'
' ProgressBar1: TProgressBar;'
' Label1: TLabel;'
' Button3: TButton;'
' Button4: TButton;'
' Memo1: TMemo;'
' procedure Exit1Click(Sender: TObject);'
' procedure Button1Click(Sender: TObject);'
' procedure Button2Click(Sender: TObject);'
' procedure FormCreate(Sender: TObject);'
' procedure ComboBox1Click(Sender: TObject);'
' private'
' { Private declarations }'
' procedure ReadSkinfile( apath : string );'
' public'
' { Public declarations }'
' root:string;'
' end;'
''
'var'
' Form1: TForm1;'
''
'implementation'
''
'{$R *.dfm}'
''
'procedure TForm1.Exit1Click(Sender: TObject);'
'begin'
' close;'
'end;'
''
'procedure TForm1.Button1Click(Sender: TObject);'
'begin'
' button2.caption :='#39'&Change'#39';'
'end;'
''
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -