Changeset 9 for trunk/UMainForm.pas
- Timestamp:
- Feb 9, 2012, 4:10:10 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UMainForm.pas
r7 r9 16 16 ACompile: TAction; 17 17 AAbout: TAction; 18 AViewCompiled: TAction; 19 AViewInterpretter: TAction; 18 20 AProgramPause: TAction; 19 21 AProgramStop: TAction; … … 39 41 MenuItem16: TMenuItem; 40 42 MenuItem17: TMenuItem; 43 MenuItem18: TMenuItem; 44 MenuItem19: TMenuItem; 41 45 MenuItem2: TMenuItem; 46 MenuItem20: TMenuItem; 47 MenuItem40: TMenuItem; 48 MenuItem21: TMenuItem; 42 49 MenuItem3: TMenuItem; 43 50 MenuItem4: TMenuItem; … … 59 66 ToolButton6: TToolButton; 60 67 ToolButton7: TToolButton; 68 procedure ACompileExecute(Sender: TObject); 61 69 procedure AExitExecute(Sender: TObject); 62 70 procedure AProgramPauseExecute(Sender: TObject); … … 68 76 procedure AProjectSaveExecute(Sender: TObject); 69 77 procedure AProgramRunExecute(Sender: TObject); 78 procedure AViewCompiledExecute(Sender: TObject); 79 procedure AViewInterpretterExecute(Sender: TObject); 70 80 procedure FormCloseQuery(Sender: TObject; var CanClose: boolean); 71 81 procedure FormCreate(Sender: TObject); … … 78 88 Modified: Boolean; 79 89 ProjectFileName: string; 90 BrainFuckCompiler: TBrainFuckCompiler; 80 91 BrainFuckInterpreter: TBrainFuckInterpretter; 81 92 procedure UpdateInterface; … … 90 101 91 102 uses 92 UInterpreterForm, UApplicationInfo ;103 UInterpreterForm, UApplicationInfo, UCompiledForm; 93 104 94 105 { TMainForm } … … 131 142 BrainFuckInterpreter := TBrainFuckInterpretter.Create; 132 143 BrainFuckInterpreter.OnChangeState := BrainFuckInterpreterChangeState; 144 BrainFuckCompiler := TBrainFuckCompiler.Create; 133 145 end; 134 146 135 147 procedure TMainForm.FormDestroy(Sender: TObject); 136 148 begin 149 BrainFuckCompiler.Free; 137 150 BrainFuckInterpreter.Free; 138 151 end; … … 146 159 end; 147 160 161 procedure TMainForm.AViewCompiledExecute(Sender: TObject); 162 begin 163 CompiledForm.Show; 164 end; 165 166 procedure TMainForm.AViewInterpretterExecute(Sender: TObject); 167 begin 168 InterpreterForm.Show; 169 end; 170 148 171 procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: boolean); 149 172 begin 173 if Modified then AProjectSaveAs.Execute; 150 174 end; 151 175 … … 153 177 begin 154 178 Close; 179 end; 180 181 procedure TMainForm.ACompileExecute(Sender: TObject); 182 begin 183 BrainFuckCompiler.Source := MemoSource.Text; 184 BrainFuckCompiler.Compile; 185 CompiledForm.MemoCompiled.Text := BrainFuckCompiler.Output; 186 CompiledForm.Show; 155 187 end; 156 188
Note:
See TracChangeset
for help on using the changeset viewer.