Example #1
0
RIGHT = BOTTOM = 1
CENTER         = 2
FILL           = 3

# The mapping from text to numeric alignment values:
AlignmentMapping = {
    'left':   LEFT,
    'top':    TOP,
    'right':  RIGHT,
    'bottom': BOTTOM,
    'center': CENTER,
    'fill':   FILL
}

# Scroll zone images:
tup    = image_for( '@facets:tup?L40'    )
tdown  = image_for( '@facets:tdown?L40'  )
tleft  = image_for( '@facets:tleft?L40'  )
tright = image_for( '@facets:tright?L40' )

# Hide/show zones:
HideZone      = 0
LeftShowZone  = 1
RightShowZone = 2
NoZone        = 3

# Mapping from 'zone' values to tooltips:
ZoneTooltips = {
    HideZone:      'Click to remove item.\n',
    LeftShowZone:  'Click to add hidden item.\n',
    RightShowZone: 'Click to add hidden item.\n',
Example #2
0
from facets.core.facet_base \
    import SequenceTypes

from facets.ui.ui_facets \
    import Image

from facets.extra.helper.image \
    import hlsa_derived_image, DisabledTransform

#-------------------------------------------------------------------------------
#  Constants:
#-------------------------------------------------------------------------------

# The image to use when the editor accepts files:
file_image = image_for( '@facets:file' )

# The image to use when the editor accepts objects:
object_image = image_for( '@facets:object' )

# The image to use when the editor is disabled:
inactive_image = image_for( '@facets:inactive' )

# String types:
string_type = ( str, unicode )

#-------------------------------------------------------------------------------
#  'DNDEditor' class:
#-------------------------------------------------------------------------------

class DNDEditor ( EditorFactory ):