Changeset 6 for trunk/Forms
- Timestamp:
- May 6, 2015, 11:19:49 AM (10 years ago)
- Location:
- trunk/Forms
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormBrowse.lfm
r4 r6 7 7 ClientHeight = 526 8 8 ClientWidth = 722 9 LCLVersion = '1. 3'9 LCLVersion = '1.5' 10 10 object TreeView1: TTreeView 11 11 Left = 0 … … 32 32 item 33 33 Caption = 'Name' 34 Width = 300 34 35 end 35 36 item 36 37 Caption = 'Revision' 38 Width = 80 37 39 end 38 40 item 39 41 Caption = 'Last change date' 42 Width = 100 40 43 end 41 44 item 42 45 Caption = 'Last author' 46 Width = 100 43 47 end 44 48 item … … 46 50 Width = 259 47 51 end> 52 OwnerData = True 48 53 ReadOnly = True 49 54 RowSelect = True 50 55 TabOrder = 2 51 56 ViewStyle = vsReport 57 OnData = ListView1Data 52 58 end 53 59 end -
trunk/Forms/UFormBrowse.pas
r3 r6 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 9 ExtCtrls ;9 ExtCtrls, UFindFile; 10 10 11 11 type … … 17 17 Splitter1: TSplitter; 18 18 TreeView1: TTreeView; 19 procedure ListView1Data(Sender: TObject; Item: TListItem); 19 20 private 20 { private declarations }21 FileList: TStringList; 21 22 public 23 Directory: string; 22 24 procedure ReloadList; 23 25 end; … … 32 34 { TFormBrowse } 33 35 36 procedure TFormBrowse.ListView1Data(Sender: TObject; Item: TListItem); 37 begin 38 if (Item.Index >= 0) and (Item.Index < FileList.Count) then begin 39 Item.Caption := ExtractFileName(FileList[Item.Index]); 40 end; 41 end; 42 34 43 procedure TFormBrowse.ReloadList; 44 var 45 FindFile: TFindFile; 46 I: Integer; 35 47 begin 36 48 FindFile := TFindFile.Create(nil); 49 FindFile.Path := Directory; 50 FindFile.FileMask := '*.*'; 51 FindFile.InSubFolders := False; 52 FileList := FindFile.SearchForFiles; 53 for I := FileList.Count - 1 downto 0 do 54 if ExtractFileName(FileList[I]) = '.' then FileList.Delete(I); 55 ListView1.Items.Count := FileList.Count; 56 ListView1.Refresh; 37 57 end; 38 58 -
trunk/Forms/UFormConsole.lfm
r5 r6 3 3 Height = 727 4 4 Top = 261 5 Width = 9 845 Width = 975 6 6 Caption = 'Console' 7 7 ClientHeight = 727 8 ClientWidth = 9 848 ClientWidth = 975 9 9 OnClose = FormClose 10 10 OnCreate = FormCreate 11 11 OnDestroy = FormDestroy 12 12 OnShow = FormShow 13 LCLVersion = '1.3' 14 object MemoOutput: TMemo 13 Position = poMainFormCenter 14 LCLVersion = '1.5' 15 object Memo1: TMemo 15 16 Left = 4 16 17 Height = 674 17 18 Top = 48 18 Width = 9 7519 Width = 966 19 20 Align = alCustom 20 21 Anchors = [akTop, akLeft, akRight, akBottom] … … 26 27 TabOrder = 0 27 28 end 29 object ButtonAbort: TButton 30 Left = 895 31 Height = 25 32 Top = 8 33 Width = 75 34 Anchors = [akTop, akRight] 35 Caption = 'Abort' 36 OnClick = ButtonAbortClick 37 TabOrder = 1 38 end 28 39 object EditCommand: TEdit 29 40 Left = 4 30 41 Height = 32 31 42 Top = 7 32 Width = 8 9343 Width = 884 33 44 Anchors = [akTop, akLeft, akRight] 34 45 ReadOnly = True 35 TabOrder = 146 TabOrder = 2 36 47 end 37 object ToolBar1: TToolBar 38 Left = 902 39 Height = 34 40 Top = 8 41 Width = 77 42 Align = alCustom 43 Anchors = [akTop, akRight] 44 Caption = 'ToolBar1' 45 EdgeInner = esNone 46 EdgeOuter = esNone 47 ShowCaptions = True 48 TabOrder = 2 49 object ToolButton1: TToolButton 50 Left = 1 51 Top = 0 52 Action = AAbort 53 AutoSize = True 54 DropdownMenu = PopupMenu1 55 Style = tbsDropDown 56 end 57 end 58 object ActionList1: TActionList 59 left = 265 60 top = 130 61 object AAbort: TAction 62 Caption = 'Abort' 63 OnExecute = AAbortExecute 64 end 65 object ARestart: TAction 66 Caption = 'Restart' 67 end 68 end 69 object PopupMenu1: TPopupMenu 70 left = 264 71 top = 232 72 object MenuItem1: TMenuItem 73 Action = AAbort 74 end 75 object MenuItem2: TMenuItem 76 Action = ARestart 77 end 48 object Timer1: TTimer 49 Enabled = False 50 Interval = 1 51 OnTimer = Timer1Timer 52 left = 72 53 top = 112 78 54 end 79 55 end -
trunk/Forms/UFormConsole.pas
r5 r6 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 Buttons, ComCtrls, ActnList, Menus, Process;9 ExtCtrls, Process; 10 10 11 11 type … … 14 14 15 15 TFormConsole = class(TForm) 16 AAbort: TAction; 17 ARestart: TAction; 18 ActionList1: TActionList; 16 ButtonAbort: TButton; 19 17 EditCommand: TEdit; 20 MemoOutput: TMemo; 21 MenuItem1: TMenuItem; 22 MenuItem2: TMenuItem; 23 PopupMenu1: TPopupMenu; 24 ToolBar1: TToolBar; 25 ToolButton1: TToolButton; 26 procedure AAbortExecute(Sender: TObject); 18 Memo1: TMemo; 19 Timer1: TTimer; 20 procedure ButtonAbortClick(Sender: TObject); 27 21 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 28 22 procedure FormCreate(Sender: TObject); 29 23 procedure FormDestroy(Sender: TObject); 30 24 procedure FormShow(Sender: TObject); 25 procedure Timer1Timer(Sender: TObject); 31 26 private 32 27 Process: TProcess; … … 36 31 Parameters: TStringList; 37 32 WorkingDir: string; 38 Environment: TStringList;33 Environment: string; 39 34 Aborted: Boolean; 40 Duration: TDateTime;35 Log: TStringList; 41 36 procedure Perform; 42 37 end; … … 47 42 implementation 48 43 49 uses50 UFormMain;51 52 44 {$R *.lfm} 53 45 … … 57 49 begin 58 50 Parameters := TStringList.Create; 59 Parameters.QuoteChar := ' '; 60 Parameters.Delimiter := ' '; 61 Environment := TStringList.Create; 62 Environment.QuoteChar := ' '; 63 Environment.Delimiter := ' '; 51 Log := TStringList.Create; 64 52 end; 65 53 66 54 procedure TFormConsole.FormDestroy(Sender: TObject); 67 55 begin 68 Environment.Free;56 Log.Free; 69 57 Parameters.Free; 70 58 end; … … 72 60 procedure TFormConsole.FormShow(Sender: TObject); 73 61 begin 74 //FormMain.PersistentForm1.Load(Self);75 MemoOutput.Clear;76 AAbort.Enabled := False;62 Memo1.Clear; 63 ButtonAbort.Enabled := False; 64 Timer1.Enabled := True; 77 65 end; 78 66 79 procedure TFormConsole.AAbortExecute(Sender: TObject); 67 procedure TFormConsole.Timer1Timer(Sender: TObject); 68 begin 69 Timer1.Enabled := False; 70 Perform; 71 end; 72 73 procedure TFormConsole.ButtonAbortClick(Sender: TObject); 80 74 begin 81 75 if Assigned(Process) then begin … … 88 82 ); 89 83 begin 90 AAbort.Execute; 91 //FormMain.PersistentForm1.Save(Self); 84 ButtonAbort.Click; 92 85 end; 93 86 … … 99 92 Line: string; 100 93 CommandLine: string; 101 TimeStart: TDateTime;102 94 begin 103 TimeStart := Now;104 if not Visible then Show;105 95 Text := ''; 106 96 try 107 97 Process := TProcess.Create(nil); 108 98 Aborted := False; 109 AAbort.Enabled := True;99 ButtonAbort.Enabled := True; 110 100 if WorkingDir <> '' then 111 101 Process.CurrentDirectory := WorkingDir; 112 102 //WorkingDir := ''; 113 if Environment .Count <> 0then114 Process.Environment. Assign(Environment);115 //Environment := '';103 if Environment <> '' then 104 Process.Environment.Text := Environment; 105 Environment := ''; 116 106 //Process.Executable := Executable; 117 107 //Process.Parameters.Assign(Parameters); 118 Process.CommandLine := Executable + ' ' + Parameters. DelimitedText;119 CommandLine := Executable + ' ' + Parameters.DelimitedText;120 //if CommandLine[Length(CommandLine)] = #$athen121 //SetLength(CommandLine, Length(CommandLine) - 1);108 Process.CommandLine := Executable + ' ' + Parameters.Text; 109 CommandLine := Executable + ' ' + StringReplace(Parameters.Text, LineEnding, ' ', [rfReplaceAll]); 110 if CommandLine[Length(CommandLine)] = LineEnding then 111 SetLength(CommandLine, Length(CommandLine) - 1); 122 112 EditCommand.Text := CommandLine; 123 113 Process.Options := [poUsePipes, poNoConsole]; … … 135 125 Line := Copy(Text, 1, Pos(LineEnding, Text) - 1); 136 126 Delete(Text, 1, Length(Line) + Length(LineEnding)); 137 Memo Output.Lines.Add(Line);127 Memo1.Lines.Add(Line); 138 128 end; 139 129 end; … … 147 137 Line := Copy(Text, 1, Pos(LineEnding, Text) - 1); 148 138 Delete(Text, 1, Length(Line) + Length(LineEnding)); 149 Memo Output.Lines.Add(Line);139 Memo1.Lines.Add(Line); 150 140 end; 151 141 end; … … 154 144 end; 155 145 finally 156 Memo Output.Lines.Add(Text);146 Memo1.Lines.Add(Text); 157 147 FreeAndNil(Process); 158 148 end; 159 Duration := Now - TimeStart; 160 AAbort.Enabled := False; 161 //ToolButton1.ModalResult := mrOK; 149 Log.Assign(Memo1.Lines); 150 ButtonAbort.Enabled := False; 151 //ModalResult := mrOK; 152 //Close; 162 153 end; 163 154 -
trunk/Forms/UFormMain.lfm
r5 r6 8 8 ClientWidth = 667 9 9 Menu = MainMenu1 10 LCLVersion = '1.3' 10 OnActivate = FormActivate 11 OnClose = FormClose 12 OnShow = FormShow 13 LCLVersion = '1.5' 14 WindowState = wsMaximized 11 15 object ToolBarMain: TToolBar 12 16 Left = 0 … … 33 37 object MenuItem8: TMenuItem 34 38 Action = Core.AProjectOpen 39 end 40 object MenuItemOpenRecent: TMenuItem 41 Caption = 'Open recent' 35 42 end 36 43 object MenuItem10: TMenuItem -
trunk/Forms/UFormMain.pas
r5 r6 23 23 MenuItem15: TMenuItem; 24 24 MenuItem16: TMenuItem; 25 MenuItemOpenRecent: TMenuItem; 25 26 MenuItem2: TMenuItem; 26 27 MenuItem3: TMenuItem; … … 35 36 StatusBar1: TStatusBar; 36 37 ToolBarMain: TToolBar; 38 procedure FormActivate(Sender: TObject); 39 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 40 procedure FormShow(Sender: TObject); 37 41 private 38 { private declarations }42 Initialized: Boolean; 39 43 public 44 procedure OpenRecentExecute(Sender: TObject); 40 45 procedure UpdateInterface; 46 procedure DockInit; 41 47 end; 42 48 … … 49 55 50 56 uses 51 UCore ;57 UCore, UFormBrowse; 52 58 53 59 { TFormMain } 60 61 procedure TFormMain.FormShow(Sender: TObject); 62 begin 63 DockInit; 64 end; 65 66 procedure TFormMain.OpenRecentExecute(Sender: TObject); 67 begin 68 Core.ProjectOpen(Core.LastOpenedList1.Items[TMenuItem(Sender).MenuIndex]); 69 end; 70 71 procedure TFormMain.FormActivate(Sender: TObject); 72 begin 73 if not Initialized then begin 74 Initialized := True; 75 Core.Init; 76 end; 77 end; 78 79 procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction); 80 begin 81 Core.Done; 82 end; 54 83 55 84 procedure TFormMain.UpdateInterface; … … 59 88 if Assigned(Core.Project) then 60 89 Caption := Core.Project.Directory + ' - ' + AppName 61 else Caption := AppName 90 else Caption := AppName; 91 end; 92 93 procedure TFormMain.DockInit; 94 begin 95 FormBrowse.ManualDock(Self, nil, alClient); 96 FormBrowse.Align := alClient; 97 FormBrowse.Show; 62 98 end; 63 99
Note:
See TracChangeset
for help on using the changeset viewer.