~vcs-imports/pythoncad/main

« back to all changes in this revision

Viewing changes to PythonCAD/Generic/preferences.py

  • Committer: arth
  • Date: 2007-06-14 21:07:33 UTC
  • Revision ID: vcs-imports@canonical.com-20070614210733-wh1bhg718gcd05kl

PythonCAD/Generic/preferences.py: When setting LINE_STYLE, also set
LINE_TYPE, LINE_COLOR, and LINE_THICKNESS; actually set TEXT_STYLE
in _set_text_style (oops!) and set the various TEXT/FONT options
as well.

Show diffs side-by-side

added added

removed removed

Lines of Context:
546
546
    if isinstance(_obj, dict):
547
547
        try:
548
548
            _tstyle = _parse_textstyle(_obj)
 
549
            globals.prefs['TEXT_STYLE'] = _tstyle
 
550
            globals.prefs['FONT_WEIGHT'] = _tstyle.getWeight()
 
551
            globals.prefs['FONT_STYLE'] = _tstyle.getStyle()
 
552
            globals.prefs['FONT_FAMILY'] = _tstyle.getFamily()
 
553
            globals.prefs['TEXT_SIZE'] = _tstyle.getSize()
 
554
            globals.prefs['TEXT_ANGLE'] = _tstyle.getAngle()
 
555
            globals.prefs['TEXT_ALIGNMENT'] = _tstyle.getAlignment()
549
556
            _color = _tstyle.getColor()
550
557
            _colors = globals.prefs['COLORS']
551
558
            if _color not in _colors:
552
559
                _colors.append(_color)
 
560
            globals.prefs['FONT_COLOR'] = _color
553
561
        except StandardError, _e:
554
562
            sys.stderr.write("Invalid TextStyle: " + _e + "\n")
555
563
    else:
629
637
            _style = _parse_style(_obj)
630
638
            globals.prefs['LINE_STYLE'] = _style
631
639
            _lt = _style.getLinetype()
 
640
            globals.prefs['LINE_TYPE'] = _lt
632
641
            _lts = globals.prefs['LINETYPES']
633
642
            if _lt not in _lts:
634
643
                _lts.append(_linetype)
635
644
            _color = _style.getColor()
 
645
            globals.prefs['LINE_COLOR'] = _color
636
646
            _colors = globals.prefs['COLORS']
637
647
            if _color not in _colors:
638
648
                _colors.append(_color)
 
649
            globals.prefs['LINE_THICKNESS'] = _style.getThickness()
639
650
        except StandardError, _e:
640
651
            sys.stderr.write("Invalid Style: " + _e + "\n")
641
652
    else: