ShellBrowser Delphi Components Documentation
ContentsIndexHome
PreviousUpNext
ShellControls.TJamShellList

A JamShellList control looks and behaves like the right pane of the Windows Explorer.

ShellControls_TJamShellListShellControls_TJamShellListShellControls_TJamShellListShellControls_TJamShellListShellControls_TJamShellListShellControls_TJamShellListShellControls_TJamShellListShellControls_TJamShellListShellControls_TJamShellList
Syntax
Pascal
TJamShellList = class(TJamBaseShellListView, IDropTarget, IDropSource, IThumbnailViewer, IIconViewer, ICheckBoxViewer, IUICommandInvokable, IShellCommandInvokable, IJamMultiSelectShellControl, IJamSupportsFilter);

This control displays the contents of a folder in a listview. When the user right clicks on a folder, it will automatically show the context menu. TJamShellList is derived from Delphi's TListView control, so you can use most of the properties and methods of the superclass with a TJamShellList.  

Use the Path property to get or set the current Folder, use the SpecialFolder property to set a special folder like the Control Panel. The Filter property can be used to filter certain files by extension. The FullRefresh method refreshes the displayed information. This control does not have a Font property, because it automatically uses the same font the Windows Explorer uses. Use the Popup property to merge your Delphi popup menus with the Shell Context menu. You can synchronize a TJamShellList with a TJamShellTree by using the ShellLink property.  

By default, a double click is handled by the component and it tries to perform the default action for the selected object. You can however use the OnDblClick event handler of the component to perform your own action. If you for example want to create a file open dialog, you want to handle double clicks on files by yourself, but double clicks on folders should be handled by the component. In this case, an event handler could look like this:

procedure TMyDialog.ShellListViewDblClick(Sender: TObject); begin With ShellListView do begin if (SelectedFiles.Count>0) and FileExists(Path + SelectedFiles[0]) then //Process File like you want ShowMessage('Double click on file: ' + Path + SelectedFiles[0]) else InvokeCommandOnSelected('default'); end;//With end;

 

To improve the speed in which a TJamShellList gets filled, we are using Windows API messages that fill the Subitems of a TJamShellListItem by demand only. As a result, Delphi's SubItems array appears to be empty. If you for some reason need to access the information in the SubItems array, you can use the OnAddItem event. Whenever this event is used, the SubItems array of each item gets filled when it is added (which results in a slower performance).  

Since the extensions of the file may be not displayed dependant on the user's settings it is not sufficient to use the TJamShellListItem. Caption property to determine the name of a file that corresponds to a TJamShellListItem. You should use GetFullPath and SelectedFiles instead.  

While this controls only mimics the right pane of the Windows Explorer, the TJamSystemShellView control hosts a true instance of the Windows Explorer's right pane and therefore looks an behaves exactly like the Windows Explorer on the target system.  

 

JamControls.TJamBaseShellListView
 
Name 
Description 
 
Creates and intializes an instance of this component.  
 
Destroys an instance of a TJamBaseShellListView component  
ShellControls.TJamShellList
 
Name 
Description 
 
Creates an instance of a TJamShellList component.  
 
Destroys the instance of a TJamShellList component.  
JamControls.TJamBaseShellListView
 
Name 
Description 
 
This event is triggered before the user changes the columns by using the header context menu.  
 
This event is triggered before the user changes the columns by using the header context menu.  
 
This event can be implemented to customize columns. It is called when a column is added to the view, but also when the header context menu or the column selection dialog is displayed.  
 
This event is triggered before and after the sort. 
ShellBrowser.IShellCommandInvokable
 
Name 
Description 
 
This event occurs, before a shell context menu command is executed.  
ShellControls.TJamShellList
 
Name 
Description 
 
OnAddItem occurs, whenever a new item is added to a TJamShellList.  
 
This event occurs, before a context menu command is executed.  
 
Happens when the user starts a shell drag operation.  
 
Allows you to prevent unwanted shell drops.  
 
This event is fired, if the state of a checkbox was changed by the user.  
 
This event occurs, if the user has selected a menu item of the shell context menu.  
 
