Sample Projects for the ShellBrowser component
Three sample projects are coming with the ShellBrowser component, which have a different difficulty: Easy.dpr, Medium.dpr and Explorer.dpr. The screenshots are taken from a German Windows 95, on an english Windows version, the context menu and other elements would of course appear in english, etc. You can download these samples in executable form (473 kb).
"Easy" is an introducing project,
which shows how to display the context menu or the properties pages for a single
object. The code look like this:
ShellBrowser.ObjectName :=
Edit.Text;
ShellBrowser.ShowContextMenu(ClientToScreen(
Point(40,60)),
nil);
Additionally it shows how to call the BrowseForFolder
dialog of windows 95/NT with the ShellBrowser component.
"Medium" is a project which looks like a simple Explorer windows. It can list the contents of a folder, displays the correct item for every object and displays the context menu on a right mouse click. If you double click on an objects it executes its default action or browses into it, if it is a folder. Showing the contents of a folder is very easy with the ShellBrowser component, the code looks like this:
ShellBrowser.Folder := Edit.Text; while ShellBrowser.Next do Item := ListView.Item.Add; Item.Caption := ShellBrowser.ObjectName; Item.ImageIndex := ShellBrowser.ImageIndex; end;
Instead of the while loop, you can use the FillListView method. It can also fill the columns of a Listview with the details of the files.
ShellBrowser.Folder := Edit.Text; ShellBrowser.FillListView(ListView, True);
"Explorer" is a project which shows how to build an Explorer like application using the visual shell controls of the ShellBrowser component suite. On the left pane, you have the typical TreeView, on the right pane the contents of the current folder is displayed. In the toolbar you find some of the typical explorer buttons like delete, properties, small/large icons. For every item, the context menu is displayed when the user clicks on it with the right mouse button, the items can be renamed and Drag&Drop operations are supported. The only code written for this sample project were the handlers for the SpeedButtons in the toolbar of the window (usually one line for each button).
Back to Delphi Components | info@jam-software.com |