Changeset 6 for trunk/UMainForm.pas
- Timestamp:
- Feb 9, 2012, 3:22:38 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UMainForm.pas
r5 r6 16 16 ACompile: TAction; 17 17 AAbout: TAction; 18 AProgramPause: TAction; 19 AProgramStop: TAction; 18 20 AHelp: TAction; 19 A Run: TAction;21 AProgramRun: TAction; 20 22 AProjectNew: TAction; 21 23 AExit: TAction; … … 34 36 MenuItem13: TMenuItem; 35 37 MenuItem14: TMenuItem; 38 MenuItem15: TMenuItem; 39 MenuItem16: TMenuItem; 40 MenuItem17: TMenuItem; 36 41 MenuItem2: TMenuItem; 37 42 MenuItem3: TMenuItem; … … 55 60 ToolButton7: TToolButton; 56 61 procedure AExitExecute(Sender: TObject); 62 procedure AProgramPauseExecute(Sender: TObject); 63 procedure AProgramStopExecute(Sender: TObject); 57 64 procedure AProjectCloseExecute(Sender: TObject); 58 65 procedure AProjectNewExecute(Sender: TObject); … … 60 67 procedure AProjectSaveAsExecute(Sender: TObject); 61 68 procedure AProjectSaveExecute(Sender: TObject); 62 procedure A RunExecute(Sender: TObject);69 procedure AProgramRunExecute(Sender: TObject); 63 70 procedure FormCloseQuery(Sender: TObject; var CanClose: boolean); 64 71 procedure FormCreate(Sender: TObject); … … 67 74 procedure MemoSourceChange(Sender: TObject); 68 75 private 69 { private declarations }76 procedure BrainFuckInterpreterChangeState(Sender: TObject); 70 77 public 71 78 Modified: Boolean; … … 95 102 begin 96 103 Modified := True; 104 UpdateInterface; 105 end; 106 107 procedure TMainForm.BrainFuckInterpreterChangeState(Sender: TObject); 108 begin 97 109 UpdateInterface; 98 110 end; … … 109 121 MemoSource.Enabled := ProjectFileName <> ''; 110 122 AProjectClose.Enabled := ProjectFileName <> ''; 111 ARun.Enabled := ProjectFileName <> ''; 123 AProgramRun.Enabled := (ProjectFileName <> '') and (BrainFuckInterpreter.State = rsStopped); 124 AProgramPause.Enabled := (ProjectFileName <> '') and (BrainFuckInterpreter.State = rsRunning); 125 AProgramStop.Enabled := (ProjectFileName <> '') and (BrainFuckInterpreter.State <> rsStopped); 112 126 ACompile.Enabled := ProjectFileName <> ''; 113 127 end; … … 116 130 begin 117 131 BrainFuckInterpreter := TBrainFuckInterpreter.Create; 132 BrainFuckInterpreter.OnChangeState := BrainFuckInterpreterChangeState; 118 133 end; 119 134 … … 123 138 end; 124 139 125 procedure TMainForm.A RunExecute(Sender: TObject);140 procedure TMainForm.AProgramRunExecute(Sender: TObject); 126 141 begin 127 142 InterpreterForm.Show; … … 138 153 begin 139 154 Close; 155 end; 156 157 procedure TMainForm.AProgramPauseExecute(Sender: TObject); 158 begin 159 MainForm.BrainFuckInterpreter.Pause 160 end; 161 162 procedure TMainForm.AProgramStopExecute(Sender: TObject); 163 begin 164 MainForm.BrainFuckInterpreter.Stop; 140 165 end; 141 166
Note:
See TracChangeset
for help on using the changeset viewer.