Changeset 69 for branches/Transpascal/Forms
- Timestamp:
- Oct 19, 2010, 7:19:53 AM (15 years ago)
- Location:
- branches/Transpascal/Forms
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Transpascal/Forms/UMainForm.pas
r67 r69 59 59 ReopenLastOpenedFile: Boolean; 60 60 procedure OpenRecentClick(Sender: TObject); 61 procedure LoadErrorMessages;62 61 procedure DockInit; 63 62 procedure LoadFromRegistry; … … 112 111 113 112 ProjectManager.TreeViewProjectChange(Self, ProjectManager.TreeViewProject.Selected); 114 LoadErrorMessages; 115 end; 116 117 procedure TMainForm.LoadErrorMessages; 118 var 119 I: Integer; 120 begin 121 with MessagesForm do begin 122 ListBoxMessages.Clear; 123 for I := 0 to Compiler.ErrorMessages.Count - 1 do 124 with TErrorMessage(Compiler.ErrorMessages[I]) do 125 ListBoxMessages.Items.Add(FileName + '(' + IntToStr(Position.X) + 126 ',' + IntToStr(Position.Y) + ') ' + Text); 127 end; 113 MessagesForm.Reload; 128 114 end; 129 115 -
branches/Transpascal/Forms/UMessagesForm.lfm
r64 r69 8 8 ClientWidth = 320 9 9 LCLVersion = '0.9.29' 10 object List BoxMessages: TListBox10 object ListView1: TListView 11 11 Left = 0 12 12 Height = 240 … … 14 14 Width = 320 15 15 Align = alClient 16 ItemHeight = 0 17 OnSelectionChange = ListBoxMessagesSelectionChange 16 Columns = < 17 item 18 Caption = 'File' 19 Width = 80 20 end 21 item 22 Caption = 'Position' 23 end 24 item 25 Caption = 'Message' 26 Width = 500 27 end> 28 ItemIndex = -1 29 OwnerData = True 30 ReadOnly = True 31 RowSelect = True 18 32 TabOrder = 0 33 ViewStyle = vsReport 34 OnClick = ListView1Click 35 OnData = ListView1Data 36 OnSelectItem = ListView1SelectItem 19 37 end 20 38 object CoolDockClient1: TCoolDockClient -
branches/Transpascal/Forms/UMessagesForm.pas
r67 r69 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 UCoolDocking, UProject, UCompiler;9 ComCtrls, UCoolDocking, UProject, UCompiler; 10 10 11 11 type … … 15 15 TMessagesForm = class(TForm) 16 16 CoolDockClient1: TCoolDockClient; 17 List BoxMessages: TListBox;17 ListView1: TListView; 18 18 procedure ListBoxMessagesSelectionChange(Sender: TObject; User: boolean); 19 procedure ListView1Click(Sender: TObject); 20 procedure ListView1Data(Sender: TObject; Item: TListItem); 21 procedure ListView1SelectItem(Sender: TObject; Item: TListItem; 22 Selected: Boolean); 19 23 private 20 24 { private declarations } 21 25 public 22 { public declarations }26 procedure Reload; 23 27 end; 24 28 … … 37 41 procedure TMessagesForm.ListBoxMessagesSelectionChange(Sender: TObject; 38 42 User: boolean); 43 begin 44 45 end; 46 47 procedure TMessagesForm.ListView1Click(Sender: TObject); 48 begin 49 ListView1SelectItem(Self, ListView1.Selected, ListView1.Selected.Selected); 50 end; 51 52 procedure TMessagesForm.ListView1Data(Sender: TObject; Item: TListItem); 53 begin 54 with MainForm, CodeForm do 55 with TErrorMessage(Compiler.ErrorMessages[Item.Index]) do begin 56 Item.Caption := FileName; 57 Item.Data := Compiler.ErrorMessages[Item.Index]; 58 Item.SubItems.Add(IntToStr(Position.X) + ',' + IntToStr(Position.Y)); 59 Item.SubItems.Add(Text); 60 end; 61 end; 62 63 procedure TMessagesForm.ListView1SelectItem(Sender: TObject; Item: TListItem; 64 Selected: Boolean); 39 65 var 40 66 ProjectFile: TProjectFile; 41 67 begin 42 68 with MainForm, CodeForm do 43 if ListBoxMessages.ItemIndex <> -1then44 with TErrorMessage( Compiler.ErrorMessages[ListBoxMessages.ItemIndex]) do begin69 if Assigned(ListView1.Selected) then 70 with TErrorMessage(ListView1.Selected.Data) do begin 45 71 ProjectFile := Project.SearchFile(FileName); 46 72 if Assigned(ProjectFile) then … … 52 78 end; 53 79 80 procedure TMessagesForm.Reload; 81 begin 82 ListView1.Items.Count := MainForm.Compiler.ErrorMessages.Count; 83 ListView1.Refresh; 84 end; 85 54 86 end. 55 87
Note:
See TracChangeset
for help on using the changeset viewer.