File: text_field_style.py

package info (click to toggle)
python-enable 4.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 7,280 kB
  • ctags: 13,899
  • sloc: cpp: 48,447; python: 28,502; ansic: 9,004; makefile: 315; sh: 44
file content (40 lines) | stat: -rw-r--r-- 1,133 bytes parent folder | download | duplicates (3)
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 traits.api import HasTraits, Int, Bool
from kiva.trait_defs.api import KivaFont
from 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))