Changeset 12 for trunk/UMainForm.pas
- Timestamp:
- Feb 11, 2012, 4:32:27 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 3 3 LazFuckIDE.lps 4 4 backup 5 LazFuckIDE
-
- Property svn:ignore
-
trunk/UMainForm.pas
r11 r12 16 16 ACompile: TAction; 17 17 AAbout: TAction; 18 ABreakpointSet: TAction; 19 ABreakpointUnset: TAction; 20 AInterpretterStepOut: TAction; 21 AInterpretterRunToCursor: TAction; 22 AInterpretterStopOver: TAction; 23 AInterpretterStepInto: TAction; 18 24 AViewCompiled: TAction; 19 25 AViewInterpretter: TAction; … … 83 89 procedure FormShow(Sender: TObject); 84 90 procedure MemoSourceChange(Sender: TObject); 91 procedure MemoSourceKeyDown(Sender: TObject; var Key: Word; 92 Shift: TShiftState); 93 procedure MemoSourceKeyPress(Sender: TObject; var Key: char); 94 procedure MemoSourceKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState 95 ); 96 procedure MemoSourceMouseDown(Sender: TObject; Button: TMouseButton; 97 Shift: TShiftState; X, Y: Integer); 85 98 private 86 99 procedure BrainFuckInterpreterChangeState(Sender: TObject); … … 91 104 BrainFuckInterpreter: TBrainFuckInterpretter; 92 105 procedure UpdateInterface; 106 procedure UpdateStatusBar; 93 107 end; 94 108 … … 114 128 Modified := True; 115 129 UpdateInterface; 130 end; 131 132 procedure TMainForm.MemoSourceKeyDown(Sender: TObject; var Key: Word; 133 Shift: TShiftState); 134 begin 135 end; 136 137 procedure TMainForm.MemoSourceKeyPress(Sender: TObject; var Key: char); 138 begin 139 end; 140 141 procedure TMainForm.MemoSourceKeyUp(Sender: TObject; var Key: Word; 142 Shift: TShiftState); 143 begin 144 UpdateStatusBar; 145 end; 146 147 procedure TMainForm.MemoSourceMouseDown(Sender: TObject; Button: TMouseButton; 148 Shift: TShiftState; X, Y: Integer); 149 begin 150 UpdateStatusBar; 116 151 end; 117 152 … … 136 171 AProgramStop.Enabled := (ProjectFileName <> '') and (BrainFuckInterpreter.State <> rsStopped); 137 172 ACompile.Enabled := ProjectFileName <> ''; 173 UpdateStatusBar; 174 end; 175 176 procedure TMainForm.UpdateStatusBar; 177 begin 178 StatusBar1.Panels[0].Text := IntToStr(MemoSource.CaretPos.X) + ', ' + IntToStr(MemoSource.CaretPos.Y); 138 179 end; 139 180 … … 152 193 153 194 procedure TMainForm.AProgramRunExecute(Sender: TObject); 195 var 196 SourceText: string; 154 197 begin 155 198 InterpreterForm.Show; 156 199 BrainFuckInterpreter.Input := InterpreterForm.MemoInput.Lines.Text; 157 BrainFuckInterpreter.Source := MemoSource.Lines.Text; 200 SourceText := MemoSource.Lines.Text; 201 SetLength(BrainFuckInterpreter.Source, Length(SourceText)); 202 Move(Pointer(SourceText)^, Pointer(BrainFuckInterpreter.Source)^, Length(SourceText)); 158 203 BrainFuckInterpreter.Run; 159 204 end;
Note:
See TracChangeset
for help on using the changeset viewer.