aoutlsgr.pas

来自「delphi编程控件」· PAS 代码 · 共 75 行

PAS
75
字号
unit aoutlsgr;
(*
 COPYRIGHT (c) RSD Software 1997 - 98
 All Rights Reserved.
*)

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls;

type
  TfAutoOLSGroupRename = class(TForm)
    Bevel1: TBevel;
    LGroupName: TLabel;
    EGroupName: TEdit;
    BOk: TButton;
    BCancel: TButton;
    BHelp: TButton;
    procedure EGroupNameKeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

function AutoOLSGroupRename(var GroupName : String; Kind : Integer) : Boolean;

implementation
uses autostrs;

function AutoOLSGroupRename(var GroupName : String; Kind : Integer) : Boolean;
Var
  AForm : TfAutoOLSGroupRename;
begin
  AForm := TfAutoOLSGroupRename.Create(Nil);
  Result := False;
  with AForm do begin
    case Kind of
      0: Caption := LoadStr(AEC_OUTLOOKBARCATEGORYADD);
      1: Caption := LoadStr(AEC_OUTLOOKBARCATEGORYINSERT);
      2: Caption := LoadStr(AEC_OUTLOOKBARCATEGORYRENAME);
    end;
    EGroupName.Text := GroupName;
    BOk.Enabled := EGroupName.Text  <> '';
    ShowModal;
    if(ModalResult = mrOk) then begin
      GroupName := EGroupName.Text;
      Result := True;
    end;
  end;
  AForm.Free;
end;

{$R *.DFM}

procedure TfAutoOLSGroupRename.EGroupNameKeyUp(Sender: TObject;
  var Key: Word; Shift: TShiftState);
begin
  BOk.Enabled := EGroupName.Text  <> '';
end;

procedure TfAutoOLSGroupRename.FormCreate(Sender: TObject);
begin
  BOk.Caption := LoadStr(ACB_OK);
  BCancel.Caption := LoadStr(ACB_CANCEL);
  BHelp.Caption := LoadStr(ACB_HELP);
  LGroupName.Caption := LoadStr(AEL_CATEGORYNAME);
end;

end.

⌨️ 快捷键说明

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