- Timestamp:
- Feb 19, 2012, 2:13:49 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r39 r40 169 169 procedure AProjectOpenRecentExecute(Sender: TObject); 170 170 procedure TargetStateChanged(Sender: TObject); 171 procedure MessagesChanged(Sender: TObject); 171 172 procedure MenuItemTargetClick(Sender: TObject); 172 173 procedure ProjectOpen(FileName: string); … … 191 192 MainForm: TMainForm; 192 193 194 193 195 implementation 194 196 … … 204 206 SNumberGeneration = 'Number generation'; 205 207 SProgramExited = 'Program exited'; 208 SProgramStarted = 'Program started'; 209 SProgramStopped = 'Program stopped'; 210 SNewProject = 'New project'; 206 211 207 212 { TMainForm } … … 259 264 if CurrentTarget.State = rsPaused then 260 265 AProgramShowExecutionPoint.Execute; 266 if CurrentTarget.State = rsStopped then CurrentTarget.Messages.AddMessage(SProgramStopped); 267 end; 268 269 procedure TMainForm.MessagesChanged(Sender: TObject); 270 begin 271 FormMessages.Reload; 261 272 end; 262 273 … … 275 286 procedure TMainForm.ProjectOpen(FileName: string); 276 287 begin 288 AProjectClose.Execute; 277 289 MemoSource.Lines.LoadFromFile(UTF8Decode(FileName)); 278 290 LastOpenedList.AddItem(FileName); … … 292 304 TTarget(Targets[I]).OnChangeState := nil; 293 305 FCurrentTarget.OnChangeState := TargetStateChanged; 306 FCurrentTarget.Messages.OnChange := MessagesChanged; 294 307 UpdateInterface; 295 308 end; … … 317 330 FormMemory.Align := alClient; 318 331 FormMemory.Show; 319 FormMess sages.ManualDock(TabSheetMessages, nil, alClient);320 FormMess sages.Align := alClient;321 FormMess sages.Show;332 FormMessages.ManualDock(TabSheetMessages, nil, alClient); 333 FormMessages.Align := alClient; 334 FormMessages.Show; 322 335 PageControlRight.Width := MainForm.Width div 2; 323 336 PageControlBottom.Height := MainForm.Height div 5; … … 444 457 if not CurrentTarget.Compiled then AProgramCompile.Execute; 445 458 CurrentTarget.Run; 459 CurrentTarget.Messages.AddMessage(SProgramStarted); 446 460 end; 447 461 … … 560 574 begin 561 575 with CurrentTarget do begin 562 Stop;576 AProgramStop.Execute; 563 577 Optimization := coNormal; 564 578 SourceCode := MemoSource.Text; 565 579 ProgramName := ExtractFileNameOnly(ProjectFileName); 580 CurrentTarget.Messages.AddMessage('Compiling...'); 566 581 Compile; 582 CurrentTarget.Messages.AppendMessage('done'); 567 583 MemoTarget.Text := TargetCode; 568 584 UpdateInterface; … … 645 661 procedure TMainForm.AProjectCloseExecute(Sender: TObject); 646 662 begin 663 AProgramStop.Execute; 647 664 Modified := False; 648 665 ProjectFileName := ''; … … 653 670 procedure TMainForm.AProjectNewExecute(Sender: TObject); 654 671 begin 655 ProjectFileName := 'Examples' + DirectorySeparator + 'Project.b'; 672 AProjectClose.Execute; 673 ProjectFileName := 'Examples' + DirectorySeparator + SNewProject + '.b'; 656 674 MemoSource.Clear; 657 675 Modified := False; -
trunk/Forms/UFormMessages.lfm
r39 r40 1 object FormMess sages: TFormMesssages1 object FormMessages: TFormMessages 2 2 Left = 256 3 Height = 2 404 Top = 325 Width = 3203 Height = 225 4 Top = 47 5 Width = 492 6 6 Caption = 'Messages' 7 ClientHeight = 240 8 ClientWidth = 320 7 ClientHeight = 225 8 ClientWidth = 492 9 OnCreate = FormCreate 9 10 LCLVersion = '0.9.31' 10 object MemoMessages: TMemo11 object ListView1: TListView 11 12 Left = 0 12 Height = 2 4013 Height = 225 13 14 Top = 0 14 Width = 32015 Width = 492 15 16 Align = alClient 17 Columns = < 18 item 19 Width = 473 20 end> 21 OwnerData = True 22 ReadOnly = True 23 RowSelect = True 24 ShowColumnHeaders = False 16 25 TabOrder = 0 26 ViewStyle = vsReport 27 OnData = ListView1Data 17 28 end 18 29 end -
trunk/Forms/UFormMessages.lrt
r39 r40 1 TFORMMESS SAGES.CAPTION=Messages1 TFORMMESSAGES.CAPTION=Messages -
trunk/Forms/UFormMessages.pas
r38 r40 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls; 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ComCtrls; 9 10 10 11 type 11 12 12 { TFormMess sages }13 { TFormMessages } 13 14 14 TFormMesssages = class(TForm) 15 MemoMessages: TMemo; 15 TFormMessages = class(TForm) 16 ListView1: TListView; 17 procedure FormCreate(Sender: TObject); 18 procedure ListView1Data(Sender: TObject; Item: TListItem); 16 19 private 17 20 { private declarations } 18 21 public 19 { public declarations }22 procedure Reload; 20 23 end; 21 24 22 25 var 23 FormMess sages: TFormMesssages;26 FormMessages: TFormMessages; 24 27 25 28 implementation … … 27 30 {$R *.lfm} 28 31 32 uses 33 UFormMain, UTarget; 34 35 { TFormMessages } 36 37 procedure TFormMessages.ListView1Data(Sender: TObject; Item: TListItem); 38 begin 39 with MainForm.CurrentTarget do 40 if (Item.Index >= 0) and (Item.Index < Messages.Count) then 41 with TMessage(Messages[Item.Index]) do begin 42 Item.Caption := Text; 43 Item.Data := Messages[Item.Index]; 44 end; 45 end; 46 47 procedure TFormMessages.FormCreate(Sender: TObject); 48 begin 49 50 end; 51 52 procedure TFormMessages.Reload; 53 begin 54 ListView1.Items.Count := MainForm.CurrentTarget.Messages.Count; 55 ListView1.Refresh; 56 end; 57 29 58 end. 30 59 -
trunk/Languages/LazFuckIDE.cs.po
r39 r40 113 113 msgstr "Data" 114 114 115 #: tformmessages.caption 116 msgctxt "tformmessages.caption" 117 msgid "Messages" 118 msgstr "Zprávy" 119 115 120 #: tformmesssages.caption 116 121 #| msgid "Messsages" … … 463 468 msgstr "Zadejte ÄÃslo" 464 469 470 #: uformmain.snewproject 471 msgid "New project" 472 msgstr "" 473 465 474 #: uformmain.snumbergeneration 466 475 msgctxt "uformmain.snumbergeneration" … … 473 482 msgstr "Program ukonÄen" 474 483 484 #: uformmain.sprogramstarted 485 msgid "Program started" 486 msgstr "" 487 488 #: uformmain.sprogramstopped 489 msgid "Program stopped" 490 msgstr "" 491 475 492 #: uformtargets.scompileroptions 476 493 msgctxt "uformtargets.scompileroptions" -
trunk/Languages/LazFuckIDE.po
r39 r40 104 104 msgstr "" 105 105 106 #: tformmessages.caption 107 msgctxt "TFORMMESSAGES.CAPTION" 108 msgid "Messages" 109 msgstr "" 110 106 111 #: tformmesssages.caption 107 112 msgctxt "tformmesssages.caption" … … 452 457 msgstr "" 453 458 459 #: uformmain.snewproject 460 msgid "New project" 461 msgstr "" 462 454 463 #: uformmain.snumbergeneration 455 464 msgctxt "uformmain.snumbergeneration" … … 462 471 msgstr "" 463 472 473 #: uformmain.sprogramstarted 474 msgid "Program started" 475 msgstr "" 476 477 #: uformmain.sprogramstopped 478 msgid "Program stopped" 479 msgstr "" 480 464 481 #: uformtargets.scompileroptions 465 482 msgctxt "uformtargets.scompileroptions" -
trunk/LazFuckIDE.lpi
r38 r40 181 181 <Filename Value="Forms\UFormMessages.pas"/> 182 182 <IsPartOfProject Value="True"/> 183 <ComponentName Value="FormMess sages"/>183 <ComponentName Value="FormMessages"/> 184 184 <ResourceBaseClass Value="Form"/> 185 185 <UnitName Value="UFormMessages"/> -
trunk/LazFuckIDE.lpr
r38 r40 9 9 {$ENDIF} 10 10 Interfaces, // this includes the LCL widgetset 11 11 Forms, UApplicationInfo, UTarget, UTargetC, UTargetDelphi, 12 12 UTargetInterpretter, UTargetPHP, UFormCPU, UFormMain, 13 13 UFormOptions, CoolTranslator, Common, 14 14 TemplateGenerics, UFormTargets, UFormOutput, UFormInput, UFormMemory, 15 UFormMessages;15 UFormMessages; 16 16 17 17 {$R *.res} … … 28 28 Application.CreateForm(TFormInput, FormInput); 29 29 Application.CreateForm(TFormMemory, FormMemory); 30 Application.CreateForm(TFormMess sages, FormMesssages);30 Application.CreateForm(TFormMessages, FormMessages); 31 31 Application.Run; 32 32 end. -
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 -
trunk/Target/UTargetInterpretter.pas
r39 r40 49 49 procedure CommandLoopStart; 50 50 procedure CommandLoopEnd; 51 procedure Reset;52 51 procedure PrepareBreakPoints; 53 52 protected … … 67 66 Input: string; 68 67 InputPosition: Integer; 68 procedure Reset; override; 69 69 procedure Compile; override; 70 70 procedure Run; override; … … 305 305 I: Integer; 306 306 begin 307 inherited; 307 308 PrepareJumpTable; 308 309 SourcePosition := 0;
Note:
See TracChangeset
for help on using the changeset viewer.