Changeset 8eeb0b6 in sasview
- Timestamp:
- Sep 26, 2009 9:08:42 AM (15 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 39b7019
- Parents:
- e627f19
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
prview/perspectives/pr/pr_widgets.py
r9ff861b r8eeb0b6 25 25 wx.TextCtrl.__init__(self, *args, **kwds) 26 26 27 ## Set to True when the mouse is clicked while the whole string is selected 28 full_selection = False 29 ## Call back for EVT_SET_FOCUS events 30 _on_set_focus_callback = None 27 31 # Bind appropriate events 28 32 self.Bind(wx.EVT_LEFT_UP, self._highlight_text) 33 self.Bind(wx.EVT_SET_FOCUS, self._on_set_focus) 34 35 def _on_set_focus(self, event): 36 """ 37 Catch when the text control is set in focus to highlight the whole 38 text if necessary 39 @param event: mouse event 40 """ 41 event.Skip() 42 self.full_selection = True 29 43 30 44 def _highlight_text(self, event): … … 33 47 @param event: mouse event 34 48 """ 35 control = event.GetEventObject()36 # Check that we have a TextCtrl37 if issubclass(control.__class__, wx.TextCtrl):38 # Check whether text has been selected,39 # if not, select the whole string40 41 (start, end) = control.GetSelection()42 if start==end:43 control.SetSelection(-1,-1)44 45 49 # Make sure the mouse event is available to other listeners 46 50 event.Skip() 51 control = event.GetEventObject() 52 if self.full_selection: 53 self.full_selection = False 54 # Check that we have a TextCtrl 55 if issubclass(control.__class__, wx.TextCtrl): 56 # Check whether text has been selected, 57 # if not, select the whole string 58 (start, end) = control.GetSelection() 59 if start==end: 60 control.SetSelection(-1,-1) 47 61 48 62 class OutputTextCtrl(wx.TextCtrl):
Note: See TracChangeset
for help on using the changeset viewer.