Changeset 38 for trunk/Forms/UFormMemory.pas
- Timestamp:
- Feb 19, 2012, 10:29:55 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMemory.pas
r37 r38 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs; 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ComCtrls; 10 11 const 12 RowSize = 16; 9 13 10 14 type 11 TForm3 = class(TForm) 15 16 { TFormMemory } 17 18 TFormMemory = class(TForm) 19 Label6: TLabel; 20 ListViewMemory: TListView; 21 procedure ListViewMemoryData(Sender: TObject; Item: TListItem); 12 22 private 13 23 { private declarations } 14 24 public 15 { public declarations }25 procedure Reload; 16 26 end; 17 27 18 28 var 19 Form 3: TForm3;29 FormMemory: TFormMemory; 20 30 21 31 implementation … … 23 33 {$R *.lfm} 24 34 35 uses 36 UFormMain, UTargetInterpretter; 37 38 { TFormMemory } 39 40 procedure TFormMemory.Reload; 41 begin 42 if MainForm.CurrentTarget is TTargetInterpretter then 43 with TTargetInterpretter(MainForm.CurrentTarget) do begin 44 ListViewMemory.Items.Count := Trunc(Length(Memory) / RowSize); 45 ListViewMemory.Refresh; 46 end; 47 end; 48 49 procedure TFormMemory.ListViewMemoryData(Sender: TObject; Item: TListItem); 50 var 51 Row: string; 52 I: Integer; 53 begin 54 if MainForm.CurrentTarget is TTargetInterpretter then 55 with TTargetInterpretter(MainForm.CurrentTarget) do 56 if (Item.Index >= 0) and (Item.Index < Trunc(Length(Memory) / RowSize)) then begin 57 Item.Caption := IntToHex(Item.Index * RowSize, 8); 58 Row := ''; 59 for I := 0 to RowSize - 1 do 60 Row := Row + ' ' + IntToHex(Memory[Item.Index * RowSize + I], 2); 61 Item.SubItems.Add(Row); 62 end; 63 end; 64 65 25 66 end. 26 67
Note:
See TracChangeset
for help on using the changeset viewer.