Author: bugman Date: Tue Jun 21 16:03:20 2011 New Revision: 13146 URL: http://svn.gna.org/viewcvs/relax?rev=13146&view=rev Log: Created a modified button class New_analysis_button derived from ThemedGenBitmapTextToggleButton. The mouse events are now monitored so that entry into a selected button does not highlight. 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=13146&r1=13145&r2=13146&view=diff ============================================================================== --- branches/gui_testing/gui/analyses/wizard.py (original) +++ branches/gui_testing/gui/analyses/wizard.py Tue Jun 21 16:03:20 2011 @@ -89,6 +89,26 @@ """ self.pipe_name.SetValue('test') + + + +class New_analysis_button(buttons.ThemedGenBitmapTextToggleButton): + """A special button for the new analysis panel.""" + + def OnMouse(self, event): + """Catch mouse events, specifically entry into the window. + + @param event: The wx event. + @type event: wx event + """ + + # Do nothing if entering the button when it is selected. + if event.GetEventType() == wx.EVT_ENTER_WINDOW.typeId and self.GetValue(): + event.Skip() + + # Otherwise perform the normal operations. + else: + super(buttons.ThemedGenBitmapTextToggleButton, self).OnMouse(event) @@ -170,9 +190,9 @@ # Generate the button. if bmp: image = wx.Bitmap(bmp, wx.BITMAP_TYPE_ANY) - button = buttons.ThemedGenBitmapTextToggleButton(self, -1, image) + button = New_analysis_button(self, -1, image) else: - button = buttons.ThemedGenBitmapTextToggleButton(self, -1) + button = New_analysis_button(self, -1) # Set the tool tip. button.SetToolTipString(tooltip)