1
# -------------------------------------------------------------------------
2
#
3
#  Copyright (c) 2007, Enthought, Inc.
4
#  All rights reserved.
5
#
6
#  This software is provided without warranty under the terms of the BSD
7
#  license included in LICENSE.txt and may be redistributed only
8
#  under the conditions described in the aforementioned license.  The license
9
#  is also available online at http://www.enthought.com/licenses/BSD.txt
10
#
11
#  Thanks for using Enthought open source!
12
#
13
#  Author: David C. Morrill
14
#  Date:   07/14/2008
15
#
16
# -------------------------------------------------------------------------
17

18 11
""" Editor factory for scrubber-based integer or float value editors.
19
"""
20

21

22

23 11
from pyface.ui_traits import Alignment
24 11
from traits.api import Float, Property
25

26 11
from ..basic_editor_factory import BasicEditorFactory
27 11
from ..toolkit import toolkit_object
28 11
from ..toolkit_traits import Color
29

30
# -------------------------------------------------------------------------
31
#  Create the editor factory object:
32
# -------------------------------------------------------------------------
33

34
# Editor factory for scrubber-based integer or float value editors.
35

36

37 11
class ScrubberEditor(BasicEditorFactory):
38

39
    #: The editor class to be instantiated:
40 11
    klass = Property()
41

42
    #: The low end of the scrubber range:
43 11
    low = Float()
44

45
    #: The high end of the scrubber range:
46 11
    high = Float()
47

48
    #: The normal increment (default: auto-calculate):
49 11
    increment = Float()
50

51
    #: The alignment of the text within the scrubber:
52 11
    alignment = Alignment("center")
53

54
    #: The background color for the scrubber:
55 11
    color = Color(None)
56

57
    #: The hover mode background color for the scrubber:
58 11
    hover_color = Color(None)
59

60
    #: The active mode background color for the scrubber:
61 11
    active_color = Color(None)
62

63
    #: The scrubber border color:
64 11
    border_color = Color(None)
65

66
    #: The color to use for the value text:
67 11
    text_color = Color("black")
68

69 11
    def _get_klass(self):
70
        """ Returns the toolkit-specific editor class to be instantiated.
71
        """
72 0
        return toolkit_object("scrubber_editor:_ScrubberEditor")

Read our documentation on viewing source code .

Loading