dabo Commit
Revision 5549
Date: 2009-12-08 08:23:51 -0800 (Tue, 08 Dec 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5549

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

Log:
Added the BackgroundErased event as requested by Jacek Ka?\197?\130ucki in 
ticket #1306


Diff:
Modified: trunk/dabo/dEvents.py
===================================================================
--- trunk/dabo/dEvents.py       2009-12-02 22:00:31 UTC (rev 5548)
+++ trunk/dabo/dEvents.py       2009-12-08 16:23:51 UTC (rev 5549)
@@ -462,6 +462,13 @@
        appliesToClass = classmethod(appliesToClass)
 
 
+class BackgroundErased(dEvent):
+       """Occurs when a window background has been erased and needs 
repainting."""
+       def appliesToClass(eventClass, objectClass):
+               return issubclass(objectClass, dabo.ui.dPemMixin)
+       appliesToClass = classmethod(appliesToClass)
+
+
 class PageChanged(dEvent):
        """Occurs when a page in a pageframe-like control changes"""
        def appliesToClass(eventClass, objectClass):

Modified: trunk/dabo/ui/uiwx/dPemMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dPemMixin.py     2009-12-02 22:00:31 UTC (rev 5548)
+++ trunk/dabo/ui/uiwx/dPemMixin.py     2009-12-08 16:23:51 UTC (rev 5549)
@@ -414,6 +414,7 @@
                self.Bind(wx.EVT_CONTEXT_MENU, targ.__onWxContextMenu)
                
                self.Bind(wx.EVT_PAINT, self.__onWxPaint)
+               self.Bind(wx.EVT_ERASE_BACKGROUND, self.__onWxEraseBackground)
                self.Bind(wx.EVT_SIZE, self.__onWxResize)
                
                self.bindEvent(dEvents.Create, self.__onCreate)
@@ -674,6 +675,12 @@
                        return
                self._needRedraw = bool(self._drawnObjects)
                self.raiseEvent(dEvents.Paint, evt)
+
+
+       def __onWxEraseBackground(self, evt):
+               if self._finito:
+                       return
+               self.raiseEvent(dEvents.BackgroundErased, evt)
        
 
        def __onWxResize(self, evt):



_______________________________________________
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