- self.SetHandler(g.testWin, g.testWin)
- g.testWin.Connect(wxID_ANY, wxID_ANY, wxEVT_LEFT_DOWN, self.OnTestWinLeftDown)
+ if evt.GetId() == self.ID_LOCATE or \
+ evt.GetId() == self.ID_TOOL_LOCATE and evt.IsChecked():
+ self.SetHandler(g.testWin, g.testWin)
+ g.testWin.Connect(wxID_ANY, wxID_ANY, wxEVT_LEFT_DOWN, self.OnTestWinLeftDown)
+ if evt.GetId() == self.ID_LOCATE:
+ self.tb.ToggleTool(self.ID_TOOL_LOCATE, True)
+ elif evt.GetId() == self.ID_TOOL_LOCATE and not evt.IsChecked():
+ self.SetHandler(g.testWin, None)
+ g.testWin.Disconnect(wxID_ANY, wxID_ANY, wxEVT_LEFT_DOWN)
+ self.SetStatusText('Click somewhere in your test window now')