Changeset 3063
- Timestamp:
- 04/14/2007 02:51:47 PM (2 years ago)
- Files:
-
- trunk/dabo/ui/uiwx/dEditBox.py (modified) (2 diffs)
- trunk/dabo/ui/uiwx/dFont.py (modified) (1 diff)
- trunk/dabo/ui/uiwx/dPemMixin.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dabo/ui/uiwx/dEditBox.py
r3054 r3063 241 241 242 242 243 def _getWordWrap(self): 244 return not self._hasWindowStyleFlag(wx.HSCROLL) 245 246 def _setWordWrap(self, val): 247 fontSize = self.GetFont().GetPointSize() 248 self._delWindowStyleFlag(wx.HSCROLL) 249 if not val: 250 self._addWindowStyleFlag(wx.HSCROLL) 251 dabo.ui.callAfter(self._setFontSize, fontSize) 252 243 253 # property definitions follow: 244 254 Alignment = property(_getAlignment, _setAlignment, None, … … 283 293 _("Specifies the current state of the control (the value of the field). (varies)")) 284 294 295 WordWrap = property(_getWordWrap, _setWordWrap, None, 296 _("""Specifies whether words get wrapped (the default). (bool) 297 298 If False, a horizontal scrollbar will appear when a line is too long 299 to fit in the horizontal space.""")) 285 300 286 301 DynamicAlignment = makeDynamicProperty(Alignment) trunk/dabo/ui/uiwx/dFont.py
r3054 r3063 49 49 50 50 def _setFace(self, val): 51 self._nativeFont.SetFaceName(val) 51 if not self._nativeFont.SetFaceName(val): 52 # The font wasn't found on the user's system. Try to set it 53 # automatically based on some common-case mappings. 54 automatic_face = None 55 if val.lower() in ("courier", "courier new", "monospace", "mono"): 56 for trial in ("Courier New", "Courier", "Monaco", "Monospace", "Mono"): 57 if self._nativeFont.SetFaceName(trial): 58 automatic_face = trial 59 break 60 elif val.lower() in ("arial", "helvetica", "geneva", "sans"): 61 for trial in ("Arial", "Helvetica", "Geneva", "Sans Serif", "Sans"): 62 if self._nativeFont.SetFaceName(trial): 63 automatic_face = trial 64 break 65 elif val.lower() in ("times", "times new roman", "Georgia", "serif"): 66 for trial in ("Times New Roman", "Times", "Georgia", "Serif"): 67 if self._nativeFont.SetFaceName(trial): 68 automatic_face = trial 69 break 70 71 if automatic_face: 72 dabo.infoLog.write(_("The font '%s' doesn't exist on the system. Used '%s' instead.") 73 % (val, automatic_face)) 74 else: 75 dabo.errorLog.write(_("The font '%s' doesn't exist on the system.") 76 % val) 77 52 78 self._propsChanged() 53 79 trunk/dabo/ui/uiwx/dPemMixin.py
r3054 r3063 1767 1767 def _setFontFace(self, val): 1768 1768 if self._constructed(): 1769 if val in dabo.ui.getAvailableFonts(): 1770 try: 1771 self.Font.Face = val 1772 except dabo.ui.assertionException: 1773 dabo.errorLog.write(_("Could not set the FontFace for %s to '%s'.") % (self.Name, val)) 1774 else: 1775 dabo.errorLog.write(_("The FontFace '%s' does not exist on this system.") % val) 1776 1769 self.Font.Face = val 1777 1770 else: 1778 1771 self._properties["FontFace"] = val
