IDE: clean build files: fixed menu ..., open file in finder

git-svn-id: trunk@30996 -
This commit is contained in:
mattias 2011-06-01 06:34:23 +00:00
parent 025665bfd5
commit cd7c1d5a0e
3 changed files with 41 additions and 3 deletions

View File

@ -174,7 +174,10 @@ object BuildProjectDialog: TBuildProjectDialog
Width = 517 Width = 517
Align = alClient Align = alClient
DefaultItemHeight = 19 DefaultItemHeight = 19
ReadOnly = True
TabOrder = 0 TabOrder = 0
OnMouseDown = FilesTreeViewMouseDown
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
end end
end end
end end

View File

@ -29,7 +29,7 @@ interface
uses uses
Classes, SysUtils, Math, AVL_Tree, FileProcs, Forms, Controls, Graphics, Classes, SysUtils, Math, AVL_Tree, FileProcs, Forms, Controls, Graphics,
Dialogs, ButtonPanel, ExtCtrls, StdCtrls, ComCtrls, Masks, Dialogs, ButtonPanel, ExtCtrls, StdCtrls, ComCtrls, Masks, LCLIntf,
// codetools // codetools
CodeToolManager, DirectoryCacher, CodeToolsStructs, CodeToolManager, DirectoryCacher, CodeToolsStructs,
// IDEIntf // IDEIntf
@ -41,6 +41,7 @@ uses
type type
TBuildProjectDialogItem = class TBuildProjectDialogItem = class
public public
IsDirectory: boolean;
Filename: string; Filename: string;
end; end;
@ -59,6 +60,8 @@ type
ProjSrcCheckBox: TCheckBox; ProjSrcCheckBox: TCheckBox;
ProjSrcMaskComboBox: TComboBox; ProjSrcMaskComboBox: TComboBox;
procedure ButtonPanel1OKButtonClick(Sender: TObject); procedure ButtonPanel1OKButtonClick(Sender: TObject);
procedure FilesTreeViewMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
@ -169,6 +172,27 @@ begin
ModalResult:=mrOk; ModalResult:=mrOk;
end; end;
procedure TBuildProjectDialog.FilesTreeViewMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
Node: TTreeNode;
Item: TBuildProjectDialogItem;
Filename: String;
begin
Node:=FilesTreeView.GetNodeAt(X,Y);
if Node=nil then exit;
if (Button=mbLeft) and (ssDouble in Shift) and (Node.Data<>nil) then begin
Item:=TBuildProjectDialogItem(Node.Data);
Filename:=Item.Filename;
if Item.IsDirectory then exit;
Filename:=ExtractFilePath(Filename);
Filename:=ChompPathDelim(Filename);
debugln(['TBuildProjectDialog.FilesTreeViewMouseDown Filename="',Filename,'"']);
if FilenameIsAbsolute(Filename) then
OpenURL('file://'+StringReplace(Filename,'\','/',[rfReplaceAll]));
end;
end;
procedure TBuildProjectDialog.FormResize(Sender: TObject); procedure TBuildProjectDialog.FormResize(Sender: TObject);
var var
r: Integer; r: Integer;
@ -406,6 +430,12 @@ begin
TVNode:=FilesTreeView.Items.AddChild(ParentTVNode,NodeText) TVNode:=FilesTreeView.Items.AddChild(ParentTVNode,NodeText)
else if (CompareFilenames(TVNode.Text,NodeText)<>0) then else if (CompareFilenames(TVNode.Text,NodeText)<>0) then
TVNode:=FilesTreeView.Items.Add(TVNode,NodeText); TVNode:=FilesTreeView.Items.Add(TVNode,NodeText);
if TVNode.Data=nil then begin
Item:=TBuildProjectDialogItem.Create;
Item.IsDirectory:=true;
Item.Filename:=aDirectory;
TVNode.Data:=Item;
end;
TVNode.ImageIndex:=ImageIndexDirectory; TVNode.ImageIndex:=ImageIndexDirectory;
TVNode.SelectedIndex:=ImageIndexDirectory; TVNode.SelectedIndex:=ImageIndexDirectory;
ParentTVNode:=TVNode; ParentTVNode:=TVNode;
@ -443,12 +473,17 @@ end;
function TBuildProjectDialog.GetAllFilesFromTree: TFilenameToStringTree; function TBuildProjectDialog.GetAllFilesFromTree: TFilenameToStringTree;
var var
Node: TTreeNode; Node: TTreeNode;
Item: TBuildProjectDialogItem;
begin begin
Result:=TFilenameToStringTree.Create(false); Result:=TFilenameToStringTree.Create(false);
Node:=FilesTreeView.Items.GetFirstNode; Node:=FilesTreeView.Items.GetFirstNode;
while Node<>nil do begin while Node<>nil do begin
if (Node.Data<>nil) and (TObject(Node.Data) is TBuildProjectDialogItem) then if (Node.Data<>nil) and (TObject(Node.Data) is TBuildProjectDialogItem) then
Result[TBuildProjectDialogItem(Node.Data).Filename]:='1'; begin
Item:=TBuildProjectDialogItem(Node.Data);
if not Item.IsDirectory then
Result[Item.Filename]:='1';
end;
Node:=Node.GetNext; Node:=Node.GetNext;
end; end;
end; end;

View File

@ -347,7 +347,7 @@ resourcestring
lisBFBuildCommand = 'Build Command'; lisBFBuildCommand = 'Build Command';
lisMenuBuild = 'Build'; lisMenuBuild = 'Build';
lisMenuQuickCompile = 'Quick compile'; lisMenuQuickCompile = 'Quick compile';
lisMenuCleanUpCompiled = 'Clean up build files'; lisMenuCleanUpCompiled = 'Clean up build files ...';
lisMenuAbortBuild = 'Abort Build'; lisMenuAbortBuild = 'Abort Build';
lisMenuProjectRun = '&Run'; lisMenuProjectRun = '&Run';
lisBFAlwaysBuildBeforeRun = 'Always Build before Run'; lisBFAlwaysBuildBeforeRun = 'Always Build before Run';