| 101 |
|
procedure TForm_RawEdit.LoadRaw(raw_info: TRawDataInfo); |
| 102 |
|
var |
| 103 |
|
i: Integer; |
| 104 |
– |
mem: TMemoryStream; |
| 104 |
|
begin |
| 105 |
|
if hex.Modified then |
| 106 |
|
begin |
| 109 |
|
Exit; |
| 110 |
|
end; |
| 111 |
|
end; |
| 112 |
< |
if list_offset.Count = 0 then |
| 112 |
> |
for i := 0 to filelist.Count - 1 do |
| 113 |
|
begin |
| 114 |
< |
for i := 0 to filelist.Count - 1 do |
| 114 |
> |
if ConManager.Connection[ConnectionID].ExtractFileIDOfName(filelist.Items.Strings[i]) = Raw_Info.SrcID then |
| 115 |
|
begin |
| 116 |
< |
if ConManager.Connection[ConnectionID].ExtractFileIDOfName(filelist.Items.Strings[i]) = Raw_Info.SrcID then |
| 117 |
< |
begin |
| 118 |
< |
filelist.ItemIndex := i; |
| 120 |
< |
listClick(Self); |
| 121 |
< |
Break; |
| 122 |
< |
end; |
| 116 |
> |
filelist.ItemIndex := i; |
| 117 |
> |
listClick(Self); |
| 118 |
> |
Break; |
| 119 |
|
end; |
| 120 |
< |
for i := 0 to list_offset.Count - 1 do |
| 120 |
> |
end; |
| 121 |
> |
for i := 0 to list_offset.Count - 1 do |
| 122 |
> |
begin |
| 123 |
> |
if MidStr(list_offset.Items.Strings[i], 3, 8) = IntToHex(raw_info.SrcOffset, 8) then |
| 124 |
|
begin |
| 125 |
< |
if MidStr(list_offset.Items.Strings[i], 3, 8) = IntToHex(raw_info.SrcOffset, 8) then |
| 126 |
< |
begin |
| 127 |
< |
list_offset.ItemIndex := i; |
| 129 |
< |
Break; |
| 130 |
< |
end; |
| 125 |
> |
list_offset.ItemIndex := i; |
| 126 |
> |
list_offsetClick(Self); |
| 127 |
> |
Break; |
| 128 |
|
end; |
| 129 |
|
end; |
| 133 |
– |
mem := nil; |
| 134 |
– |
ConManager.Connection[ConnectionID].LoadRawFile(raw_info.SrcID, raw_info.SrcOffset, TStream(mem)); |
| 135 |
– |
hex.LoadFromStream(mem); |
| 136 |
– |
ClearValues; |
| 137 |
– |
hexSelectionChanged(Self); |
| 130 |
|
end; |
| 131 |
|
|
| 132 |
|
|
| 135 |
|
|
| 136 |
|
|
| 137 |
|
procedure TForm_RawEdit.list_offsetClick(Sender: TObject); |
| 138 |
+ |
var |
| 139 |
+ |
mem: TMemoryStream; |
| 140 |
+ |
rawinfo: TRawDataInfo; |
| 141 |
|
begin |
| 147 |
– |
ClearValues; |
| 142 |
|
datoffset := StrToInt('$' + MidStr( |
| 143 |
|
list_offset.Items.Strings[list_offset.ItemIndex], 3, 8)); |
| 144 |
< |
LoadRaw(ConManager.Connection[ConnectionID].GetRawInfo(fileid, datoffset)); |
| 144 |
> |
|
| 145 |
> |
rawinfo := ConManager.Connection[ConnectionID].GetRawInfo(fileid, datoffset); |
| 146 |
> |
|
| 147 |
> |
mem := nil; |
| 148 |
> |
ConManager.Connection[ConnectionID].LoadRawFile(rawinfo.SrcID, rawinfo.SrcOffset, TStream(mem)); |
| 149 |
> |
hex.LoadFromStream(mem); |
| 150 |
> |
ClearValues; |
| 151 |
> |
hexSelectionChanged(Self); |
| 152 |
|
end; |
| 153 |
|
|
| 154 |
|
|