dabo Commit
Revision 3174
Date: 2007-06-12 12:29:21 -0700 (Tue, 12 Jun 2007)
Author: Paul
Trac: http://svn.dabodev.com/trac/dabo/changeset/3174

Changed:
U   trunk/dabo/ui/uiwx/dEditBox.py

Log:
dEditBox.WordWrap wasn't working on Windows at all. With this commit, it works, 
but only if you send WordWrap to the constructor. Will now test on Mac and 
Linux.

Diff:
Modified: trunk/dabo/ui/uiwx/dEditBox.py
===================================================================
--- trunk/dabo/ui/uiwx/dEditBox.py      2007-06-12 16:06:16 UTC (rev 3173)
+++ trunk/dabo/ui/uiwx/dEditBox.py      2007-06-12 19:29:21 UTC (rev 3174)
@@ -22,10 +22,15 @@
                self._baseClass = dEditBox
                
                preClass = wx.PreTextCtrl
-               kwargs["style"] = wx.TE_MULTILINE | wx.TE_WORDWRAP
+               kwargs["style"] = wx.TE_MULTILINE
                tbm.dTextBoxMixinBase.__init__(self, preClass, parent, 
properties, attProperties, *args, **kwargs)
        
        
+       def _getInitPropertiesList(self):
+               additional = ["WordWrap",]
+               original = list(super(dEditBox, self)._getInitPropertiesList())
+               return tuple(original + additional)
+
        def scrollToBeginning(self):
                """Moves the insertion point to the beginning of the text"""
                self.SetInsertionPoint(0)
@@ -42,15 +47,20 @@
        
        #Property getters and setters
        def _getWordWrap(self):
-               return not self._hasWindowStyleFlag(wx.HSCROLL)
+               return self._hasWindowStyleFlag(wx.TE_BESTWRAP)
        
        def _setWordWrap(self, val):
-               fontSize = self.GetFont().GetPointSize()
-               self._delWindowStyleFlag(wx.HSCROLL)
-               if not val:
-                       self._addWindowStyleFlag(wx.HSCROLL)
-                       if self._constructed():
-                               self.FontSize = fontSize
+               if self._constructed():
+                       fontSize = self.GetFont().GetPointSize()
+               self._delWindowStyleFlag(wx.TE_DONTWRAP)
+               self._delWindowStyleFlag(wx.TE_WORDWRAP)
+               self._delWindowStyleFlag(wx.TE_BESTWRAP)
+               if val:
+                       self._addWindowStyleFlag(wx.TE_BESTWRAP)
+               else:
+                       self._addWindowStyleFlag(wx.TE_DONTWRAP)
+               if self._constructed():
+                       self.FontSize = fontSize
        
        # property definitions follow:
        WordWrap = property(_getWordWrap, _setWordWrap, None,




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]

Reply via email to