Basil Shubin wrote:
Ed Leafe пишет:
On Oct 28, 2006, at 8:03 AM, Basil Shubin wrote:
For each left button double click it has generate two events. How I
can disable second event raise? For example when I double click on
dGrid row I got dialog box for editing, but when I close it, it
appears again, because of two same event in a queue.
Is this on Windows? There is something odd in the Windows event
system in wxPython that occasionally generates double events. The
work-around is to trap the event and skip it if it is a duplicate. If
you look at the source code in dFormMixin.py, you can see an example
of how we handled the double Activate events under Windows.
I have set 'self._skipActivate=True' in dGrid subclass, but nothing
happens. I still got TWO events by double clicking on a cell. Please, I
need yours help. Maybe there is a workaround for problem like this?
Setting self._skipActivate wouldn't solve your problem, because that is
for skipping the Activate event, not a double-click event. Anyway, I
just ran a test and couldn't duplicate your problem.
Could you please edit dabo/ui/uiwx/dGrid.py, by finding the section
(line 4191 in the version I have):
"""
if __name__ == '__main__':
class TestForm(dabo.ui.dForm):
def afterInit(self):
self.BackColor = "khaki"
g = self.grid = _dGrid_test(self, RegID="sampleGrid")
"""
and changing that to read:
"""
if __name__ == '__main__':
class TestForm(dabo.ui.dForm):
def onDClickTest(self, evt):
print "*"
def afterInit(self):
self.BackColor = "khaki"
g = self.grid = _dGrid_test(self, RegID="sampleGrid")
g.bindEvent(dabo.dEvents.GridMouseLeftDoubleClick,
self.onDClickTest)
"""
and then run dGrid.py. When I run it, I only see one * for each
double-click in a cell. What about you?
--
pkm ~ http://paulmcnett.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users