Package pydrizzle :: Package traits102 :: Module trait_sheet
[hide private]
[frames] | no frames]

Module trait_sheet

source code

Classes [hide private]
  TraitSheetHandler
  TraitEditor
  TraitMonitor
  TraitGroupItem
  TraitGroup
  TraitGroupList
  MergeTraitGroups
Variables [hide private]
  none_or_string = Trait(None, None, StringType)
  true_trait = Trait('true', {'true': 1, 't': 1, 'yes': 1, 'y': ...
  style_trait = Trait(None, None, TraitPrefixList('simple', 'cus...
  object_trait = Trait(None, None, HasTraits)
  basic_sequence_types = [<type 'list'>, <type 'tuple'>]
  default_trait_sheet_handler = default_trait_sheet_handler
  merge_trait_groups = MergeTraitGroups()
A trait_element is: - A string (specifying a trait name) - A tuple containing 1 to 3 elements: - 1 string: trait name - 2 strings: trait name and UI label - 1 string and 1 TraitEditor: trait name and editor - 2 strings and 1 TraitEditor: trait name, UI label and editor
  __package__ = 'pydrizzle.traits102'

Imports: StringType, ListType, TupleType, SequenceTypes, TraitPrefixList, Trait, HasTraits, ReadOnly, lowercase, uppercase


Variables Details [hide private]

true_trait

Value:
Trait('true', {'true': 1, 't': 1, 'yes': 1, 'y': 1, 'on': 1, 1: 1, 'fa\
lse': 0, 'f': 0, 'no': 0, 'n': 0, 'off': 0, 0: 0})

style_trait

Value:
Trait(None, None, TraitPrefixList('simple', 'custom', 'text', 'readonl\
y'))

merge_trait_groups


A trait_element is:
  - A string (specifying a trait name)
  - A tuple containing 1 to 3 elements:
      - 1 string:  trait name
      - 2 strings: trait name and UI label
      - 1 string and 1 TraitEditor: trait name and editor
      - 2 strings and 1 TraitEditor: trait name, UI label and editor

A Trait Sheet description can be:
  - A string  (edit the single trait whose name is specified by the string)
  - A list of trait_elements: (simple non-tabbed trait sheet, vertically
           oriented, two-column using UI labels and simple editor)
  - A TraitGroup (simple non-tabbed trait sheet using layout specified by
           the TraitGroup contents)
  - A list of TraitGroup's (Each TraitGroup defines a notebook tab, the
      contents of which are defined by the TraitGroup's contents)

Each element passed to a TraitGroup constructor can be:
  - A trait_element (defines a single trait to be editor)
  - A TraitGroup (defines a nested group of traits to be edited)

Examples of Trait Sheet descriptions:

[ 'foo', 'bar', 'baz' ]

[ TraitGroup( 'foo', 'bar', 'baz',        label = 'Main' ),
  TraitGroup( 'color', 'style', 'weight', label = 'Border' )
]

[ TraitGroup( ( 'foo', 'Enter Foo' ),
          ( 'bar', 'Enter Bar', TraitEditBar() ),
            'baz', label = 'Main' ),
  TraitGroup( 'color', 'style', 'weight', label = 'Border' )
]

[ TraitGroup(
        TraitGroup( 'foo', 'bar', 'baz',
                  label = 'Group 1' ),
        TraitGroup( 'color', 'style', 'weight',
                  label       = 'Line',
                  border      = 'no',
                  orientation = 'horizontal',
                  show_labels = 'no',
                  style       = 'custom' ),
     label = 'Main' ),

Value:
MergeTraitGroups()