Changeset 40 for trunk/Forms/UFormMain.pas
- Timestamp:
- Feb 19, 2012, 2:13:49 PM (13 years ago)
- File:
-
- 1 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;
Note:
See TracChangeset
for help on using the changeset viewer.