dabo Commit
Revision 5155
Date: 2009-03-27 15:52:27 -0700 (Fri, 27 Mar 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5155

Changed:
U   trunk/ide/ReportDesigner.py

Log:
Prior fix kept the panel from getting the keyboard focus, which disabled 
keyboard
nudging/sizing and copy/paste etc. Here's the (hopefully) final workaround.


Diff:
Modified: trunk/ide/ReportDesigner.py
===================================================================
--- trunk/ide/ReportDesigner.py 2009-03-27 22:15:13 UTC (rev 5154)
+++ trunk/ide/ReportDesigner.py 2009-03-27 22:52:27 UTC (rev 5155)
@@ -1126,8 +1126,17 @@
 
        def onMouseLeftDown(self, evt):
                self.updateSelected(evt)
-               evt.stop()  ## Otherwise the default of scrolling the panel 
will occur
 
+               # If we let the default event handler run, self.SetFocus() will 
happen,
+               # which we want so that we can receive keyboard focus, but 
SetFocus() has
+               # the side-effect of also scrolling the panel in both 
directions, for some
+               # reason. So, we need to work around this annoyance and call 
SetFocus()
+               # manually:
+               evt.stop() 
+               self.Parent.SetScrollRate(0, 0)
+               self.SetFocus()
+               self.Parent.SetScrollRate(*self.Parent._scrollRate)
+
                self._mouseDown = True
                mouseObj = self.getMouseObject()
                if not isinstance(mouseObj, Band):
@@ -2078,6 +2087,7 @@
                ##      But on Windows, that resulted in the report
                ##      drawing on the panel at the wrong offset. 
                ##      Separating into these 2 calls fixed the issue.
+               self._scrollRate = (u, u)
                self.SetScrollbars(u, u, _scrollWidth, _scrollHeight)
                self.Scroll(viewStart[0], viewStart[1])
 



_______________________________________________
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