Ed Leafe wrote:
> On Dec 6, 2008, at 6:15 PM, Paul McNett wrote:
>
>> Is there any special code that runs for the grid or column objects?
>> Do you intercept
>> paint events or anything along those lines?
>
> Of course; events have to be intercepted to prevent objects from
> acting like live objects. The code is in ClassDesignerControlMixin.py;
> here's the relevant section:
>
> # Update bindings; do control-specific things.
> if isinstance(self, dabo.ui.dGrid):
> coolEvents = (dEvents.GridHeaderPaint,
> dEvents.GridRowSize,
> dEvents.GridColSize,
> dEvents.GridHeaderMouseLeftDown,
> dEvents.GridHeaderMouseMove,
> dEvents.GridHeaderMouseLeftUp)
> badEvents = []
> for bnd in self._eventBindings:
> if bnd[0] not in coolEvents:
> badEvents.append(bnd)
> for bad in badEvents:
> self._eventBindings.remove(bad)
>
> What this does is unbind all the events except those in 'coolEvents'.
> This has been working fine until the recent changes for Visible, and
> then only when one column is set to Visible=False.
It doesn't look like that would be it, anyway. I was really wondering about wx
events
being intercepted, not dabo events, and I think the EVT_PAINT of the grid
header
window is the only pertinent one.
Can you merge the following int dGrid.py and tell me the output? And try
uncommenting
that continue and commenting return. It smells of just this problem but I'm not
sure
why it isn't a problem in the dGrid test.
Index: dGrid.py
===================================================================
--- dGrid.py (revision 4788)
+++ dGrid.py (working copy)
@@ -2345,7 +2345,10 @@
else:
dc = wx.ClientDC(w)
+ print "========================="
+
for idx, col in enumerate(self._columns):
+ print idx, col.Caption, col.Visible
headerRect = col._getHeaderRect()
intersect = wx.IntersectRect(updateBox, headerRect)
if intersect is None:
@@ -2357,7 +2360,12 @@
if not colObj:
# Grid is probably being created or destroyed,
so
just return
return
+ ## Ed, I have a hunch on this. Try commenting
return
+ ## and uncommenting continue
+ #continue
dc.SetClippingRegion(*headerRect)
+
+ print "still here"
holdBrush = dc.GetBrush()
holdPen = dc.GetPen()
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]