The OnOperation event occurs after the TJamShellList executed a shell operation like pasting or dragging and dropping files.  
 
This event will be triggered a new node is selected.  
 
Allows you to influence the Drop Operation that is performed when dropping a shell item.  
 
This event occurs, when the ShellList receives shell notifications. Further handling can be suppressed by setting the pHandled parameter to true.  
 
The OnThumbnailUpdated event occurs, when a viewed thumbnail is updated.  
 
Name 
Description 
 
Returns the number of selected Objects in the control.  
 
Executes a shell command on the objects selected in the control.  
 
Displays a context menu for the selected items. 
Jam.Shell.Types.ICancellationIndicator
 
Name 
Description 
 
Gets whether cancellation has been requested for this token. 
Jam.Shell.Types.ICancellationToken
 
Name 
Description 
 
Communicates a request for cancellation. 
ShellLink.IJamShellControl
 
Name 
Description 
 
This method is called by the ShellLink instance if the currently selected item has changed. 
 
Getter method for the ShellLink property. 
 
GoUp 
This method indicates that the callee should go up one level and display the contents of the current folder's parent folder. 
 
This method is called by the ShellLink instance if the currently displayed folder has changed. 
 
This method indicates that the control should perform a refresh of its contents. 
 
This method indicates that the callee should select all item it currently displays. 
 
Setter method for the ShellLink property. 
JamControls.TJamBaseShellListView
 
Name 
Description 
 
Auto adjust the widths of all columns.  
 
Returns the current column index for a given TSHColumnId.  
 
Returns a drag cursor if a list item is being dragged. 
 
Use this function to get an array of currently visible columns. 
 
Returns whether the given SHColumnId is currently visible or not.  
 
Checks if the list is empty.  
 
Checks if the Item with the passed index is selected.  
 
Resets the current columns and the saved widths for the current special folder and restores the initial state.  
 
Selects all Items in a TJamShellList.  
 
Set the visibility of a column. 
 
Use this method to display the context menu for the selected entry.  
 
Sort 
Triggers sorting by the current settings (SortedBy, SortOrder)  
ShellBrowser.IShellCommandInvokable
 
Name 
Description 
 
Getter for the OnBeforeShellCommand property.  
 
Setter for the OnBeforeShellCommand property.  
ShellLink.IJamMultiSelectShellControl
 
Name 
Description 
 
Returns an IItemIdListCollection containing the selected ItemIdLists or an empty list if nothing is selected. 
ShellLink.IJamSupportsFilter
 
Name 
Description 
 
Called by the ShellLink instance when the Filter is changed.  
ShellControls.TJamShellList
 
Name 
Description 
 
Creates a new directory in the current folder.  
 
Returns a list view item, if any, with the specified caption. See TCustomListView.FindCaption 
 
Refreshes the contents of the TJamShellList.  
 
Returns the full file system path of the TJamShellListItem at the given Index.  
 
Get the checkbox state of an item.  
 
Returns an IItemIdListCollection containing the selected ItemIdLists or an empty list if nothing is selected. 
 
GoUp 
Goes up one level in the file system structure.  
 
Executes a context menu command for the listed folder.  
 
Executes a shell command on the objects selected in the control.  
 
Use the property IsFolder to check if the current object is a folder.  
 
Checks if moving is possible.  
 
Returns if the item at the given index is a special folder like the Control Panel.  
 
Jump back and forward to directories, which you selected before.  
 
This method returns the size of the files, which the user selected in the TJamShellList.  
 
Shows the background context menu.  
 
Show the context menu for the selected items.  
 
Performs a quick refresh of the contents of the TJamShellList.  
ShellLink.IJamShellControl
 
Name 
Description 
 
The TJamShellLink instance to which the current control connected. 
JamControls.TJamBaseShellListView
 
Name 
Description 
 
Adjust the size of the given column so that it fills the remaining horizontal space.  
 
The delay in ms after the selection has been changed before connected controls are informed. Default 100 ms.  
 
Gets the collection of all column headers that appear in the control.  
 
