Changeset 24 for trunk/IDE/Forms
- Timestamp:
- Nov 10, 2010, 9:42:27 AM (14 years ago)
- Location:
- trunk/IDE/Forms
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IDE/Forms/UCodeForm.pas
r21 r24 19 19 procedure SynEditSourceChange(Sender: TObject); 20 20 private 21 { private declarations } 21 FProjectFile: TProjectFile; 22 procedure SetProjectFile(const AValue: TProjectFile); 22 23 public 23 ProjectFile: TProjectFile; 24 property ProjectFile: TProjectFile read FProjectFile write SetProjectFile; 25 procedure Save; 24 26 end; 25 27 … … 41 43 end; 42 44 45 procedure TCodeForm.SetProjectFile(const AValue: TProjectFile); 46 begin 47 if FProjectFile = AValue then Exit; 48 FProjectFile := AValue; 49 if Assigned(AValue) then 50 SynEditSource.Lines.Assign(FProjectFile.Source) 51 else SynEditSource.ClearAll; 52 end; 53 54 procedure TCodeForm.Save; 55 begin 56 if Assigned(ProjectFile) then 57 ProjectFile.Source.Assign(SynEditSource.Lines); 58 end; 59 43 60 end. 44 61 -
trunk/IDE/Forms/UMainForm.lfm
r21 r24 1 1 object MainForm: TMainForm 2 Left = 3 622 Left = 336 3 3 Height = 501 4 Top = 1 154 Top = 102 5 5 Width = 695 6 6 Caption = 'Transpascal IDE' … … 152 152 Caption = 'New' 153 153 Hint = 'Create new project' 154 OnExecute = AProjectNewExecute 154 155 end 155 156 object AProjectOpen: TAction … … 164 165 Hint = 'Save project to disk' 165 166 OnExecute = AProjectSaveExecute 167 ShortCut = 16467 166 168 end 167 169 object AProjectSaveAs: TAction -
trunk/IDE/Forms/UMainForm.pas
r22 r24 7 7 uses 8 8 SysUtils, Variants, Classes, Graphics, Controls, Forms, 9 Dialogs, StdCtrls, UCompiler, Registry, 9 Dialogs, StdCtrls, UCompiler, Registry, Contnrs, 10 10 ComCtrls, ExtCtrls, SynEdit, SynHighlighterPas, 11 11 UProject, FileUtil, Menus, ActnList, UCoolDocking, … … 52 52 ToolBar1: TToolBar; 53 53 procedure AProjectCloseExecute(Sender: TObject); 54 procedure AProjectNewExecute(Sender: TObject); 54 55 procedure AProjectOpenExecute(Sender: TObject); 55 56 procedure AProjectSaveAsExecute(Sender: TObject); … … 91 92 procedure TMainForm.ABuildExecute(Sender: TObject); 92 93 begin 94 CodeForm.Save; 95 93 96 // Compile project file 94 97 if (ComboBoxAnalyzer.Items.Count > 0) and (ComboBoxAnalyzer.ItemIndex <> -1) and … … 208 211 begin 209 212 Project.LoadFromFile(FileName); 210 LastOpenedFiles.Add (FileName);213 LastOpenedFiles.AddItem(FileName); 211 214 LastOpenedFiles.ReloadMenu; 212 215 ProjectManager.UpdateProjectTree; … … 235 238 for I := 0 to Compiler.Producers.Count - 1 do 236 239 ComboBoxProducer.AddItem(Compiler.Producers[I].Name, nil); 240 237 241 ComboBoxAnalyzer.Clear; 238 242 for I := 0 to Compiler.Analyzers.Count - 1 do … … 289 293 end; 290 294 295 procedure TMainForm.AProjectNewExecute(Sender: TObject); 296 begin 297 Project.Clear; 298 Project.Name := 'New project'; 299 ProjectManager.UpdateProjectTree; 300 Caption := ApplicationInfo.Name + ' - ' + Project.Name; 301 end; 302 291 303 procedure TMainForm.AProjectSaveAsExecute(Sender: TObject); 292 304 begin 293 305 if SaveDialog1.Execute then begin 294 306 Project.SaveToFile(SaveDialog1.FileName); 307 CodeForm.Save; 295 308 Project.Save; 296 309 end; … … 299 312 procedure TMainForm.AProjectSaveExecute(Sender: TObject); 300 313 begin 314 CodeForm.Save; 301 315 Project.SaveToFile(Project.GetDir(True) + Project.Name + '.tppr'); 302 316 end; -
trunk/IDE/Forms/UMessagesForm.lfm
r2 r24 26 26 Width = 500 27 27 end> 28 ItemIndex = -129 28 OwnerData = True 30 29 ReadOnly = True -
trunk/IDE/Forms/UMessagesForm.pas
r2 r24 47 47 procedure TMessagesForm.ListView1Click(Sender: TObject); 48 48 begin 49 ListView1SelectItem(Self, ListView1.Selected, ListView1.Selected.Selected); 49 if Assigned(ListView1.Selected) then 50 ListView1SelectItem(Self, ListView1.Selected, ListView1.Selected.Selected); 50 51 end; 51 52 -
trunk/IDE/Forms/UProjectManager.pas
r23 r24 77 77 NewNode.Expand(True); 78 78 EndUpdate; 79 TreeViewProject.TopItem.Items[0].Selected := True; 79 if Assigned(TreeViewProject.TopItem) and 80 (TreeViewProject.TopItem.Count > 0) then 81 TreeViewProject.TopItem.Items[0].Selected := True 82 else CodeForm.ProjectFile := nil; 80 83 end; 81 84 end;
Note:
See TracChangeset
for help on using the changeset viewer.