ADD: Feature [0000221] I need a separate tree in the double command

This commit is contained in:
Alexander Koblov 2015-11-05 18:37:37 +00:00
commit a3458dd7d4
6 changed files with 520 additions and 329 deletions

View file

@ -1,7 +1,7 @@
object frmMain: TfrmMain
Left = 474
Left = 485
Height = 370
Top = 272
Top = 269
Width = 760
Caption = 'Double Commander'
ClientHeight = 370
@ -17,7 +17,7 @@ object frmMain: TfrmMain
OnShow = frmMainShow
OnUTF8KeyPress = FormUTF8KeyPress
OnWindowStateChange = FormWindowStateChange
SessionProperties = 'nbConsole.Height;seLogWindow.Height'
SessionProperties = 'nbConsole.Height;seLogWindow.Height;ShellTreeView.Width'
ShowHint = True
ShowInTaskBar = stAlways
LCLVersion = '1.4.4.0'
@ -32,7 +32,7 @@ object frmMain: TfrmMain
Constraints.MinHeight = 20
EdgeBorders = []
Flat = True
TabOrder = 2
TabOrder = 1
OnDragDrop = MainToolBarDragDrop
OnDragOver = MainToolBarDragOver
OnMouseUp = MainToolBarMouseUp
@ -44,360 +44,395 @@ object frmMain: TfrmMain
OnToolItemShortcutsHint = MainToolBarToolItemShortcutsHint
GlyphSize = 16
end
object pnlDisk: TPanel
AnchorSideTop.Control = MainToolBar
object ShellTreeView: TShellTreeView
Left = 0
Height = 24
Height = 191
Top = 20
Width = 760
Align = alTop
AutoSize = True
BevelOuter = bvNone
ClientHeight = 24
ClientWidth = 760
FullRepaint = False
Width = 121
Align = alLeft
FileSortType = fstNone
ReadOnly = True
RightClickSelect = True
ScrollBars = ssAutoBoth
TabOrder = 0
Visible = False
object pnlDskLeft: TPanel
AnchorSideLeft.Control = pnlDisk
AnchorSideTop.Control = pnlDisk
Left = 0
Height = 24
Top = 0
Width = 170
BevelOuter = bvNone
ClientHeight = 24
ClientWidth = 170
TabOrder = 0
Visible = False
object dskLeft: TKASToolBar
Left = 0
Height = 20
Top = 0
Width = 170
AutoSize = True
Constraints.MinHeight = 20
EdgeBorders = [ebTop, ebBottom]
Flat = True
ShowCaptions = True
TabOrder = 0
OnResize = dskLeftResize
OnToolButtonClick = dskLeftToolButtonClick
OnToolButtonMouseUp = dskToolButtonMouseUp
OnToolButtonDragDrop = dskLeftRightToolButtonDragDrop
RadioToolBar = True
GlyphSize = 16
end
end
object pnlDskRight: TPanel
AnchorSideTop.Control = pnlDisk
AnchorSideRight.Control = pnlDisk
AnchorSideRight.Side = asrBottom
Left = 172
Height = 24
Top = 0
Width = 588
Anchors = [akTop, akRight]
BevelOuter = bvNone
ClientHeight = 24
ClientWidth = 588
TabOrder = 1
Visible = False
object dskRight: TKASToolBar
Left = 0
Height = 20
Top = 0
Width = 588
AutoSize = True
Constraints.MinHeight = 20
EdgeBorders = [ebTop, ebBottom]
Flat = True
ShowCaptions = True
TabOrder = 0
OnResize = dskRightResize
OnToolButtonClick = dskRightToolButtonClick
OnToolButtonMouseUp = dskToolButtonMouseUp
OnToolButtonDragDrop = dskLeftRightToolButtonDragDrop
RadioToolBar = True
GlyphSize = 16
end
end
OnAdvancedCustomDrawItem = ShellTreeViewAdvancedCustomDrawItem
OnDblClick = ShellTreeViewDblClick
OnKeyDown = ShellTreeViewKeyDown
OnMouseUp = ShellTreeViewMouseUp
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoRightClickSelect, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips]
ObjectTypes = [otFolders]
end
object pnlNotebooks: TPanel
Left = 0
Height = 167
Top = 44
Width = 760
object TreeSplitter: TSplitter
Left = 121
Height = 191
Top = 20
Width = 5
end
object pnlMain: TPanel
Left = 126
Height = 191
Top = 20
Width = 634
Align = alClient
BevelOuter = bvNone
ClientHeight = 167
ClientWidth = 760
FullRepaint = False
TabOrder = 1
OnResize = pnlNotebooksResize
object pnlLeft: TPanel
ClientHeight = 191
ClientWidth = 634
TabOrder = 5
object pnlDisk: TPanel
AnchorSideTop.Control = MainToolBar
Left = 0
Height = 167
Height = 24
Top = 0
Width = 511
Align = alLeft
Width = 634
Align = alTop
AutoSize = True
BevelOuter = bvNone
ClientHeight = 167
ClientWidth = 511
ClientHeight = 24
ClientWidth = 634
FullRepaint = False
TabOrder = 0
OnDblClick = pnlLeftRightDblClick
OnResize = pnlLeftResize
object pnlDiskLeftInner: TPanel
Left = 0
Height = 10
Top = 0
Width = 511
Align = alTop
BevelOuter = bvNone
TabOrder = 1
Visible = False
end
object pnlLeftTools: TPanel
Visible = False
object pnlDskLeft: TPanel
AnchorSideLeft.Control = pnlDisk
AnchorSideTop.Control = pnlDisk
Left = 0
Height = 24
Top = 10
Width = 511
Align = alTop
AutoSize = True
Top = 0
Width = 170
BevelOuter = bvNone
ClientHeight = 24
ClientWidth = 511
ClientWidth = 170
TabOrder = 0
object btnLeftDrive: TSpeedButton
Visible = False
object dskLeft: TKASToolBar
Left = 0
Height = 24
Height = 20
Top = 0
Width = 48
Action = actLeftOpenDrives
Align = alLeft
Constraints.MinHeight = 24
OnMouseUp = btnDriveMouseUp
Width = 170
AutoSize = True
Constraints.MinHeight = 20
EdgeBorders = [ebTop, ebBottom]
Flat = True
ShowCaptions = True
TabOrder = 0
OnResize = dskLeftResize
OnToolButtonClick = dskLeftToolButtonClick
OnToolButtonMouseUp = dskToolButtonMouseUp
OnToolButtonDragDrop = dskLeftRightToolButtonDragDrop
RadioToolBar = True
GlyphSize = 16
end
object btnLeftHome: TSpeedButton
Left = 465
Height = 24
Hint = 'Go to home directory'
end
object pnlDskRight: TPanel
AnchorSideTop.Control = pnlDisk
AnchorSideRight.Control = pnlDisk
AnchorSideRight.Side = asrBottom
Left = 46
Height = 24
Top = 0
Width = 588
Anchors = [akTop, akRight]
BevelOuter = bvNone
ClientHeight = 24
ClientWidth = 588
TabOrder = 1
Visible = False
object dskRight: TKASToolBar
Left = 0
Height = 20
Top = 0
Width = 23
Align = alRight
Caption = '~'
OnClick = btnLeftClick
end
object btnLeftUp: TSpeedButton
Left = 442
Height = 24
Hint = 'Go to parent directory'
Top = 0
Width = 23
Align = alRight
Caption = '..'
OnClick = btnLeftClick
end
object btnLeftRoot: TSpeedButton
Left = 419
Height = 24
Hint = 'Go to root directory'
Top = 0
Width = 23
Align = alRight
Caption = '/'
OnClick = btnLeftClick
end
object btnLeftDirectoryHotlist: TSpeedButton
Left = 396
Height = 24
Hint = 'Directory Hotlist'
Top = 0
Width = 23
Align = alRight
Caption = '*'
OnClick = btnLeftDirectoryHotlistClick
end
object btnLeftEqualRight: TSpeedButton
Left = 488
Height = 24
Hint = 'Show current directory of the right panel in the left panel'
Top = 0
Width = 23
Action = actLeftEqualRight
Align = alRight
Caption = '<'
end
object pbxLeftDrive: TPaintBox
AnchorSideLeft.Control = lblLeftDriveInfo
AnchorSideTop.Control = lblLeftDriveInfo
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = lblLeftDriveInfo
AnchorSideRight.Side = asrBottom
Left = 52
Height = 10
Top = 1
Width = 342
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 2
BorderSpacing.Right = 2
OnPaint = sboxDrivePaint
end
object lblLeftDriveInfo: TLabel
AnchorSideLeft.Control = btnLeftDrive
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = pnlLeftTools
AnchorSideRight.Side = asrBottom
Left = 50
Height = 1
Top = 0
Width = 346
Alignment = taCenter
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 2
BorderSpacing.Right = 2
ParentColor = False
OnDblClick = lblDriveInfoDblClick
Width = 588
AutoSize = True
Constraints.MinHeight = 20
EdgeBorders = [ebTop, ebBottom]
Flat = True
ShowCaptions = True
TabOrder = 0
OnResize = dskRightResize
OnToolButtonClick = dskRightToolButtonClick
OnToolButtonMouseUp = dskToolButtonMouseUp
OnToolButtonDragDrop = dskLeftRightToolButtonDragDrop
RadioToolBar = True
GlyphSize = 16
end
end
end
object pnlRight: TPanel
Left = 511
object pnlNotebooks: TPanel
Left = 0
Height = 167
Top = 0
Width = 249
Top = 24
Width = 634
Align = alClient
BevelOuter = bvNone
ClientHeight = 167
ClientWidth = 249
ClientWidth = 634
FullRepaint = False
TabOrder = 1
OnDblClick = pnlLeftRightDblClick
OnResize = pnlRightResize
object pnlDiskRightInner: TPanel
OnResize = pnlNotebooksResize
object pnlLeft: TPanel
Left = 0
Height = 10
Height = 167
Top = 0
Width = 249
Align = alTop
Width = 511
Align = alLeft
BevelOuter = bvNone
TabOrder = 1
Visible = False
end
object pnlRightTools: TPanel
Left = 0
Height = 24
Top = 10
Width = 249
Align = alTop
AutoSize = True
BevelOuter = bvNone
ClientHeight = 24
ClientWidth = 249
ClientHeight = 167
ClientWidth = 511
TabOrder = 0
object btnRightDrive: TSpeedButton
OnDblClick = pnlLeftRightDblClick
OnResize = pnlLeftResize
object pnlDiskLeftInner: TPanel
Left = 0
Height = 10
Top = 0
Width = 511
Align = alTop
BevelOuter = bvNone
TabOrder = 1
Visible = False
end
object pnlLeftTools: TPanel
Left = 0
Height = 24
Top = 0
Width = 48
Action = actRightOpenDrives
Align = alLeft
Constraints.MinHeight = 24
OnMouseUp = btnDriveMouseUp
end
object btnRightHome: TSpeedButton
Left = 203
Height = 24
Top = 0
Width = 23
Align = alRight
Caption = '~'
OnClick = btnRightClick
end
object btnRightUp: TSpeedButton
Left = 180
Height = 24
Top = 0
Width = 23
Align = alRight
Caption = '..'
OnClick = btnRightClick
end
object btnRightRoot: TSpeedButton
Left = 157
Height = 24
Top = 0
Width = 23
Align = alRight
Caption = '/'
OnClick = btnRightClick
end
object btnRightDirectoryHotlist: TSpeedButton
Left = 134
Height = 24
Hint = 'Directory Hotlist'
Top = 0
Width = 23
Align = alRight
Caption = '*'
OnClick = btnRightDirectoryHotlistClick
end
object btnRightEqualLeft: TSpeedButton
Left = 226
Height = 24
Hint = 'Show current directory of the left panel in the right panel'
Top = 0
Width = 23
Action = actRightEqualLeft
Align = alRight
Caption = '>'
end
object pbxRightDrive: TPaintBox
AnchorSideLeft.Control = lblRightDriveInfo
AnchorSideTop.Control = lblRightDriveInfo
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = lblRightDriveInfo
AnchorSideRight.Side = asrBottom
Left = 52
Height = 10
Top = 1
Width = 80
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 2
BorderSpacing.Right = 2
OnPaint = sboxDrivePaint
end
object lblRightDriveInfo: TLabel
AnchorSideLeft.Control = btnRightDrive
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = pnlRightTools
AnchorSideRight.Side = asrBottom
Left = 50
Height = 1
Top = 0
Width = 84
Alignment = taCenter
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 2
BorderSpacing.Right = 2
ParentColor = False
OnDblClick = lblDriveInfoDblClick
Top = 10
Width = 511
Align = alTop
AutoSize = True
BevelOuter = bvNone
ClientHeight = 24
ClientWidth = 511
TabOrder = 0
object btnLeftDrive: TSpeedButton
Left = 0
Height = 24
Top = 0
Width = 48
Action = actLeftOpenDrives
Align = alLeft
Constraints.MinHeight = 24
OnMouseUp = btnDriveMouseUp
end
object btnLeftHome: TSpeedButton
Left = 465
Height = 24
Hint = 'Go to home directory'
Top = 0
Width = 23
Align = alRight
Caption = '~'
OnClick = btnLeftClick
end
object btnLeftUp: TSpeedButton
Left = 442
Height = 24
Hint = 'Go to parent directory'
Top = 0
Width = 23
Align = alRight
Caption = '..'
OnClick = btnLeftClick
end
object btnLeftRoot: TSpeedButton
Left = 419
Height = 24
Hint = 'Go to root directory'
Top = 0
Width = 23
Align = alRight
Caption = '/'
OnClick = btnLeftClick
end
object btnLeftDirectoryHotlist: TSpeedButton
Left = 396
Height = 24
Hint = 'Directory Hotlist'
Top = 0
Width = 23
Align = alRight
Caption = '*'
OnClick = btnLeftDirectoryHotlistClick
end
object btnLeftEqualRight: TSpeedButton
Left = 488
Height = 24
Hint = 'Show current directory of the right panel in the left panel'
Top = 0
Width = 23
Action = actLeftEqualRight
Align = alRight
Caption = '<'
end
object pbxLeftDrive: TPaintBox
AnchorSideLeft.Control = lblLeftDriveInfo
AnchorSideTop.Control = lblLeftDriveInfo
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = lblLeftDriveInfo
AnchorSideRight.Side = asrBottom
Left = 52
Height = 10
Top = 1
Width = 342
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 2
BorderSpacing.Right = 2
OnPaint = sboxDrivePaint
end
object lblLeftDriveInfo: TLabel
AnchorSideLeft.Control = btnLeftDrive
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = pnlLeftTools
AnchorSideRight.Side = asrBottom
Left = 50
Height = 1
Top = 0
Width = 346
Alignment = taCenter
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 2
BorderSpacing.Right = 2
ParentColor = False
OnDblClick = lblDriveInfoDblClick
end
end
end
end
object MainSplitter: TPanel
Cursor = crHSplit
Left = 515
Height = 78
Top = -40
Width = 5
Anchors = []
BevelOuter = bvNone
PopupMenu = pmSplitterPercent
TabOrder = 2
OnDblClick = MainSplitterDblClick
OnMouseDown = MainSplitterMouseDown
OnMouseMove = MainSplitterMouseMove
OnMouseUp = MainSplitterMouseUp
object pnlRight: TPanel
Left = 511
Height = 167
Top = 0
Width = 123
Align = alClient
BevelOuter = bvNone
ClientHeight = 167
ClientWidth = 123
TabOrder = 1
OnDblClick = pnlLeftRightDblClick
OnResize = pnlRightResize
object pnlDiskRightInner: TPanel
Left = 0
Height = 10
Top = 0
Width = 123
Align = alTop
BevelOuter = bvNone
TabOrder = 1
Visible = False
end
object pnlRightTools: TPanel
Left = 0
Height = 24
Top = 10
Width = 123
Align = alTop
AutoSize = True
BevelOuter = bvNone
ClientHeight = 24
ClientWidth = 123
TabOrder = 0
object btnRightDrive: TSpeedButton
Left = 0
Height = 24
Top = 0
Width = 48
Action = actRightOpenDrives
Align = alLeft
Constraints.MinHeight = 24
OnMouseUp = btnDriveMouseUp
end
object btnRightHome: TSpeedButton
Left = 77
Height = 24
Top = 0
Width = 23
Align = alRight
Caption = '~'
OnClick = btnRightClick
end
object btnRightUp: TSpeedButton
Left = 54
Height = 24
Top = 0
Width = 23
Align = alRight
Caption = '..'
OnClick = btnRightClick
end
object btnRightRoot: TSpeedButton
Left = 31
Height = 24
Top = 0
Width = 23
Align = alRight
Caption = '/'
OnClick = btnRightClick
end
object btnRightDirectoryHotlist: TSpeedButton
Left = 25
Height = 24
Hint = 'Directory Hotlist'
Top = 0
Width = 23
Align = alRight
Caption = '*'
OnClick = btnRightDirectoryHotlistClick
end
object btnRightEqualLeft: TSpeedButton
Left = 100
Height = 24
Hint = 'Show current directory of the left panel in the right panel'
Top = 0
Width = 23
Action = actRightEqualLeft
Align = alRight
Caption = '>'
end
object pbxRightDrive: TPaintBox
AnchorSideLeft.Control = lblRightDriveInfo
AnchorSideTop.Control = lblRightDriveInfo
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = lblRightDriveInfo
AnchorSideRight.Side = asrBottom
Left = 52
Height = 10
Top = 1
Width = 0
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 2
BorderSpacing.Right = 2
OnPaint = sboxDrivePaint
end
object lblRightDriveInfo: TLabel
AnchorSideLeft.Control = btnRightDrive
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = pnlRightTools
AnchorSideRight.Side = asrBottom
Left = 50
Height = 1
Top = 0
Width = 0
Alignment = taCenter
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 2
BorderSpacing.Right = 2
ParentColor = False
OnDblClick = lblDriveInfoDblClick
end
end
end
object MainSplitter: TPanel
Cursor = crHSplit
Left = 429
Height = 78
Top = -40
Width = 5
Anchors = []
BevelOuter = bvNone
PopupMenu = pmSplitterPercent
TabOrder = 2
OnDblClick = MainSplitterDblClick
OnMouseDown = MainSplitterMouseDown
OnMouseMove = MainSplitterMouseMove
OnMouseUp = MainSplitterMouseUp
end
end
end
object PanelAllProgress: TPanel
@ -408,7 +443,7 @@ object frmMain: TfrmMain
Align = alBottom
AutoSize = True
BevelOuter = bvNone
TabOrder = 6
TabOrder = 2
end
object ConsoleSplitter: TSplitter
Cursor = crVSplit
@ -1216,6 +1251,9 @@ object frmMain: TfrmMain
object mnuQuickView: TMenuItem
Action = actQuickView
end
object mnuTreeView: TMenuItem
Action = actTreeView
end
object miLine32: TMenuItem
Caption = '-'
end
@ -2334,6 +2372,11 @@ object frmMain: TfrmMain
Category = 'Command Line'
Caption = 'Toggle fullscreen mode console'
end
object actTreeView: TAction
Category = 'Window'
Caption = '&Tree View Panel'
OnExecute = actExecute
end
end
object pmHotList: TPopupMenu
Images = imgLstDirectoryHotlist

View file

@ -223,6 +223,7 @@ TFRMMAIN.ACTCHECKSUMVERIFY.CAPTION=&Verify Checksum...
TFRMMAIN.ACTUNIVERSALSINGLEDIRECTSORT.CAPTION=Sort according to parameters
TFRMMAIN.ACTCOUNTDIRCONTENT.CAPTION=Sho&w Occupied Space
TFRMMAIN.ACTTOGGLEFULLSCREENCONSOLE.CAPTION=Toggle fullscreen mode console
TFRMMAIN.ACTTREEVIEW.CAPTION=&Tree View Panel
TFRMMAIN.TBEDIT.CAPTION=Edit
TFRMMAIN.TBDELETE.CAPTION=Delete
TFRMMAIN.TBCHANGEDIR.CAPTION=CD

View file

@ -40,7 +40,7 @@ unit fMain;
interface
uses
Graphics, Forms, Menus, Controls, StdCtrls, ExtCtrls, ActnList,
Graphics, Forms, Menus, Controls, StdCtrls, ExtCtrls, ActnList, ShellCtrls,
Buttons, SysUtils, Classes, SynEdit, LCLType, ComCtrls, LResources,
KASToolBar, KASComboBox, uCmdBox, uFilePanelSelect, uBriefFileView,
uFileView, uColumnsFileView, uFileSource, uFileViewNotebook, uFile,
@ -97,6 +97,7 @@ type
actCopyPathOfFilesToClip: TAction;
actCopyPathNoSepOfFilesToClip: TAction;
actDoAnyCmCommand: TAction;
actTreeView: TAction;
actToggleFullscreenConsole: TAction;
actSrcOpenDrives: TAction;
actRightReverseOrder: TAction;
@ -201,6 +202,7 @@ type
lblRightDriveInfo: TLabel;
lblLeftDriveInfo: TLabel;
lblCommandPath: TLabel;
mnuTreeView: TMenuItem;
mnuCmdConfigDirHotlist: TMenuItem;
mnuLoadTabs: TMenuItem;
mnuSaveTabs: TMenuItem;
@ -231,6 +233,7 @@ type
miCompareDirectories: TMenuItem;
miLine37: TMenuItem;
miRenameTab: TMenuItem;
pnlMain: TPanel;
tbChangeDir: TMenuItem;
mnuShowHorizontalFilePanels: TMenuItem;
miLine20: TMenuItem;
@ -451,6 +454,8 @@ type
actFileSpliter: TAction;
pmToolBar: TPopupMenu;
MainTrayIcon: TTrayIcon;
TreeSplitter: TSplitter;
ShellTreeView: TShellTreeView;
procedure actExecute(Sender: TObject);
procedure btnF8MouseDown(Sender: TObject; Button: TMouseButton;
@ -486,6 +491,11 @@ type
procedure miTrayIconExitClick(Sender: TObject);
procedure miTrayIconRestoreClick(Sender: TObject);
procedure PanelButtonClick(Button: TSpeedButton; FileView: TFileView);
procedure ShellTreeViewDblClick(Sender: TObject);
procedure ShellTreeViewKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure ShellTreeViewMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure tbDeleteClick(Sender: TObject);
procedure dskLeftToolButtonClick(Sender: TObject);
procedure dskRightToolButtonClick(Sender: TObject);
@ -535,6 +545,10 @@ type
Shift: TShiftState);
procedure pmToolBarPopup(Sender: TObject);
procedure ShellTreeViewAdvancedCustomDrawItem(Sender: TCustomTreeView;
Node: TTreeNode; State: TCustomDrawState; Stage: TCustomDrawStage;
var PaintImages, DefaultDraw: Boolean);
procedure pnlLeftResize(Sender: TObject);
procedure pnlLeftRightDblClick(Sender: TObject);
procedure pnlNotebooksResize(Sender: TObject);
@ -597,6 +611,7 @@ type
procedure CheckCommandLine(ShiftEx: TShiftState; var Key: Word);
function ExecuteCommandFromEdit(sCmd: String; bRunInTerm: Boolean): Boolean;
procedure SetMainSplitterPos(AValue: Double);
procedure SetPanelSelected(AValue: TFilePanelSelect);
procedure UpdateActionIcons;
procedure UpdateHotDirIcons;
procedure TypeInCommandLine(Str: String);
@ -688,6 +703,8 @@ type
out DestPath, DestMask: String); overload;
procedure SetActiveFrame(panel: TFilePanelSelect);
procedure SetActiveFrame(FileView: TFileView);
procedure UpdateTreeViewPath;
procedure UpdateTreeView;
procedure UpdateDiskCount;
procedure CreateDiskPanel(dskPanel : TKASToolBar);
function CreateFileView(sType: String; Page: TFileViewPage; AConfig: TIniFileEx; ASectionName: String; ATabIndex: Integer): TFileView;
@ -736,7 +753,7 @@ type
{$ENDIF}
property Commands: TMainCommands read FCommands{$IF FPC_FULLVERSION >= 020501} implements IFormCommands{$ENDIF};
property SelectedPanel: TFilePanelSelect read PanelSelected;
property SelectedPanel: TFilePanelSelect read PanelSelected write SetPanelSelected;
property LeftTabs: TFileViewNotebook read nbLeft;
property RightTabs: TFileViewNotebook read nbRight;
property MainSplitterPos: Double read FMainSplitterPos write SetMainSplitterPos;
@ -751,7 +768,7 @@ implementation
{$R *.lfm}
uses
uFileProcs,
uFileProcs, uShellContextMenu,
Math, LCLIntf, LCLVersion, Dialogs, uGlobs, uLng, uMasks, fCopyMoveDlg, uQuickViewPanel,
uShowMsg, uDCUtils, uLog, uGlobsPaths, LCLProc, uOSUtils, uOSForms, uPixMapManager,
uDragDropEx, uKeyboard, uFileSystemFileSource, fViewOperations, uMultiListFileSource,
@ -907,6 +924,12 @@ begin
MainFormCreate(Self);
// Separate tree
ShellTreeView.Images := TImageList.Create(Self);
ShellTreeView.Images.Width := gIconsSize;
ShellTreeView.Images.Height := gIconsSize;
ShellTreeView.Images.Add(PixMapManager.GetFolderIcon(gIconsSize, ShellTreeView.Color), nil);
// Load command line history
edtCommand.Items.Assign(glsCmdLineHistory);
@ -952,6 +975,8 @@ begin
// Update selected drive and free space before main form is shown,
// otherwise there is a bit of delay.
UpdateTreeView;
UpdateTreeViewPath;
UpdateSelectedDrives;
UpdateFreeSpace(fpLeft);
UpdateFreeSpace(fpRight);
@ -1336,6 +1361,49 @@ begin
SetActiveFrame(FileView);
end;
procedure TfrmMain.ShellTreeViewDblClick(Sender: TObject);
begin
ShellTreeView.Tag := 1;
try
SetFileSystemPath(ActiveFrame, ShellTreeView.Path);
finally
ShellTreeView.Tag := 0;
end;
end;
procedure TfrmMain.ShellTreeViewKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_RETURN then ShellTreeViewDblClick(Sender);
end;
procedure TfrmMain.ShellTreeViewMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
AFile: TFile;
AFiles: TFiles;
APoint: TPoint;
begin
{$IF DEFINED(MSWINDOWS)}
if Button = mbRight then
try
AFile:= TFileSystemFileSource.CreateFileFromFile(ShellTreeView.Path);
try
AFiles:= TFiles.Create(AFile.Path);
AFiles.Add(AFile);
APoint := ShellTreeView.ClientToScreen(Classes.Point(X, Y));
ShowContextMenu(ShellTreeView, AFiles, APoint.X, APoint.Y, False, nil);
finally
FreeAndNil(AFiles);
end;
except
on E: EContextMenuException do
ShowException(E)
else;
end;
{$ENDIF}
end;
procedure TfrmMain.FormDestroy(Sender: TObject);
begin
DCDebug('Destroying main form');
@ -3413,6 +3481,14 @@ begin
tbPaste.Visible:= bPaste;
end;
procedure TfrmMain.ShellTreeViewAdvancedCustomDrawItem(Sender: TCustomTreeView;
Node: TTreeNode; State: TCustomDrawState; Stage: TCustomDrawStage;
var PaintImages, DefaultDraw: Boolean);
begin
Node.ImageIndex:= 0;
Node.SelectedIndex:= 0;
end;
procedure TfrmMain.pnlLeftResize(Sender: TObject);
begin
if gDriveBar1 and gDriveBar2 and not gHorizontalFilePanels then
@ -3639,6 +3715,7 @@ begin
else begin
glsDirHistory.Move(Index, 0);
end;
UpdateTreeViewPath;
end;
UpdateSelectedDrive(ANoteBook);
@ -3663,7 +3740,7 @@ begin
if FileView.NotebookPage is TFileViewPage then
begin
Page := FileView.NotebookPage as TFileViewPage;
PanelSelected := Page.Notebook.Side;
SelectedPanel := Page.Notebook.Side;
UpdateSelectedDrive(Page.Notebook);
UpdatePrompt;
UpdateFreeSpace(Page.Notebook.Side);
@ -3687,7 +3764,7 @@ end;
procedure TfrmMain.SetActiveFrame(panel: TFilePanelSelect);
begin
PanelSelected:=panel;
SelectedPanel:= panel;
SetActiveFrame(ActiveFrame);
end;
@ -3695,10 +3772,30 @@ procedure TfrmMain.SetActiveFrame(FileView: TFileView);
begin
FileView.SetFocus;
if (fspDirectAccess in FileView.FileSource.GetProperties) then
begin
if gTermWindow and Assigned(Cons) then
Cons.Terminal.SetCurrentDir(FileView.CurrentPath);
end;
begin
if gTermWindow and Assigned(Cons) then
Cons.Terminal.SetCurrentDir(FileView.CurrentPath);
end;
end;
procedure TfrmMain.UpdateTreeViewPath;
begin
if (gSeparateTree = False) or (ShellTreeView.Tag <> 0) then Exit;
if (fspDirectAccess in ActiveFrame.FileSource.Properties) then
try
ShellTreeView.Path := ActiveFrame.CurrentPath;
except
// Skip
end;
end;
procedure TfrmMain.UpdateTreeView;
begin
if gShowSystemFiles then
ShellTreeView.ObjectTypes:= ShellTreeView.ObjectTypes + [otHidden]
else begin
ShellTreeView.ObjectTypes:= ShellTreeView.ObjectTypes - [otHidden];
end;
end;
function CompareDrives(Item1, Item2: Pointer): Integer;
@ -4382,6 +4479,17 @@ begin
end;
end;
// Separate tree
TreeSplitter.Visible := gSeparateTree;
ShellTreeView.Visible := gSeparateTree;
if gSeparateTree then
begin
ShellTreeView.Font.Color := gForeColor;
ShellTreeView.BackgroundColor := gBackColor;
ShellTreeView.SelectionColor := gCursorColor;
FontOptionsToFont(gFonts[dcfMain], ShellTreeView.Font);
end;
// Operations panel and menu
if (gPanelOfOp = False) then
FreeAndNil(FOperationsPanel)
@ -4805,6 +4913,13 @@ begin
FMainSplitterPos:= AValue;
end;
procedure TfrmMain.SetPanelSelected(AValue: TFilePanelSelect);
begin
if PanelSelected = AValue then Exit;
PanelSelected := AValue;
UpdateTreeViewPath;
end;
procedure TfrmMain.TypeInCommandLine(Str: String);
begin
Commands.cm_FocusCmdLine([]);
@ -5312,9 +5427,9 @@ begin
end;
// Change program current path
if (fspDirectAccess in ActiveFrame.FileSource.GetProperties) then
begin
mbSetCurrentDir(ActiveFrame.CurrentPath);
end;
begin
mbSetCurrentDir(ActiveFrame.CurrentPath);
end;
end;
procedure TfrmMain.UpdateFreeSpace(Panel: TFilePanelSelect);