Sets the column width that is used in ViewStyle vsList  
 
Determines whether the control's image is rendered directly to the window or painted to an in-memory bitmap first.  
 
The TJamIconSize that shall be used in viewstyle vsIcon.  
 
Lets you control the spacing between the large icons and thumbnails. -1 means the spacing is automatically set. A value >= 0 will be added to the width and height of the images of the current view. The small icons should not be affected by this property. 
 
This event is triggered after the columns were created 
 
OnCreateItemClass occurs when a list item object is about to be created.  
 
Specifies where a control looks for its font information. 
 
Prevents operations that change the file system from being executed.  
 
Automatically display the shell context menu.  
 
Use this property to determine if the header conext menu should be displayed when the user right clicks on the columns 
 
Use the same styles as the Windows Explorer.  
 
The version number of the ShellBrower controls. 
ShellControls.TJamShellList
 
Name 
Description 
 
 
Allowed effects when dragging files/folders out of the control.  
 
Allowed effects when dropping files/folders on the control.  
 
 
Receives notifications about changes in the shell and performs refreshes automatically.  
 
Adjust the size of the given column so that it fills the remaining horizontal space.  
 
Image that will be drawn in the background of the control.  
 
If a background image is assigned, this property determines the style in which the image will be shown.  
 
Popup menu for a right click on the background of the List.  
 
Determines whether the list view displays a single line border.  
 
Turns on/off checkboxes for file and folder selection.  
 
Specifies the background color of the control.  
 
Color compressed files.  
 
Color encrypted files.  
 
 
Use CopyMode to control the operation when an item is dragged or dropped.  
 
 
Use this property to control, if the TJamShellList control will show the Details of each object.  
 
Determines whether the control's image is rendered directly to the window or painted to an in-memory bitmap first. 
 
 
 
 
Sets the new default text to be displayed when the view is empty.  
 
Controls whether the control responds to mouse, keyboard, and timer events.  
 
In Thumbnail view, only load thumbnails that are already in the thumbnail cache for folders. Default value true will avoid potentially huge delays that are caused by folder thumbnails reflecting the contents of the folder.  
 
Use FileSystemOnly to specify, if only file system objects should be displayed.  
 
Allows you to filter objects by filename patterns.  
 
Specifies whether the list view's scroll bars are flat.  
 
Gets or sets the current folder.  
 
Font 
Controls the attributes of text written on or in the control. Make sure to turn off UseSystemFont before editing this control! Otherwise the changes will not persist.  
 
Specifies whether headers are repainted when they are dragged.  
 
Determines whether lines are drawn separating items in the list.  
 
List of TListGroup objects to group list items. See TCustomListView.Groups  
 
Turn on and off group view. If true, list items need a GroupID if they should be displayed.  
 
Determines whether the list view gives a visual indication of which item is selected when focus shifts to another control.  
 
Hint 
 
History manages a set of paths, which have been visited. It owns a Paths property to access its members  
 
Specifies whether list items are highlighted when the mouse passes over them.  
 
Specifies the hot tracking styles. 
 
Specifies how long the user must pause with the mouse before an item is selected.  
 
Determines how icons displayed in the list view are arranged. 
 
If set to True, the file extension is used to get the icon and may speed up the filling of the items. False queries specific icons in the background.  
 
The TJamIconSize that shall be used in viewstyle vsIcon.  
 
Determines the behavior of the input method editor (IME). 
 
Specifies the input method editor (IME) to use for converting keyboard input to Asian language characters. 
 
Turns sorting in the list on or off.  
 
Contains the list of items displayed by the list view.  
 
Provides a list of icon images to display for each item in the list when ViewStyle is vsIcon
 
Determines whether the user can select more than one list item at a time.  
 
Prevent the control to be filled on startup of the application.  
 
Set this property to true to allow Ole Drag and Drop operation with the Windows Explorer and other shell controls.  
 
Occurs at discrete points during the rendering of the list view. 
 
Occurs at discrete stages during the painting of an item in an owner-drawn list view. 
 
