⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unitopciones.pas

📁 参照上兴、鸽子等源码编写编写出来的。 编译环境:Delphi7+SP+DP+indy9等控件
💻 PAS
字号:
unit UnitOpciones;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Buttons, StdCtrls,inifiles,
  unitMain,
  unitVariables, DynamicSkinForm;

type
  TFormOpciones = class(TForm)
    LabelPuerto: TLabel;
    EditPuerto: TEdit;
    BtnGuardar: TSpeedButton;
    CheckBoxNotificacionMsn: TCheckBox;
    CheckBoxMinimizeToTray: TCheckBox;
    spDynamicSkinForm1: TspDynamicSkinForm;
    CheckBoxPreguntarAlSalir: TCheckBox;
    procedure BtnGuardarClick(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormOpciones: TFormOpciones;
procedure readoption;
implementation

{$R *.dfm}
function app_path1:string;
begin
  result:=extractfilepath(application.ExeName);
end;
procedure writeoption;
var
  ini1:tinifile;
begin
  ini1:=tinifile.Create(app_path1+'Operate.ini');
    Ini1.WriteString('Options','PuertoEscucha', FormOpciones.EditPuerto.Text);
    Ini1.WriteBool('Options','PreguntarSalir', FormOpciones.CheckBoxPreguntarAlSalir .Checked);
    Ini1.WriteBool('Options','MinimizarAlTray', FormOpciones.CheckBoxMinimizeToTray.Checked);
    Ini1.WriteBool('Options', 'NotificacionMsn', FormOpciones.CheckBoxNotificacionMsn.Checked);
  ini1.Free;
end;
procedure readoption;
var
  ini1:tinifile;
begin
  ini1:=tinifile.Create(app_path1+'Operate.ini');

      FormOpciones.EditPuerto.Text                  := Ini1.ReadString('Options', 'PuertoEscucha', '3306');
      FormOpciones.CheckBoxPreguntarAlSalir.Checked := Ini1.ReadBool('Options','PreguntarSalir', True);
      FormOpciones.CheckBoxNotificacionMsn.Checked  := Ini1.ReadBool('Options', 'NotificacionMsn', True);
      NotificacionMsn                  := Ini1.ReadBool('Options', 'NotificacionMsn', True);
      FormOpciones.CheckBoxMinimizeToTray.Checked   := Ini1.ReadBool('Options', 'MinimizarAlTray', False);

  ini1.Free;
end;
procedure TFormOpciones.BtnGuardarClick(Sender: TObject);
begin
  if CheckBoxPreguntarAlSalir.Checked then
    FormMain.OnCloseQuery := FormMain.FormCloseQuery
  else    FormMain.OnCloseQuery := nil;

  if CheckBoxNotificacionMsn.Checked then
    NotificacionMsn := True
  else
    NotificacionMsn := False;

  if CheckBoxMinimizeToTray.Checked then
     Application.OnMinimize := FormMain.MinimizeToTrayClick
  else
     Application.OnMinimize := Nil;
     writeoption;
  FormMain.StatusBar.Panels[1].Text := '端口: ' + FormOpciones.EditPuerto.Text;


  Close;
end;



end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -