File: text_field_style.py

package info (click to toggle)
python-enable 3.3.1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 10,392 kB
  • ctags: 17,135
  • sloc: cpp: 79,151; python: 29,601; makefile: 2,926; sh: 43
file content (40 lines) | stat: -rw-r--r-- 1,163 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Enthought library imports
from enthought.traits.api import HasTraits, Int, Bool
from enthought.kiva.traits.api import KivaFont
from enthought.enable.colors import ColorTrait


class TextFieldStyle(HasTraits):
    """ This class holds style settings for rendering an EnableTextField.
        fixme: See docstring on EnableBoxStyle
    """

    # The color of the text
    text_color = ColorTrait((0,0,0,1.0))

    # The font for the text (must be monospaced!)
    font = KivaFont("Courier 12")

    # The color of highlighted text
    highlight_color = ColorTrait((.65,0,0,1.0))

    # The background color of highlighted items
    highlight_bgcolor = ColorTrait("lightgray")
    
    # The font for flagged text (must be monospaced!)
    highlight_font = KivaFont("Courier 14 bold")

    # The number of pixels between each line
    line_spacing = Int(3)

    # Space to offset text from the widget's border
    text_offset = Int(5)

    # Cursor properties
    cursor_color = ColorTrait((0,0,0,1))
    cursor_width = Int(2)

    # Drawing properties
    border_visible = Bool(False)
    border_color = ColorTrait((0,0,0,1))
    bgcolor = ColorTrait((1,1,1,1))