📄 castleattackedit.pas
字号:
unit CastleAttackEdit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls,castle,M2Share;
type
TFormCastleAttackEdit = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
EditName: TEdit;
DateTimePicker1: TDateTimePicker;
Button1: TButton;
GroupBox2: TGroupBox;
ListBox1: TListBox;
CheckBox1: TCheckBox;
procedure Button1Click(Sender: TObject);
procedure ListBox1Click(Sender: TObject);
private
{ Private declarations }
public
Procedure Open(AttackerInfo:pTAttackerInfo;IsEdit:Boolean);
{ Public declarations }
end;
var
FormCastleAttackEdit: TFormCastleAttackEdit;
OK,okk:Boolean;
implementation
{$R *.dfm}
procedure TFormCastleAttackEdit.Open(AttackerInfo: pTAttackerInfo;
IsEdit: Boolean);
begin
if IsEdit then
Begin
Caption:='编辑攻城申请';
EditName.Text:=AttackerInfo^.sGuildName;
DateTimePicker1.DateTime:=AttackerInfo^.AttackDate;
ShowModal;
End
else
Begin
Caption:='增加攻城申请';
ListBox1.Items.LoadFromFile(g_Config.sGuildFile); //打开行会目录
DateTimePicker1.Date:=(date);//得到当前日期
ShowModal;
end;
if Ok then
Begin
AttackerInfo^.sGuildName:=EditName.Text;
AttackerInfo^.AttackDate:=DateTimePicker1.Date;
End;
end;
procedure TFormCastleAttackEdit.Button1Click(Sender: TObject);
begin
if CheckBox1.Checked then
okk:= True
else
ok:=True;
Close;
end;
procedure TFormCastleAttackEdit.ListBox1Click(Sender: TObject);
var i:integer;
begin
//EditName.Text:=ListBox1.Items.
for i:=0 to ListBox1.Items.Count-1 do
if ListBox1.Selected[i] then
EditName.Text:=ListBox1.Items.Strings[i];
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -