XE4 TShellListView TShellTreeView 资源管理器
来源:互联网 发布:js点击展开 隐藏切换 编辑:程序博客网 时间:2024/06/01 08:12
但在Delphi的Demo中有一个ShellControls,安装其目录下的 dclshlctrls.dpk 即可成功安装Shell组件。
注1:Shell组件安装后还是在组件面板的Sample页中;
注2:Delphi2007的Demo目录在:我的电脑-共享文档-RAD Studio-Demos-DelphiWin32-VCLWin32;
在 使用Shell这样的组件时,程序编译后都会出现以下的警告:[DCC Warning] Unit1.pas(7): W1005 Unit ‘ShellCtrls’ is specific to a platform ,如果您不想让他显示的话,可以在你工程相关源文件的开头加上以下代码:
{$WARN UNIT_PLATFORM OFF}
XE4 XE5
D:\Users\Public\Documents\RAD Studio\12.0\Samples\Delphi\VCL\ShellControls\vclshlctrls.dpk
dclshlctrls.dpk
http://delphi.about.com/od/delphi-tips-2011/qt/xe2-vcl-shell-shellctrls.htm
ShellControls (TShellTreeView, TShellListView) In Delphi XE2
Using Shell Controls - Need My ShellCtrls.pas NOT Vcl.Shell.ShellCtrls.pas
By Zarko Gajic
- Delphi XE
- Delphi Components
- Delphi PDF
- Delphi VCL
- Delphi Tool
Ads
Delphi Globalization Toolwww.tsilang.comGlobalize your Delphi applications easy, professionally and fast!
义翘-圣诞好礼三重巨献www.sinobiological.cn北京义翘神州-蛋白/抗体生产专家 价格优惠,严格质控,现货储备
Delphi FireMonkey Controlswww.woll2woll.comProfessional FireMonkey Controls for Delphi (Grid, Editors, Lookups)
Ads
SDL Delphi Componentswww.lohninger.comHiTech components: 3D-plots, math, statistics, FFT, regression, meters
Image Library for Delphiwww.imageen.comCreate professional multimedia and photo apps with Delphi and ImageEn
Delphi XE2 has Vcl.Shell.ShellCtrls.pas, but the Shell Controls package is not installed by default. There's ShellCtrls.pas in the samples folder (as before) - use it to manually install the package.
Trick question: what compiled (DCU) version of "shellctrls.pas" is used by Delphi?
I have an application which extensively uses controls from the "Shell Control Property and Component Editors" package. The package is shipped with Delphi as a sample project for quite some time. Theshell components included are TShellTreeView, TShellListView, TShellComboBox and TShellChangeNotifier.
The TShellListView control can be used to display files from the file system. Paired with TShellTreeView shell, the TShellListView can be used to mimic Windows Explorer user interface.
In Delphi XE2, the package is not installed by default and you have to install it manually. The source files are located inside the "$(ALLUSERSPROFILE)\Documents\RAD Studio\9.0\Samples\Delphi\VCL\ShellControls" folder. On Windows 7, the "$(ALLUSERSPROFILE)" is "C:\Users\Public". On Windows XP, the all users documents folder is "C:\Documents and Settings\All Users\Documents".
Once you have the packages installed, the "Samples" section on the Tool Palette will host the mentioned 4 components.
My Own Version Of TSHellListView
By design, the TShellListView sorts files (and folders) ascending by their name. There's no "OnCompare" event you can handle to change the sort order or the column (name, type, date modified, size) used for sorting.The Add Custom Sorting To Delphi's TShellListView Control explains how to do a little tweak to the source unit (ShellCtrls.pas) where TShellList view is implemented, recompile the package and use the tweaked version of the TShellListView (exposing one more property).
No Go In Delphi XE2
Once you are done with recompiling of the Shell Controls package, start a new VCL Forms application in Delphi XE2, drop TShellListView on the form and try accessing the added FolderList property ... no go! :(Note the uses clause of your unit: it will list "Vcl.Shell.ShellCtrls".
Delphi XE2 introduced Unit Scope Names - prefixes that are prepended to unit names in the VCL (, FMX, RTL) libraries.
When you hit Compile, Delphi looks for compiled units your code uses into the Library Path (Tools - Options - Environment Options - Delphi Options - Library) list. This list has "c:\program files (x86)\embarcadero\rad studio\9.0\lib\Win32\release" as the first item - go there and locate the "Vcl.Shell.ShellCtrls.dcu" used by Delphi to compile your application.
This is NOT the "ShellCtrls.dcu" I want to be used. My version of "ShellCtrls.pas" is located, remember, here: "$(ALLUSERSPROFILE)\Documents\RAD Studio\9.0\Samples\Delphi\VCL\ShellControls"
How do I tell Delphi to use my version of the ShellCtrls unit and not the one shipped with Delphi XE2 (but not installed on the Tool Palette) ?
Two actions were required:
- Add "$(ALLUSERSPROFILE)\Documents\RAD Studio\9.0\Samples\Delphi\VCL\ShellControls" to the Library Path (Tools - Options - Environment Options - Delphi Options - Library list)
- Edit the uses class to specify the non unit-scoped name: delete "Vcl.Shell.ShellCtrls" and add "ShellCtrls"
Epilogue
Confession: maybe there's a better way to do the above. Maybe with some next Update, shell controls will be installed by default. Maybe I done something wrong :)After all, the above work was done while I was upgrading one of my bigger application to Delphi XE2 (new machine, full backup, and all that work).
All in all, I have my version of TShellListView and my sorting works. I am able to compile the entire project (quite a few third-party components used). Am happy, can move on adding more planned features to the application.
Moved from Delphi XE to Delphi XE2 and I have to say I am not unhappy with the time invested in the upgrade. If you can, go for XE2.
- XE4 TShellListView TShellTreeView 资源管理器
- 资源管理器
- 资源管理器
- 资源管理器
- 资源管理器
- xe4 GridEh
- xe4 StringReplace
- d7 xe4 path
- XE4 RTTI 1
- XE4 ToolsAPI ActionServices
- xe4 GetBookmark GotoBookmark
- xe4 编译 独立运行
- xe4 code Example
- XE4 base64 编码 方法
- xe4 xe5 代码格式化
- TTS遇到问题及TShellListView使用及DS1
- c#资源管理器
- 资源管理器源码
- 用C++11 thread 类编写多线程程序
- MTK Android Driver :camera
- Android 网络通信框架Volley简介(Google IO 2013)
- style.display 和 style.visibility
- 一个实现Tab切换的容器扩展
- XE4 TShellListView TShellTreeView 资源管理器
- 线程局部存储TLS
- SSH客户端PUTTY登录时只一闪就消失退出是什么原因
- C++ 虚继承 多重继承
- DBI(i80)/DPI(RGB)/DSI
- 约瑟夫环问题 Java
- DB2的常用命令
- 你行你上啊——新炬拓展全民皆大厨篇
- 简洁的几种javascript写法