uset.pas
资源名称:挡案管理系统.rar [点击查看]
上传用户:szruida
上传日期:2007-06-01
资源大小:6518k
文件大小:4k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit uset;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, Buttons, IniFiles, TFlatEditUnit, TFlatButtonUnit,
- TFlatGroupBoxUnit, TFlatSpeedButtonUnit;
- type
- TfrmSet = class(TForm)
- odBg: TOpenDialog;
- FlatGroupBox1: TFlatGroupBox;
- edtsTopic: TFlatEdit;
- FlatButton1: TFlatButton;
- FlatGroupBox2: TFlatGroupBox;
- FlatSpeedButton1: TFlatSpeedButton;
- FlatSpeedButton2: TFlatSpeedButton;
- FlatSpeedButton3: TFlatSpeedButton;
- procedure FormShow(Sender: TObject);
- procedure bbtnBgSetClick(Sender: TObject);
- procedure bbtnRestoreClick(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure FlatButton1Click(Sender: TObject);
- procedure FlatSpeedButton1Click(Sender: TObject);
- procedure FlatSpeedButton2Click(Sender: TObject);
- procedure FlatSpeedButton3Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- frmSet: TfrmSet;
- implementation
- uses mainfrms,U_Public, Xt_ghjms;
- var
- iFile: tinifile;
- {$R *.dfm}
- procedure TfrmSet.FormShow(Sender: TObject);
- begin
- edtsTopic.Text := sTopic;
- end;
- procedure TfrmSet.bbtnBgSetClick(Sender: TObject);
- var
- fName, fNameo: string;
- begin
- if odBg.Execute then
- begin
- iFile := TIniFile.Create(sPath + 'perset.ini');
- fNameo := iFile.ReadString('sysbg', 'bground', 'main.jpg');
- if FileExists(sPath + fNameo) and (fNameo <> 'main.jpg') then
- DeleteFile(sPath + fNameo);
- fName := ExtractFileName(odbg.FileName);
- CopyFile(Pchar(odbg.FileName), pchar(sPath + 'images' + fName), false);
- iFile.WriteString('sysbg', 'bground', 'images' + fName);
- mainfrm.image1.Picture.LoadFromFile(sPath + 'images' + fName);
- MessageBox(self.Handle, '背景设置成功!', '提示', mb_IconInformation + mb_Ok);
- iFile.Free;
- end;
- end;
- procedure TfrmSet.bbtnRestoreClick(Sender: TObject);
- var
- fName: string;
- begin
- iFile := TIniFile.Create(sPath + 'perset.ini');
- fName := iFile.ReadString('sysbg', 'bground', '');
- if FileExists(sPath + fName) and (fName <> 'main.jpg') then
- DeleteFile(sPath + fName);
- iFile.WriteString('sysbg', 'bground', 'main.jpg');
- mainfrm.image1.Picture.LoadFromFile(sPath + 'main.jpg');
- MessageBox(self.Handle, '背景复原成功!', '提示', mb_IconInformation + mb_Ok);
- iFile.Free;
- end;
- procedure TfrmSet.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- action:=cafree;
- frmset:=nil;
- end;
- procedure TfrmSet.FlatButton1Click(Sender: TObject);
- begin
- if edtsTopic.Text <> '' then
- begin
- iFile := TIniFile.Create(sPath + 'perset.ini');
- iFile.WriteString('sTopic', 'topic', Trim(edtsTopic.Text));
- MessageBox(self.Handle, '主题设置成功!', '提示', mb_IconInformation + mb_Ok);
- mainfrm.Caption := Trim(edtsTopic.Text);
- iFile.Free;
- end
- else
- begin
- MessageBox(self.Handle, '请输入系统主题!', '提示', mb_IconInformation + mb_Ok);
- edtsTopic.SetFocus;
- end;
- end;
- procedure TfrmSet.FlatSpeedButton1Click(Sender: TObject);
- var
- fName: string;
- begin
- iFile := TIniFile.Create(sPath + 'perset.ini');
- fName := iFile.ReadString('sysbg', 'bground', '');
- if FileExists(sPath + fName) and (fName <> 'main.jpg') then
- DeleteFile(sPath + fName);
- iFile.WriteString('sysbg', 'bground', 'main.jpg');
- mainfrm.image1.Picture.LoadFromFile(sPath + 'main.jpg');
- MessageBox(self.Handle, '背景复原成功!', '提示', mb_IconInformation + mb_Ok);
- iFile.Free;
- end;
- procedure TfrmSet.FlatSpeedButton2Click(Sender: TObject);
- var
- fName, fNameo: string;
- begin
- if odBg.Execute then
- begin
- iFile := TIniFile.Create(sPath + 'perset.ini');
- fNameo := iFile.ReadString('sysbg', 'bground', 'main.jpg');
- if FileExists(sPath + fNameo) and (fNameo <> 'main.jpg') then
- begin
- DeleteFile(sPath + fNameo);
- fName := ExtractFileName(odbg.FileName);
- CopyFile(Pchar(odbg.FileName), pchar(sPath + 'images' + fName), false);
- iFile.WriteString('sysbg', 'bground', 'images' + fName);
- mainfrm.image1.Picture.LoadFromFile(sPath + 'images' + fName);
- MessageBox(self.Handle, '背景设置成功!', '提示', mb_IconInformation + mb_Ok);
- iFile.Free;
- end;
- end;
- end;
- procedure TfrmSet.FlatSpeedButton3Click(Sender: TObject);
- begin
- if Xt_ghjm=nil then
- begin
- Xt_ghjm:=TXt_ghjm.create(self);
- Xt_ghjm.showmodal;
- end;
- end;
- end.