Author: bugman Date: Tue Jun 21 16:44:32 2011 New Revision: 13147 URL: http://svn.gna.org/viewcvs/relax?rev=13147&view=rev Log: Clicking on a toggle new analysis button now does nothing. Modified: branches/gui_testing/gui/analyses/wizard.py Modified: branches/gui_testing/gui/analyses/wizard.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/wizard.py?rev=13147&r1=13146&r2=13147&view=diff ============================================================================== --- branches/gui_testing/gui/analyses/wizard.py (original) +++ branches/gui_testing/gui/analyses/wizard.py Tue Jun 21 16:44:32 2011 @@ -95,6 +95,22 @@ class New_analysis_button(buttons.ThemedGenBitmapTextToggleButton): """A special button for the new analysis panel.""" + def OnLeftDown(self, event): + """Catch left button mouse down events to ignore when the button is toggled. + + @param event: The wx event. + @type event: wx event + """ + + # Do nothing on a click if already selected. + if self.GetValue(): + event.Skip() + + # Otherwise, perform the normal operations. + else: + super(buttons.ThemedGenBitmapTextToggleButton, self).OnLeftDown(event) + + def OnMouse(self, event): """Catch mouse events, specifically entry into the window. @@ -106,7 +122,7 @@ if event.GetEventType() == wx.EVT_ENTER_WINDOW.typeId and self.GetValue(): event.Skip() - # Otherwise perform the normal operations. + # Otherwise, perform the normal operations. else: super(buttons.ThemedGenBitmapTextToggleButton, self).OnMouse(event)