View file

@ -294,6 +294,7 @@ type
function GetDefaultDriveIcon(IconSize : Integer; clBackColor : TColor) : Graphics.TBitmap;
function GetVirtualDriveIcon(IconSize : Integer; clBackColor : TColor) : Graphics.TBitmap;
function GetArchiveIcon(IconSize: Integer; clBackColor : TColor) : Graphics.TBitmap;
function GetFolderIcon(IconSize: Integer; clBackColor : TColor) : Graphics.TBitmap;
{en
Returns default icon for a file.
For example default folder icon for folder, default executable icon for *.exe, etc.
@ -2003,6 +2004,19 @@ begin
end;
end;
function TPixMapManager.GetFolderIcon(IconSize: Integer; clBackColor: TColor): Graphics.TBitmap;
begin
Result := GetBitmap(FiDirIconID);
if Assigned(Result) then
begin
// if need stretch icon
if (IconSize <> gIconsSize) then
begin
Result := StretchBitmap(Result, IconSize, clBackColor, True);
end;
end;
end;
function TPixMapManager.GetDefaultIcon(AFile: TFile): PtrInt;
begin
if AFile.IsDirectory then

View file

@ -112,7 +112,7 @@ type
const
{ Default hotkey list version number }
hkVersion = 22;
hkVersion = 23;
// Previously existing names if reused must check for ConfigVersion >= X.
// History:
@ -184,6 +184,7 @@ var
gHorizontalFilePanels,
gShortFormatDriveInfo: Boolean;
gDrivesListButtonOptions: TDrivesListButtonOptions;
gSeparateTree: Boolean;
{ Toolbar }
gToolBarButtonSize,
@ -779,6 +780,7 @@ begin
AddIfNotExists(['Ctrl+Shift+F1'],[],'cm_ThumbnailsView');
AddIfNotExists(['Ctrl+Shift+Enter'],[],'cm_AddPathAndFilenameToCmdLine');
AddIfNotExists(['Ctrl+Shift+Tab'],[],'cm_PrevTab');
AddIfNotExists(['Ctrl+Shift+F8'],[],'cm_TreeView');
AddIfNotExists(['Ctrl+Tab'],[],'cm_NextTab');
AddIfNotExists(['Ctrl+Up'],[],'cm_OpenDirInNewTab');
AddIfNotExists(['Ctrl+\'],[],'cm_ChangeDirToRoot');
@ -1218,6 +1220,7 @@ begin
gShortFormatDriveInfo := True;
gHorizontalFilePanels := False;
gDrivesListButtonOptions := [dlbShowLabel, dlbShowFileSystem, dlbShowFreeSpace];
gSeparateTree := False;
{ Keys page }
gKeyTyping[ktmNone] := ktaQuickSearch;
@ -2183,6 +2186,7 @@ begin
LoadOption(SubNode, gDrivesListButtonOptions, dlbShowFreeSpace, 'ShowFreeSpace');
end;
end;
gSeparateTree := GetValue(Node, 'SeparateTree', gSeparateTree);
gDirectoryTabs := GetValue(Node, 'DirectoryTabs', gDirectoryTabs);
gCurDir := GetValue(Node, 'CurrentDirectory', gCurDir);
gTabHeader := GetValue(Node, 'TabHeader', gTabHeader);
@ -2643,6 +2647,7 @@ begin
SetValue(SubNode, 'ShowLabel', dlbShowLabel in gDrivesListButtonOptions);
SetValue(SubNode, 'ShowFileSystem', dlbShowFileSystem in gDrivesListButtonOptions);
SetValue(SubNode, 'ShowFreeSpace', dlbShowFreeSpace in gDrivesListButtonOptions);
SetValue(Node, 'SeparateTree', gSeparateTree);
SetValue(Node, 'DirectoryTabs', gDirectoryTabs);
SetValue(Node, 'CurrentDirectory', gCurDir);
SetValue(Node, 'TabHeader', gTabHeader);

View file

@ -206,6 +206,7 @@ type
procedure cm_ThumbnailsView(const Params: array of string);
procedure cm_LeftThumbView(const Params: array of string);
procedure cm_RightThumbView(const Params: array of string);
procedure cm_TreeView(const Params: array of string);
procedure cm_CopyNamesToClip(const Params: array of string);
procedure cm_FocusCmdLine(const Params: array of string);
procedure cm_FileAssoc(const Params: array of string);
@ -1697,6 +1698,17 @@ begin
frmMain.ActiveFrame.SetFocus;
end;
procedure TMainCommands.cm_TreeView(const Params: array of string);
begin
gSeparateTree := not gSeparateTree;
with frmMain do
begin
UpdateWindowView;
UpdateTreeViewPath;
MainSplitterPos:= MainSplitterPos;
end;
end;
procedure TMainCommands.cm_Edit(const Params: array of string);
var
i: Integer;
@ -2252,6 +2264,7 @@ begin
begin
uGlobs.gShowSystemFiles:= not uGlobs.gShowSystemFiles;
actShowSysFiles.Checked:= uGlobs.gShowSystemFiles;
UpdateTreeView;
//repaint both panels
FrameLeft.Reload;
FrameRight.Reload;