📄 setupgernal_.pas
字号:
unit SetupGernal_;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, inifiles, ComCtrls, ExtCtrls;
type
TSetupGernal = class(TForm)
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
TabSheet3: TTabSheet;
GroupBox1: TGroupBox;
Label2: TLabel;
Label3: TLabel;
editBoxWidth: TEdit;
editBoxHeight: TEdit;
comboEngine: TComboBox;
comboEngineMemo: TMemo;
Label4: TLabel;
GroupBox2: TGroupBox;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
editIVRCaption: TEdit;
comboIVRType: TComboBox;
comboIVRContent: TComboBox;
GroupBox3: TGroupBox;
Label1: TLabel;
editUserName: TEdit;
Label8: TLabel;
editPassword: TEdit;
ColorDialog: TColorDialog;
GroupBox4: TGroupBox;
BtnSelectLineColor: TSpeedButton;
editLineColor: TComboBox;
panelLineColor: TPanel;
panelIVRColor: TPanel;
panelEventColor: TPanel;
editIVRColor: TComboBox;
editEventColor: TComboBox;
BtnSelectIVRColor: TSpeedButton;
BtnSelectEventColor: TSpeedButton;
GroupBox5: TGroupBox;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
editSub: TEdit;
ComboSub: TComboBox;
ComboSubID: TComboBox;
Label12: TLabel;
editSubStart: TEdit;
Label13: TLabel;
ComboSubStart: TComboBox;
Label14: TLabel;
ComboSubStartID: TComboBox;
Label15: TLabel;
editSubEnd: TEdit;
Label16: TLabel;
ComboSubEnd: TComboBox;
Label17: TLabel;
ComboSubEndID: TComboBox;
procedure editBoxWidthKeyPress(Sender: TObject; var Key: Char);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure editLineColorChange(Sender: TObject);
procedure BtnSelectLineColorClick(Sender: TObject);
procedure comboEngineChange(Sender: TObject);
procedure BtnSelectIVRColorClick(Sender: TObject);
procedure BtnSelectEventColorClick(Sender: TObject);
procedure editIVRColorChange(Sender: TObject);
procedure editEventColorChange(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
SetupGernal: TSetupGernal;
implementation
uses main_;
{$R *.DFM}
procedure TSetupGernal.editBoxWidthKeyPress(Sender: TObject;
var Key: Char);
begin
if (Ord(Key) > $39) or (Ord(Key) < $30) then
begin
MessageBeep(MB_ICONERROR);
Key := Chr(0);
end;
end;
procedure TSetupGernal.BitBtn1Click(Sender: TObject);
begin
main.DefaultWrite := editUserName.Text;
main.DefaultWidth := StrToInt(editBoxWidth.Text);
main.DefaultHeight := StrToInt(editBoxHeight.Text);
main.StartType := StrToInt(comboIVRType.Text);
main.StartContent := StrToInt(comboIVRContent.Text);
main.StartCaption := editIVRCaption.Text;
main.DefaultEngine := comboEngine.ItemIndex;
// 子流程
main.SubCaption := editSub.Text ; //子流程名称 2002.09.04
main.SubProcess := StrToInt(ComboSub.Text) ; //子流程标号 2002.09.03
main.SubiContent := StrToInt(ComboSubID.Text) ;
main.SubStartCaption := editSubStart.Text ; //子流程开始名称 2002.09.04
main.SubStartiType := StrToInt(ComboSubStart.Text) ; //子流程开始标号 2002.09.03
main.SubStartiContent := StrToInt(ComboSubStartID.Text) ;
main.SubEndCaption := editSubEnd.Text ; //子流程结束名称 2002.09.04
main.SubEndiType := StrToInt(ComboSubEnd.Text) ; //子流程结束标号 2002.09.03
main.SubEndiContent := StrToInt(ComboSubEndID.Text);
main.SetBuildBtnCaption();
with TIniFile.Create(main.MainProgramPath + 'Config.ini') do
begin
WriteString('Gernal', 'User', main.DefaultWrite);
WriteInteger('Gernal', 'Engine', main.DefaultEngine);
WriteString('Color', 'Line', editLineColor.Text);
WriteString('Color', 'IVR', editIVRColor.Text);
WriteString('Color', 'Event', editEventColor.Text);
WriteInteger('Box', 'Width', main.DefaultWidth);
WriteInteger('Box', 'Height', main.DefaultHeight);
WriteString('Start', 'Caption', main.StartCaption);
WriteInteger('Start', 'iType', main.StartType);
WriteInteger('Start', 'iContent', main.StartContent);
//子流程
WriteString('SubProcess', 'SubCaption', main.SubCaption);
WriteInteger('SubProcess', 'SubiType', main.SubProcess);
WriteInteger('SubProcess', 'SubiContent', main.SubiContent);
WriteString('SubProcess', 'SubStartCaption', main.SubStartCaption);
WriteInteger('SubProcess', 'SubStartiType', main.SubStartiType);
WriteInteger('SubProcess', 'SubStartiContent', main.SubStartiContent);
WriteString('SubProcess', 'SubEndCaption', main.SubEndCaption);
WriteInteger('SubProcess', 'SubEndiType', main.SubEndiType);
WriteInteger('SubProcess', 'SubEndiContent', main.SubEndiContent);
Free();
end;
end;
procedure TSetupGernal.BitBtn2Click(Sender: TObject);
begin
Close();
end;
procedure TSetupGernal.FormShow(Sender: TObject);
var
i: Integer;
//tmpLineColor, tmpIVRColor, tmpEventColor: TColor;
begin
{with TIniFile.Create(main.MainProgramPath + 'Config.ini') do
begin
tmpLineColor := StringToColor(ReadString('Color', 'Line', ColorToString(main.IVRLineColor)));
tmpIVRColor := StringToColor(ReadString('Gernal',
Free();
end;}
//注册资料
editUserName.Text := main.DefaultWrite;
//宽度
editBoxWidth.Text := IntToStr(main.DefaultWidth);
editBoxHeight.Text := IntToStr(main.DefaultHeight);
//颜色
panelLineColor.Color := main.IVRLineColor;
panelLineColor.Font.Color := $00FFFFFF - panelLineColor.Color;
editLineColor.Items.Add(ColorToString(panelLineColor.Color));
editLineColor.ItemIndex := editLineColor.Items.Count - 1;
panelIVRColor.Color := main.IVRPointColor;
panelIVRColor.Font.Color := $00FFFFFF - panelIVRColor.Color;
editIVRColor.Items.Add(ColorToString(panelIVRColor.Color));
editIVRColor.ItemIndex := editIVRColor.Items.Count - 1;
panelEventColor.Color := main.IVREventColor;
panelEventColor.Font.Color := $00FFFFFF - panelEventColor.Color;
editEventColor.Items.Add(ColorToString(panelEventColor.Color));
editEventColor.ItemIndex := editEventColor.Items.Count - 1;
//第一节点
editIVRCaption.Text := main.StartCaption;
comboIVRType.Text := IntToStr(main.StartType);
comboIVRContent.Text := IntToStr(main.StartContent);
// 子流程
editSub.Text := main.SubCaption; //子流程名称 2002.09.04
ComboSub.Text := IntToStr(main.SubProcess); //子流程标号 2002.09.03
ComboSubID.Text := IntToStr(main.SubiContent) ;
editSubStart.Text := main.SubStartCaption; //子流程开始名称 2002.09.04
ComboSubStart.Text := IntToStr(main.SubStartiType); //子流程开始标号 2002.09.03
ComboSubStartID.Text := IntToStr(main.SubStartiContent);
editSubEnd.Text := main.SubEndCaption; //子流程结束名称 2002.09.04
ComboSubEnd.Text := IntToStr(main.SubEndiType); //子流程结束标号 2002.09.03
ComboSubEndID.Text := IntToStr(main.SubEndiContent);
//编译引擎
for i := 0 to main.EngineList.Count - 1 do
begin
comboEngine.Items.Add(main.EnginePopup.Items[i].Caption);
end;
comboEngine.ItemIndex := main.DefaultEngine;
comboEngineMemo.Text := main.EngineMemo[main.DefaultEngine];
TabSheet1.Show();
end;
procedure TSetupGernal.editLineColorChange(Sender: TObject);
begin
try
panelLineColor.Color := StringToColor(editLineColor.Text);
except
ShowMessage('你输入了一个非法的颜色值');
editLineColor.Text := ColorToString(main.IVRLineColor);
panelLineColor.Color := main.IVRLineColor;
end;
panelLineColor.Font.Color := $00FFFFFF - panelLineColor.Color;
end;
procedure TSetupGernal.comboEngineChange(Sender: TObject);
begin
comboEngineMemo.Text := main.EngineMemo[comboEngine.ItemIndex];
end;
procedure TSetupGernal.BtnSelectLineColorClick(Sender: TObject);
begin
if ColorDialog.Execute() then
begin
editLineColor.Text := ColorToString(ColorDialog.Color);
panelLineColor.Color := ColorDialog.Color;
panelLineColor.Font.Color := $00FFFFFF - ColorDialog.Color;
end;
end;
procedure TSetupGernal.BtnSelectIVRColorClick(Sender: TObject);
begin
if ColorDialog.Execute() then
begin
editIVRColor.Text := ColorToString(ColorDialog.Color);
panelIVRColor.Color := ColorDialog.Color;
panelIVRColor.Font.Color := $00FFFFFF - ColorDialog.Color;
end;
end;
procedure TSetupGernal.BtnSelectEventColorClick(Sender: TObject);
begin
if ColorDialog.Execute() then
begin
editEventColor.Text := ColorToString(ColorDialog.Color);
panelEventColor.Color := ColorDialog.Color;
panelEventColor.Font.Color := $00FFFFFF - ColorDialog.Color;
end;
end;
procedure TSetupGernal.editIVRColorChange(Sender: TObject);
begin
try
panelIVRColor.Color := StringToColor(editIVRColor.Text);
except
ShowMessage('你输入了一个非法的颜色值');
panelIVRColor.Color := main.IVRPointColor;
editIVRColor.Text := ColorToString(panelIVRColor.Color);
end;
panelIVRColor.Font.Color := $00FFFFFF - panelIVRColor.Color;
end;
procedure TSetupGernal.editEventColorChange(Sender: TObject);
begin
try
panelEventColor.Color := StringToColor(editEventColor.Text);
except
ShowMessage('你输入了一个非法的颜色值');
panelEventColor.Color := main.IVREventColor;
editEventColor.Text := ColorToString(panelEventColor.Color);
end;
panelEventColor.Font.Color := $00FFFFFF - panelEventColor.Color;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -