playeredit.pas

来自「一般的数据库管理系统 uses Classes, SConnectEx, Tl」· PAS 代码 · 共 67 行

PAS
67
字号
unit playeredit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Mask, DBCtrls, TltConst;

type
  TPlayerEditForm = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Button2: TButton;
    Button3: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Edit4: TEdit;
    Label5: TLabel;
    Edit5: TEdit;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

  function EditPlayer(var APlayerEditInfo : TPlayerEditInfo): boolean;

implementation

{$R *.dfm}

function EditPlayer(var APlayerEditInfo : TPlayerEditInfo): boolean;
var
  PlayerEditForm: TPlayerEditForm;
begin
  Result := false;
  try
    PlayerEditForm := TPlayerEditForm.Create(nil);
    if APlayerEditInfo.EditFlag=efEditPlayer then begin
      PlayerEditForm.Edit3.Enabled:=False;
      PlayerEditForm.Edit3.Color:=PlayerEditForm.Edit1.Color;
    end else begin
      PlayerEditForm.Edit3.Enabled:=True;
      PlayerEditForm.Edit3.Color:=clWindow;
    end;
    PlayerEditForm.Edit1.Text := APlayerEditInfo.PlayerInfo.ID;
    PlayerEditForm.Edit2.Text := APlayerEditInfo.PlayerInfo.password;
    PlayerEditForm.Edit3.Text := IntToStr(APlayerEditInfo.PlayerInfo.money);
    PlayerEditForm.Edit4.Text := APlayerEditInfo.PlayerInfo.Memo;
    PlayerEditForm.Edit5.Text := APlayerEditInfo.PlayerInfo.UserName;
    if PlayerEditForm.ShowModal = mrOK then begin
      APlayerEditInfo.PlayerInfo.money := StrToInt(PlayerEditForm.Edit3.Text);
      APlayerEditInfo.PlayerInfo.Password := (PlayerEditForm.Edit2.Text);
      APlayerEditInfo.PlayerInfo.UserName := PlayerEditForm.Edit5.Text;
      APlayerEditInfo.PlayerInfo.Memo := PlayerEditForm.Edit4.Text;
      Result := true;
    end;
  finally
    PlayerEditForm.Free;
  end;
end;

end.

⌨️ 快捷键说明

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