Occurs at discrete stages during the painting of a subitem in an owner-drawn list view. 
 
This event occurs just before the full refresh is executed.  
 
Occurs when an attempt is made to resize the control. 
 
Occurs immediately after an item in the list changes. 
 
Occurs when an item in the list is about to change. 
 
Occurs when the user clicks the control.  
 
Occurs when the user clicks on a column header in a list view. 
 
Occurs when a column is dragged to a new position.  
 
Occurs when the user right clicks on a column header in a list view. 
 
Occurs when two items need to be compared during a sort of the list. 
 
Occurs when the user right-clicks the control or otherwise invokes the pop-up menu (such as using the keyboard). 
 
 
 
Occurs when a subitem must be rendered in an owner-draw list view. 
 
Occurs when the user double-clicks the left mouse button when the mouse pointer is over the control.  
 
 
 
 
 
 
 
 
 
 
 
 
Occurs when the user pauses the mouse over an item in the list view. 
 
Occurs when a user presses any key while the control has focus.  
 
Occurs when key pressed.  
 
Occurs when a user presses any key while the control has focus.  
 
 
Occurs when the mouse pointer moves over the control.  
 
Occurs when the mouse pointer moves off from over the control.  
 
 
 
The OnPathChanged event occurs, when the users changes the path, before populating the list.  
 
The OnPopulated event occurs, after a TJamShellList was filled completely.  
 
 
 
 
 
Specifies where a control looks for its color information. 
 
Determines where a component looks to determine whether it should have a three-dimensional look. 
 
Determines whether the control's image is rendered directly to the window or painted to an in-memory bitmap first.  
 
Specifies where a control looks for its font information. 
 
Specifies where a control looks to find out if its Help Hint should be shown. 
 
Path 
The path of the current folder, suffixed with ''.  
 
Gets or sets if view settings should be persisted.  
 
Specifies the pop-up menu associated with the control. 
 
Gets or sets the name of the property bag to load and store view settings.  
 
Indicates if sort order is normal or reverse.  
 
Determines whether an entire row in the list view can be selected.  
 
Indicates the first selected item in the list view.  
 
Provides a list of all selected files.  
 
Connects this component to a TJamShellLink in order to synchronize several shell controls.  
 
Determines whether the column headers are displayed.  
 
Show the context menu on the top of the supplied Delphi TPopupMenu.  
 
Allow Windows error messages.  
 
Shows extra large icons.  
 
The property ShowFiles allows you to include the files in the TJamShellList.  
 
The property ShowFolders allows you to include the folders in the TJamShellList, similar to FrontPage 2000.  
 
With this property you can hide or show hidden folders like the recycle bin or some special directories in the Windows folder.  
 
When this property is set to true, the hint text which the shell provides is shown.  
 
Shows jumbo icons.  
 
If set to false, the Network Neighborhood will not be shown. The default value is true.  
 
Determines whether the overlay icons are displayed.  
 
Use this property to show an additional folder ".." to navigate upwards.  
 
Show the Recycle Bin.  
 
If set to true (the default value) the potentially localized folder and object names will be shown. If set to false, the names will be used as they occur in the file system.  
 
Provides a list of icon images to display for each item in the list when ViewStyle is not vsIcon. 
 
The column according to which the listed object are sorted.  
 
The TShellColumnId of the column the view is currently sorted by.  
 
The current sort order of the view.  
 
Allows you to deal with non file system folders.  
 
Specifies additional icon images to display next to each item in the list view. 
 
Specifies the style elements that are used by the control. 
 
Indicates the position of the control in its parent's tab order. 
 
Determines whether the user can tab to a control. 
 
Specifies the background color of the control.  
 
Use ThumbnailHeight to find the vertical size in pixels of the jpeg image.  
 
Switches the thumbnail mode on and off.  
 
Use ThumbnailWidth to find the horizontal size in pixels of the thumbnail image.  
 
Touch specifies the touch manager component associated with the control.  
 
If it is set to true, the TJamShellList uses the same font as the Windows Explorer.  
 
Determines how the list items are displayed.  
 
Determines whether the component appears on screen.