API Reference for Enthought Tool Suite 3.0.1
Adds a 'drop_file' feature to DockWindow which allows the object associated with a DockControl to expose a trait which can accept files dropped onto it. The trait can either accept strings (i.e. file names), FilePosition objects, or lists of the above. The trait which accepts files should have 'drop_file' metadata, which can either be True, a file suffix (e.g. '.py'), a list of file extensions, or a DropFile object. If file extensions are specified, then only files with corresponding extensions can be dropped on the view.
Specifying a DropFile object as the 'drop_file' metadata also provides the option of making the trait draggable, as well as specifying a custom tooltip.
a_file_position = FilePosition()
Feature images:
feature_images = (ImageResource('drop_file_feature'), ImageResource('drag_file_feature'))
Valid 'drop styles' and their corresponding types:
valid_types = (('file_positions', [ a_file_position ]), ('file_position', a_file_position), ('file_names', [ '\\test' ]), ('file_name', '\\test'))
| Local name | Refers to |
|---|---|
| DockWindowFeature | enthought.pyface.dock.dock_window_feature.DockWindowFeature |
| DropFile | enthought.developer.features.feature_metadata.DropFile |
| Enum | enthought.traits.trait_types.Enum |
| exists | os.path.exists |
| false | enthought.traits.trait_types.false |
| File | enthought.io.file.File |
| FileDialog | enthought.pyface.file_dialog.FileDialog |
| FilePosition | enthought.developer.helper.file_position.FilePosition |
| HasPayload | enthought.developer.helper.has_payload.HasPayload |
| HasStrictTraits | enthought.traits.has_traits.HasStrictTraits |
| HasTraits | enthought.traits.has_traits.HasTraits |
| ImageResource | enthought.pyface.image_resource.ImageResource |
| List | enthought.traits.trait_types.List |
| OK | enthought.pyface.constant.OK |
| splitext | os.path.splitext |
| Str | enthought.traits.trait_types.Str |
© Copyright 2002-2008 Enthought, Inc.