~ubuntu-branches/ubuntu/trusty/python-enable/trusty

« back to all changes in this revision

Viewing changes to enthought/enable/traits/ui/wx/rgba_color_editor.py

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2011-04-05 21:54:28 UTC
  • mfrom: (1.1.5 upstream)
  • mto: (8.2.1 sid)
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: james.westby@ubuntu.com-20110405215428-1x2wtubz3ok2kxaq
Tags: upstream-3.4.1
ImportĀ upstreamĀ versionĀ 3.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#  Constants:
31
31
#-------------------------------------------------------------------------------
32
32
 
33
 
# Standard color samples: 
34
 
color_choices = ( 0, 51, 102, 153, 204, 255 ) 
35
 
color_samples = [ None ] * 216 
36
 
i             = 0 
37
 
for r in color_choices: 
38
 
    for g in color_choices: 
39
 
        for b in color_choices: 
40
 
            color_samples[i] = wx.Colour( r, g, b ) 
41
 
            i += 1   
 
33
# Standard color samples:
 
34
color_choices = ( 0, 51, 102, 153, 204, 255 )
 
35
color_samples = [ None ] * 216
 
36
i             = 0
 
37
for r in color_choices:
 
38
    for g in color_choices:
 
39
        for b in color_choices:
 
40
            color_samples[i] = wx.Colour( r, g, b )
 
41
            i += 1
42
42
 
43
43
#-------------------------------------------------------------------------------
44
44
#  'ToolkitEditorFactory' class:
64
64
    #  'Editor' factory methods:
65
65
    #---------------------------------------------------------------------------
66
66
 
67
 
    def simple_editor ( self, ui, object, name, description, parent ): 
68
 
        return SimpleColorEditor( parent, 
69
 
                                  factory     = self, 
70
 
                                  ui          = ui, 
71
 
                                  object      = object, 
72
 
                                  name        = name, 
 
67
    def simple_editor ( self, ui, object, name, description, parent ):
 
68
        return SimpleColorEditor( parent,
 
69
                                  factory     = self,
 
70
                                  ui          = ui,
 
71
                                  object      = object,
 
72
                                  name        = name,
73
73
                                  description = description)
74
 
        
75
 
    def custom_editor ( self, ui, object, name, description, parent ): 
76
 
        return CustomColorEditor( parent, 
77
 
                                  factory     = self, 
78
 
                                  ui          = ui, 
79
 
                                  object      = object, 
80
 
                                  name        = name, 
 
74
 
 
75
    def custom_editor ( self, ui, object, name, description, parent ):
 
76
        return CustomColorEditor( parent,
 
77
                                  factory     = self,
 
78
                                  ui          = ui,
 
79
                                  object      = object,
 
80
                                  name        = name,
81
81
                                  description = description )
82
 
        
83
 
    def text_editor ( self, ui, object, name, description, parent ): 
84
 
        return TextColorEditor( parent, 
85
 
                                factory     = self, 
86
 
                                ui          = ui, 
87
 
                                object      = object, 
88
 
                                name        = name, 
 
82
 
 
83
    def text_editor ( self, ui, object, name, description, parent ):
 
84
        return TextColorEditor( parent,
 
85
                                factory     = self,
 
86
                                ui          = ui,
 
87
                                object      = object,
 
88
                                name        = name,
89
89
                                description = description )
90
 
        
91
 
    def readonly_editor ( self, ui, object, name, description, parent ): 
92
 
        return ReadonlyColorEditor( parent, 
93
 
                                    factory     = self, 
94
 
                                    ui          = ui, 
95
 
                                    object      = object, 
96
 
                                    name        = name, 
 
90
 
 
91
    def readonly_editor ( self, ui, object, name, description, parent ):
 
92
        return ReadonlyColorEditor( parent,
 
93
                                    factory     = self,
 
94
                                    ui          = ui,
 
95
                                    object      = object,
 
96
                                    name        = name,
97
97
                                    description = description )
98
 
        
 
98
 
99
99
    #---------------------------------------------------------------------------
100
100
    #  Gets the object trait color:
101
101
    #---------------------------------------------------------------------------