Changeset 40 for trunk/Target/UTarget.pas
- Timestamp:
- Feb 19, 2012, 2:13:49 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Target/UTarget.pas
r39 r40 47 47 procedure ClearSystem; 48 48 function SearchByTargetPos(Pos: Integer): TBreakPoint; 49 end; 50 51 TMessage = class 52 Text: string; 53 Position: TPoint; 54 end; 55 56 { TMessageList } 57 58 TMessageList = class(TListObject) 59 private 60 FOnChange: TNotifyEvent; 61 procedure DoChange; 62 public 63 procedure AddMessage(Text: string); 64 procedure AppendMessage(Text: string); 65 property OnChange: TNotifyEvent read FOnChange write FOnChange; 49 66 end; 50 67 … … 77 94 BreakPoints: TBreakPointList; 78 95 DebugSteps: TDebugStepList; 96 Messages: TMessageList; 79 97 constructor Create; virtual; 80 98 destructor Destroy; override; 99 procedure Reset; virtual; 81 100 procedure OptimizeSource; 82 101 procedure Compile; virtual; … … 115 134 implementation 116 135 136 { TMessageList } 137 138 procedure TMessageList.DoChange; 139 begin 140 if Assigned(FOnChange) then FOnChange(Self); 141 end; 142 143 procedure TMessageList.AddMessage(Text: string); 144 var 145 NewItem: TMessage; 146 begin 147 NewItem := TMessage.Create; 148 NewItem.Text := Text; 149 Add(NewItem); 150 DoChange; 151 end; 152 153 procedure TMessageList.AppendMessage(Text: string); 154 begin 155 if Count > 0 then begin 156 TMessage(Last).Text := TMessage(Last).Text + Text; 157 DoChange; 158 end else AddMessage(Text); 159 end; 160 117 161 { TBreakPointList } 118 162 … … 287 331 BreakPoints := TBreakPointList.Create; 288 332 DebugSteps := TDebugStepList.Create; 333 Messages := TMessageList.Create; 289 334 end; 290 335 291 336 destructor TTarget.Destroy; 292 337 begin 338 Messages.Free; 293 339 DebugSteps.Free;; 294 340 BreakPoints.Free; 295 341 inherited Destroy; 342 end; 343 344 procedure TTarget.Reset; 345 begin 346 Messages.Clear; 296 347 end; 297 348 … … 359 410 procedure TTarget.Stop; 360 411 begin 361 362 412 end; 363 413
Note:
See TracChangeset
for help on using the changeset viewer.