SrmOption.pas
资源名称:srmsrc.zip [点击查看]
上传用户:tj00001
上传日期:2007-01-07
资源大小:672k
文件大小:5k
源码类别:
行业应用
开发平台:
Delphi
- //---------------------------------------------------------------------------
- //(R)CopyRight KivenSoft International ,inc 1999
- //单元名称:选项对话框
- //程序名称:电子书库
- //作 者:李会文
- //开始时间:1998.07.28
- //最后修改:1999.07.15
- //备注:此单元定义了SRM文件的读写接口
- //---------------------------------------------------------------------------
- unit SrmOption;
- interface
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- ComCtrls, Buttons, StdCtrls, ExtCtrls, MainUnit, KvLabel;
- type
- TOptionForm = class(TForm)
- PageControl1: TPageControl;
- TabSheet1: TTabSheet;
- FileListCheckBox: TCheckBox;
- MyLoveCheckBox: TCheckBox;
- SaveCheckBox: TCheckBox;
- DelCheckBox: TCheckBox;
- Bevel1: TBevel;
- Bevel2: TBevel;
- Bevel3: TBevel;
- MyLoveEdit: TEdit;
- SpeedButton1: TSpeedButton;
- SpeedButton2: TSpeedButton;
- SpeedButton3: TSpeedButton;
- Bevel4: TBevel;
- TabSheet2: TTabSheet;
- ReGroupBox: TGroupBox;
- KvLabel3: TKvLabel;
- KvLabel4: TKvLabel;
- KvLabel5: TKvLabel;
- KvLabel6: TKvLabel;
- SrmCheckBox: TCheckBox;
- LoadSrmCheckBox: TCheckBox;
- KvLabel2: TKvLabel;
- KvLabel1: TKvLabel;
- SpeedButton4: TSpeedButton;
- KvLabel7: TKvLabel;
- TvGroupBox: TGroupBox;
- TvPanel: TPanel;
- RePanel: TPanel;
- TvShape: TShape;
- TvLabel: TKvLabel;
- ReShape: TShape;
- ReLabel: TKvLabel;
- procedure FormKeyPress(Sender: TObject; var Key: Char);
- procedure SpeedButton2Click(Sender: TObject);
- procedure SpeedButton3Click(Sender: TObject);
- procedure SpeedButton1Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure SpeedButton4Click(Sender: TObject);
- procedure TvShapeMouseDown(Sender: TObject; Button: TMouseButton;
- Shift: TShiftState; X, Y: Integer);
- procedure TvLabelClick(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- OptionForm: TOptionForm;
- implementation
- uses SrmConst, RegUnit;
- {$R *.DFM}
- procedure TOptionForm.FormCreate(Sender: TObject);
- begin
- SpeedButton2.Glyph.LoadFromResourceName(HInstance,'CANCELBMP');
- SpeedButton3.Glyph.LoadFromResourceName(HInstance,'OKBMP');
- SpeedButton4.Glyph.LoadFromResourceName(HInstance,'RESETBMP');
- with AppIni,SrmForm do
- begin
- SrmCheckBox.Checked:=OpenSrmWithApp;
- LoadSrmCheckBox.Checked:=LoadNearFile;
- FileListCheckBox.Checked:=FileListVisible;
- MyLoveCheckBox.Checked:=MyLoveVisible;
- SaveCheckBox.Checked:=SaveDbQuery;
- DelCheckBox.Checked:=DelRecordQuery;
- MyLoveEdit.Text:=MyLoveFile;
- TvShape.Brush.Color:=TreeView.Color;
- ReShape.Brush.Color:=RichEdit.Color;
- TvLabel.Font:=TreeView.Font;
- ReLabel.Font:=RichEdit.Font;
- end;
- TvLabel.Left:=(TvLabel.Parent.Width-TvLabel.Width) div 2; //设置Label到中心
- TvLabel.Top:=(TvLabel.Parent.Height-TvLabel.Height) div 2;
- ReLabel.Left:=(ReLabel.Parent.Width-ReLabel.Width) div 2;
- ReLabel.Top:=(ReLabel.Parent.Height-ReLabel.Height) div 2;
- end;
- procedure TOptionForm.FormKeyPress(Sender: TObject; var Key: Char);
- begin
- if Key=#13 then SpeedButton3Click(self);
- if Key=#27 then SpeedButton2Click(self);
- end;
- procedure TOptionForm.SpeedButton2Click(Sender: TObject);
- begin
- ModalResult:=MrCancel;
- end;
- procedure TOptionForm.SpeedButton3Click(Sender: TObject);
- begin
- ModalResult:=MrOk;
- end;
- procedure TOptionForm.SpeedButton1Click(Sender: TObject);
- begin
- with TOpenDialog.Create(self) do
- begin
- DefaultExt:=csSrmExt;
- Filter:=csSrmFilter;
- Title:=csOpenTitle;
- if Execute then
- begin
- MyLoveEdit.Text:=FileName;
- end;
- Free;
- end;
- end;
- procedure TOptionForm.SpeedButton4Click(Sender: TObject);
- begin
- SrmCheckBox.Checked:=true;
- LoadSrmCheckBox.Checked:=true;
- FileListCheckBox.Checked:=true;
- MyLoveCheckBox.Checked:=true;
- SaveCheckBox.Checked:=true;
- DelCheckBox.Checked:=true;
- TvShape.Brush.Color:=clWindow;
- ReShape.Brush.Color:=clWindow;
- with TvLabel.Font do
- begin
- Name:='system';
- Size:=9;
- Color:=clWindowText;
- Style:=[];
- end;
- with ReLabel.Font do
- begin
- Name:='system';
- Size:=9;
- Color:=clWindowText;
- Style:=[];
- end;
- end;
- procedure TOptionForm.TvShapeMouseDown(Sender: TObject;
- Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
- begin
- with TColorDialog.Create(self) do
- begin
- if Sender=TvShape then Color:=SrmForm.TreeView.Color
- else Color:=SrmForm.RichEdit.Color;
- if Execute then TShape(Sender).Brush.Color:=Color;
- Free;
- end;
- end;
- procedure TOptionForm.TvLabelClick(Sender: TObject);
- begin
- with TFontDialog.Create(self) do
- begin
- if Sender=TvLabel then Font:=SrmForm.TreeView.Font
- else Font:=SrmForm.RichEdit.Font;
- if Execute then
- begin
- TKvLabel(Sender).Font:=Font;
- TKvLabel(Sender).Left:=(TKvLabel(Sender).Parent.Width-TKvLabel(Sender).Width) div 2;
- TKvLabel(Sender).Top:=(TKvLabel(Sender).Parent.Height-TKvLabel(Sender).Height) div 2;
- end;
- Free;
- end;
- end;
- end.