dabo Commit
Revision 7056
Date: 2012-01-20 09:10:58 -0800 (Fri, 20 Jan 2012)
Author: Jacekk
Trac: http://trac.dabodev.com/changeset/7056

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

Log:
Update of window style internal manipulation methods, added support for AGW 
controls.

Diff:
Modified: trunk/dabo/ui/uiwx/dPemMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dPemMixin.py     2012-01-19 21:15:28 UTC (rev 7055)
+++ trunk/dabo/ui/uiwx/dPemMixin.py     2012-01-20 17:10:58 UTC (rev 7056)
@@ -1889,26 +1889,38 @@
 
        # The following 3 flag functions are used in some of the property
        # get/set functions.
-       def _hasWindowStyleFlag(self, flag):
+       def _getWindowStyleMechanics(self, advanced):
+               """Returns tuple of window style parameter and style 
manipulation
+               method references for ordinary or AGW windows.
+               """
+               if advanced:
+                       return ("agwStyle", self.GetAGWWindowStyleFlag, 
self.SetAGWWindowStyleFlag)
+               else:
+                       return ("style", self.GetWindowStyleFlag, 
self.SetWindowStyleFlag)
+
+       def _hasWindowStyleFlag(self, flag, advanced=False):
                """Return whether or not the flag is set. (bool)"""
+               mechanics = self._getWindowStyleMechanics(advanced)
                if self._constructed():
-                       return (self.GetWindowStyleFlag() & flag) == flag
+                       return (mechanics[1]() & flag) == flag
                else:
-                       return (self._preInitProperties["style"] & flag) == flag
+                       return (self._preInitProperties[mechanics[0]] & flag) 
== flag
 
-       def _addWindowStyleFlag(self, flag):
+       def _addWindowStyleFlag(self, flag, advanced=False):
                """Add the flag to the window style."""
+               mechanics = self._getWindowStyleMechanics(advanced)
                if self._constructed():
-                       self.SetWindowStyleFlag(self.GetWindowStyleFlag() | 
flag)
+                       mechanics[2](mechanics[1]() | flag)
                else:
-                       self._preInitProperties["style"] = 
self._preInitProperties["style"] | flag
+                       self._preInitProperties[mechanics[0]] = 
self._preInitProperties[mechanics[0]] | flag
 
-       def _delWindowStyleFlag(self, flag):
+       def _delWindowStyleFlag(self, flag, advanced=False):
                """Remove the flag from the window style."""
+               mechanics = self._getWindowStyleMechanics(advanced)
                if self._constructed():
-                       self.SetWindowStyleFlag(self.GetWindowStyleFlag() & 
(~flag))
+                       mechanics[2](mechanics[1]() & (~flag))
                else:
-                       self._preInitProperties["style"] = 
self._preInitProperties["style"] & (~flag)
+                       self._preInitProperties[mechanics[0]] = 
self._preInitProperties[mechanics[0]] & (~flag)
 
 
        def _getBackColor(self):



_______________________________________________
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/[email protected]

Reply via email to