📄 setup.pas
字号:
{
模块名称:设置
使用方法:1、Create
2、ShowModal
返回值: 1、mrOk: 更改系统设置
2、mrRetry: 恢复默认设置
}
unit Setup;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls, StdCtrls, ExtCtrls, Buttons, checklst, Registry, ExtDlgs, Spin;
type
TFormSetup = class(TForm)
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
TabSheet3: TTabSheet;
TabSheet4: TTabSheet;
TabSheet5: TTabSheet;
TabSheet6: TTabSheet;
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
Panel4: TPanel;
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
GroupBox3: TGroupBox;
GroupBox4: TGroupBox;
GroupBox5: TGroupBox;
GroupBox6: TGroupBox;
GroupBox7: TGroupBox;
GroupBox8: TGroupBox;
GroupBox9: TGroupBox;
GroupBox10: TGroupBox;
GroupBox11: TGroupBox;
GroupBox12: TGroupBox;
GroupBox13: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
Label18: TLabel;
EditBookLeft: TEdit;
EditBookTop: TEdit;
EditBookWidth: TEdit;
EditBookHeight: TEdit;
EditFilename: TEdit;
LabelYeCount: TLabel;
LabelWordCount: TLabel;
LabelYeCurrent: TLabel;
LabelAutoPageMove: TLabel;
LabelAutoVal: TLabel;
EditSoundFilename: TEdit;
CheckBoxMove: TCheckBox;
CheckBoxResize: TCheckBox;
CheckBoxPageMove: TCheckBox;
CheckBoxPageYe: TCheckBox;
CheckBoxMax: TCheckBox;
CheckBoxSinglePage: TCheckBox;
CheckBoxAutoPageMove: TCheckBox;
EditAutoVal: TEdit;
CheckBoxBIG5: TCheckBox;
CheckBoxGB: TCheckBox;
CheckBoxHtml: TCheckBox;
CheckBoxChap: TCheckBox;
CheckBoxHangD: TCheckBox;
CheckBoxUnderLine: TCheckBox;
BtnChangeUnderLineColor: TSpeedButton;
ImageUnderLineColor: TImage;
ComboBoxYe1Be: TComboBox;
ComboBoxYe1Af: TComboBox;
RbYe1loc1: TRadioButton;
RbYe1loc2: TRadioButton;
RbYe1loc3: TRadioButton;
RbYe1loc4: TRadioButton;
RbYe1loc5: TRadioButton;
CheckBoxYe1Count: TCheckBox;
ComboBoxYe2Be: TComboBox;
ComboBoxYe2Af: TComboBox;
RbYe2loc1: TRadioButton;
RbYe2loc2: TRadioButton;
RbYe2loc3: TRadioButton;
RbYe2loc4: TRadioButton;
RbYe2loc5: TRadioButton;
CheckBoxYe2Count: TCheckBox;
RbUnMimeCode: TRadioButton;
RbUnQPCode: TRadioButton;
RbUnHZCode: TRadioButton;
RbUnNoneCode: TRadioButton;
CheckBoxBackImage: TCheckBox;
CheckBoxLabelImage: TCheckBox;
CheckBoxShowTime: TCheckBox;
CheckBoxFlat: TCheckBox;
CheckBoxViewCtrl: TCheckBox;
BtnChangeBackImage: TSpeedButton;
BtnChangeLabelImage: TSpeedButton;
BtnChangeAlarm: TSpeedButton;
CheckBoxChangeItem: TCheckBox;
CheckBoxOpenCloseFile: TCheckBox;
CheckBoxClearLabel: TCheckBox;
CheckBoxClearNewItem: TCheckBox;
CheckBoxSimpleItem: TCheckBox;
CheckBoxAutoGB: TCheckBox;
CheckBoxCheckText: TCheckBox;
CheckBoxSaveTempFile: TCheckBox;
CheckBoxLanguageDLL: TCheckBox;
BtnLanguageDLL: TSpeedButton;
CheckBoxYeView: TCheckBox;
BtnChangeYeFont: TSpeedButton;
BtnChangePageFont: TSpeedButton;
EditMaxTextRead: TSpinEdit;
DlgOpenImage: TOpenPictureDialog;
DlgUnderLineColor: TColorDialog;
DlgOpenLanguageDLL: TOpenDialog;
DlgYeFont: TFontDialog;
DlgPageFont: TFontDialog;
BtnOk: TButton;
BtnCancel: TButton;
BtnDefault: TButton;
procedure FormCreate(Sender: TObject);
procedure CheckBoxMoveClick(Sender: TObject);
procedure CheckBoxBackImageClick(Sender: TObject);
procedure BtnChangeUnderLineColorClick(Sender: TObject);
procedure BtnChangeBackImageClick(Sender: TObject);
procedure BtnChangeAlarmClick(Sender: TObject);
procedure CheckBoxAutoGBClick(Sender: TObject);
procedure BtnLanguageDLLClick(Sender: TObject);
procedure BtnChangeYeFontClick(Sender: TObject);
procedure BtnOkClick(Sender: TObject);
procedure BtnCancelClick(Sender: TObject);
procedure BtnDefaultClick(Sender: TObject);
procedure ChangeMax(Sender: TObject);
procedure ChangeWindow(Sender: TObject);
procedure ChangePage(Sender: TObject);
procedure ChangeYe(Sender: TObject);
procedure ChangePageDo(Sender: TObject);
procedure ChangeImage(Sender: TObject);
private
{ Private declarations }
FstrBackImageFilename : string;
FstrLabelImageFilename : string;
FImageArray : array [1 .. 5] of TPoint; //下划线颜色区域
FstrLanguageDLL : string;
public
{ Public declarations }
end;
var
FormSetup: TFormSetup;
implementation
uses
Alarm,
Global,
MP3Play; //为了得到背景音乐的文件名
{$R *.DFM}
procedure TFormSetup.FormCreate(Sender: TObject);
var
i : integer;
begin
//多语言文字
Self.Font.Charset := GetCharset;
DlgYeFont.Font.Charset := GetCharset;
DlgPageFont.Font.Charset := GetCharset;
Self.Caption := GetWord('设置');
TabSheet1.Caption := GetWord('书本设置') + ' ';
GroupBox5.Caption := GetWord('书本位置');
Label5.Caption := GetWord('距左:');
Label6.Caption := GetWord('距上:');
GroupBox6.Caption := GetWord('书本大小');
Label7.Caption := GetWord('宽度:');
Label8.Caption := GetWord('高度:');
GroupBox9.Caption := GetWord('系统信息');
Label9.Caption := GetWord('文件名:');
Label10.Caption := GetWord('总页数:');
Label15.Caption := GetWord('总字数:');
Label11.Caption := GetWord('当前页数:');
Label12.Caption := GetWord('自动翻页:');
Label14.Caption := GetWord('翻页时间:');
Label16.Caption := GetWord('音乐文件:');
TabSheet2.Caption := GetWord('页面设置') + ' ';
GroupBox7.Caption := GetWord('页面设置');
CheckBoxMove.Caption := GetWord('移动书本');
CheckBoxResize.Caption := GetWord('改变书本大小');
CheckBoxPageMove.Caption := GetWord('拖曳页面时移动书本');
CheckBoxPageYe.Caption := GetWord('点击页面翻页');
CheckBoxMax.Caption := GetWord('最大化显示');
CheckBoxSinglePage.Caption := GetWord('单页显示');
CheckBoxAutoPageMove.Caption := GetWord('自动翻页:');
Label13.Caption := GetWord('秒');
GroupBox10.Caption := GetWord('处理设置');
CheckBoxBIG5.Caption := GetWord('BIG5码转换为GB码');
CheckBoxGB.Caption := GetWord('GB码转换为BIG5码');
CheckBoxHtml.Caption := GetWord('处理HTML文件');
CheckBoxChap.Caption := GetWord('智能分段');
CheckBoxHangD.Caption := GetWord('行距加倍');
CheckBoxUnderLine.Caption := GetWord('显示下划线:');
BtnChangeUnderLineColor.Caption := GetWord('颜色') + c_strItemMore;
TabSheet3.Caption := GetWord('页码设置') + ' ';
GroupBox1.Caption := GetWord('页码') + '&1';
Label1.Caption := GetWord('页码前缀:');
ComboBoxYe1Be.Text := GetWord('第');
ComboBoxYe1Be.Items.Strings[0] := GetWord('第');
Label2.Caption := GetWord('页码后缀:');
ComboBoxYe1Af.Text := GetWord('页');
ComboBoxYe1Af.Items.Strings[0] := GetWord('页');
GroupBox3.Caption := GetWord('页码位置');
RbYe1loc1.Caption := GetWord('靠左');
RbYe1loc2.Caption := GetWord('中间');
RbYe1loc3.Caption := GetWord('靠右');
RbYe1loc4.Caption := GetWord('靠上');
RbYe1loc5.Caption := GetWord('靠下');
CheckBoxYe1Count.Caption := GetWord('显示总页数');
GroupBox2.Caption := GetWord('页码') + '&2';
Label3.Caption := GetWord('页码前缀:');
ComboBoxYe2Be.Text := GetWord('第');
ComboBoxYe2Be.Items.Strings[0] := GetWord('第');
Label4.Caption := GetWord('页码后缀:');
ComboBoxYe2Af.Text := GetWord('页');
ComboBoxYe2Af.Items.Strings[0] := GetWord('页');
GroupBox4.Caption := GetWord('页码位置');
RbYe2loc1.Caption := GetWord('靠左');
RbYe2loc2.Caption := GetWord('中间');
RbYe2loc3.Caption := GetWord('靠右');
RbYe2loc4.Caption := GetWord('靠上');
RbYe2loc5.Caption := GetWord('靠下');
CheckBoxYe2Count.Caption := GetWord('显示总页数');
TabSheet4.Caption := GetWord('编码设置') + ' ';
GroupBox12.Caption := GetWord('解码设置');
RbUnMimeCode.Caption := GetWord('处理MIME/BASE64编码');
RbUnQPCode.Caption := GetWord('处理Quoted-Printable编码');
RbUnHZCode.Caption := GetWord('处理HZ编码');
RbUnNoneCode.Caption := GetWord('不处理任何编码');
TabSheet5.Caption := GetWord('界面设置') + ' ';
GroupBox11.Caption := GetWord('背景设置');
CheckBoxBackImage.Caption := GetWord('背景图片:');
BtnChangeBackImage.Caption := GetWord('图片文件') + c_strItemMore;
CheckBoxLabelImage.Caption := GetWord('书签图片:');
BtnChangeLabelImage.Caption := GetWord('图片文件') + c_strItemMore;
CheckBoxShowTime.Caption := GetWord('显示时间');
BtnChangeAlarm.Caption := GetWord('定时提醒') + c_strItemMore;
CheckBoxFlat.Caption := GetWord('浮动式按钮');
CheckBoxViewCtrl.Caption := GetWord('显示界面控制按钮');
TabSheet6.Caption := GetWord('系统设置') + ' ';
GroupBox8.Caption := GetWord('菜单设置');
CheckBoxChangeItem.Caption := GetWord('改变最新文件菜单顺序');
CheckBoxOpenCloseFile.Caption := GetWord('打开上次关闭时候的文件');
CheckBoxClearLabel.Caption := GetWord('重新打开文件时清除书签');
CheckBoxClearNewItem.Caption := GetWord('打开书库文件时清除原菜单');
CheckBoxSimpleItem.Caption := GetWord('简化最新文件菜单');
GroupBox13.Caption := GetWord('系统设置');
CheckBoxAutoGB.Caption := GetWord('自动转换为GB码');
CheckBoxCheckText.Caption := GetWord('校验文件错误');
CheckBoxSaveTempFile.Caption := GetWord('关闭时保存临时文件');
CheckBoxLanguageDLL.Caption := GetWord('外挂语言库:');
BtnLanguageDLL.Caption := GetWord('库文件') + c_strItemMore;
CheckBoxYeView.Caption := GetWord('显示页码:');
BtnChangeYeFont.Caption := GetWord('页码字体') + c_strItemMore;
BtnChangePageFont.Caption := GetWord('页面字体') + c_strItemMore;
Label17.Caption := GetWord('文件最大容量') + ' <';
DlgOpenImage.Filter := GetWord('所有图片文件') + '|*.jpg;*.jpeg;*.bmp;*.ico;*.emf;*.wmf|' +
GetWord('JPEG文件') + '(*.jpg,*.jpeg)|*.jpg;*.jpeg|' +
GetWord('BMP文件') + '(*.bmp)|*.bmp|' +
GetWord('Icon文件') + '(*.ico)|*.ico|' +
GetWord('EMF文件') + '(*.emf)|*.emf|' +
GetWord('WMF文件') + '(*.wmf)|*.wmf|' +
GetWord('所有文件') + '(*.*)|*.*';
DlgOpenImage.Title := GetWord('打开图片文件');
DlgOpenLanguageDLL.Filter := GetWord('外挂语言库文件') + '(*.dll)|*.dll|' +
GetWord('所有文件') + '(*.*)|*.*';
DlgOpenLanguageDLL.Title := GetWord('打开外挂语言库文件');
BtnDefault.Caption := GetWord('默认') + '(&D)' + c_strItemMore;
BtnOk.Caption := GetWord('确定');
BtnCancel.Caption := GetWord('取消');
//初始化显示页
PageControl1.ActivePageIndex := 0;
//初始化书本设置
EditBookLeft.Text := IntToStr(g_nBookLeft);
EditBookTop.Text := IntToStr(g_nBookTop);
EditBookWidth.Text := IntToStr(g_nBookWidth);
EditBookHeight.Text := IntToStr(g_nBookHeight);
if (g_strFilename = '') then
EditFilename.Text := GetWord('说明文件')
else if (g_strFilename = '剪贴板') then
EditFilename.Text := GetWord('剪贴板')
else
EditFilename.Text := g_strFilename;
LabelYeCount.Caption := GetWord('共') + IntToStr(g_nYeCount) + GetWord('页');
LabelWordCount.Caption := GetWord('共') + IntToStr(g_nCountWord) + GetWord('字');
LabelYeCurrent.Caption := GetWord('第') + IntToStr(g_nYeCurrent) + GetWord('页');
if g_boolAutoPageMove then
begin
LabelAutoPageMove.Caption := GetWord('允许自动翻页');
LabelAutoVal.Caption := IntToStr(g_nAutoVal) + GetWord('秒');
end
else
begin
LabelAutoPageMove.Caption := GetWord('不允许自动翻页');
LabelAutoVal.Caption := '';
end;
EditSoundFilename.Text := '';
if FormMP3Play.ListBoxSoundName.Items.Count <= 0 then
EditSoundFilename.Text := GetWord('没有选择音乐文件')
else
for i := 0 to FormMP3Play.ListBoxSoundName.Items.Count - 1 do
EditSoundFilename.Text := EditSoundFilename.Text +
ExtractFileName(FormMP3Play.ListBoxSoundName.Items[i]) + ' | ';
//初始化页面设置
FImageArray[1].x := 0;
FImageArray[1].y := 0;
FImageArray[2].x := ImageUnderLineColor.Width - 2;
FImageArray[2].y := 0;
FImageArray[3].x := ImageUnderLineColor.Width - 2;
FImageArray[3].y := ImageUnderLineColor.Height - 2;
FImageArray[4].x := 0;
FImageArray[4].y := ImageUnderLineColor.Height - 2;
FImageArray[5].x := FImageArray[1].x;
FImageArray[5].y := FImageArray[1].y;
CheckBoxMove.Checked := g_boolMove;
CheckBoxResize.Checked := g_boolResize;
CheckBoxPageMove.Enabled := g_boolMove;
CheckBoxPageMove.Checked := g_boolPageMove;
CheckBoxPageYe.Checked := g_boolPageYe;
CheckBoxMax.Checked := g_boolMax;
CheckBoxSinglePage.Checked := g_boolSinglePage;
CheckBoxAutoPageMove.Checked := g_boolAutoPageMove;
EditAutoVal.Enabled := g_boolAutoPageMove;
EditAutoVal.Text := IntToStr(g_nAutoVal);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -