Changeset 3 for trunk/Forms
- Timestamp:
- Jan 27, 2016, 10:32:48 PM (9 years ago)
- Location:
- trunk/Forms
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r2 r3 1 1 object FormMain: TFormMain 2 Left = 5783 Height = 6464 Top = 3095 Width = 9852 Left = 333 3 Height = 1074 4 Top = 151 5 Width = 1420 6 6 Caption = 'Dune 2' 7 ClientHeight = 6468 ClientWidth = 9857 ClientHeight = 1074 8 ClientWidth = 1420 9 9 OnActivate = FormActivate 10 OnKeyPress = FormKeyPress 10 11 LCLVersion = '1.7' 12 WindowState = wsMaximized 11 13 object PaintBox1: TPaintBox 12 14 Left = 0 13 Height = 64615 Height = 1074 14 16 Top = 0 15 Width = 98517 Width = 1420 16 18 Align = alClient 17 19 OnClick = PaintBox1Click 20 OnPaint = PaintBox1Paint 18 21 end 19 22 end -
trunk/Forms/UFormMain.pas
r2 r3 16 16 PaintBox1: TPaintBox; 17 17 procedure FormActivate(Sender: TObject); 18 procedure FormKeyPress(Sender: TObject; var Key: char); 18 19 procedure PaintBox1Click(Sender: TObject); 20 procedure PaintBox1Paint(Sender: TObject); 19 21 private 20 22 Initialized: Boolean; … … 40 42 end; 41 43 44 procedure TFormMain.PaintBox1Paint(Sender: TObject); 45 begin 46 Core.Game.Paint(PaintBox1.Canvas); 47 end; 48 42 49 procedure TFormMain.FormActivate(Sender: TObject); 43 50 begin … … 45 52 Initialized := True; 46 53 Core.Init; 54 end; 55 end; 56 57 procedure TFormMain.FormKeyPress(Sender: TObject; var Key: char); 58 begin 59 Caption := IntToStr(Ord(Key)); 60 if Key = #63 then begin 61 Inc(Core.Game.IW); 62 core.Game.LoadData; 63 PaintBox1.Repaint; 64 end; 65 if Key = #41 then begin 66 Dec(Core.Game.IW); 67 core.Game.LoadData; 68 PaintBox1.Repaint; 47 69 end; 48 70 end;
Note:
See TracChangeset
for help on using the changeset viewer.