From: <jd...@us...> - 2009-08-04 11:50:16
|
Revision: 7343 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7343&view=rev Author: jdh2358 Date: 2009-08-04 11:50:09 +0000 (Tue, 04 Aug 2009) Log Message: ----------- applied sf patch 2815064 (middle button events for wx) and patch 2818092 (resize events for wx) Modified Paths: -------------- branches/v0_99_maint/lib/matplotlib/backends/backend_wx.py Modified: branches/v0_99_maint/lib/matplotlib/backends/backend_wx.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/backends/backend_wx.py 2009-08-04 07:13:37 UTC (rev 7342) +++ branches/v0_99_maint/lib/matplotlib/backends/backend_wx.py 2009-08-04 11:50:09 UTC (rev 7343) @@ -772,6 +772,11 @@ bind(self, wx.EVT_LEAVE_WINDOW, self._onLeave) bind(self, wx.EVT_ENTER_WINDOW, self._onEnter) bind(self, wx.EVT_IDLE, self._onIdle) + #Add middle button events + bind(self, wx.EVT_MIDDLE_DOWN, self._onMiddleButtonDown) + bind(self, wx.EVT_MIDDLE_DCLICK, self._onMiddleButtonDown) + bind(self, wx.EVT_MIDDLE_UP, self._onMiddleButtonUp) + self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM) self.macros = {} # dict from wx id to seq of macros @@ -1183,6 +1188,7 @@ # so no need to do anything here except to make sure # the whole background is repainted. self.Refresh(eraseBackground=False) + FigureCanvasBase.resize_event(self) def _get_key(self, evt): @@ -1251,6 +1257,24 @@ if self.HasCapture(): self.ReleaseMouse() FigureCanvasBase.button_release_event(self, x, y, 1, guiEvent=evt) + #Add middle button events + def _onMiddleButtonDown(self, evt): + """Start measuring on an axis.""" + x = evt.GetX() + y = self.figure.bbox.height - evt.GetY() + evt.Skip() + self.CaptureMouse() + FigureCanvasBase.button_press_event(self, x, y, 2, guiEvent=evt) + + def _onMiddleButtonUp(self, evt): + """End measuring on an axis.""" + x = evt.GetX() + y = self.figure.bbox.height - evt.GetY() + #print 'release button', 1 + evt.Skip() + if self.HasCapture(): self.ReleaseMouse() + FigureCanvasBase.button_release_event(self, x, y, 2, guiEvent=evt) + def _onMouseWheel(self, evt): """Translate mouse wheel events into matplotlib events""" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2009-09-16 23:39:02
|
Revision: 7770 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7770&view=rev Author: efiring Date: 2009-09-16 23:38:54 +0000 (Wed, 16 Sep 2009) Log Message: ----------- Don't use wxversion with py2exe; fix by Werner Bruhin Modified Paths: -------------- branches/v0_99_maint/lib/matplotlib/backends/backend_wx.py Modified: branches/v0_99_maint/lib/matplotlib/backends/backend_wx.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/backends/backend_wx.py 2009-09-16 14:13:26 UTC (rev 7769) +++ branches/v0_99_maint/lib/matplotlib/backends/backend_wx.py 2009-09-16 23:38:54 UTC (rev 7770) @@ -110,24 +110,25 @@ missingwx = "Matplotlib backend_wx and backend_wxagg require wxPython >=2.8" -try: - import wxversion -except ImportError: - raise ImportError(missingwx) +if not hasattr(sys, 'frozen'): # i.e., not py2exe + try: + import wxversion + except ImportError: + raise ImportError(missingwx) -# Some early versions of wxversion lack AlreadyImportedError. -# It was added around 2.8.4? -try: - _wx_ensure_failed = wxversion.AlreadyImportedError -except AttributeError: - _wx_ensure_failed = wxversion.VersionError + # Some early versions of wxversion lack AlreadyImportedError. + # It was added around 2.8.4? + try: + _wx_ensure_failed = wxversion.AlreadyImportedError + except AttributeError: + _wx_ensure_failed = wxversion.VersionError -try: - wxversion.ensureMinimal('2.8') -except _wx_ensure_failed: - pass -# We don't really want to pass in case of VersionError, but when -# AlreadyImportedError is not available, we have to. + try: + wxversion.ensureMinimal('2.8') + except _wx_ensure_failed: + pass + # We don't really want to pass in case of VersionError, but when + # AlreadyImportedError is not available, we have to. try: import wx @@ -776,7 +777,7 @@ bind(self, wx.EVT_MIDDLE_DOWN, self._onMiddleButtonDown) bind(self, wx.EVT_MIDDLE_DCLICK, self._onMiddleButtonDown) bind(self, wx.EVT_MIDDLE_UP, self._onMiddleButtonUp) - + self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM) self.macros = {} # dict from wx id to seq of macros @@ -1257,7 +1258,7 @@ if self.HasCapture(): self.ReleaseMouse() FigureCanvasBase.button_release_event(self, x, y, 1, guiEvent=evt) - #Add middle button events + #Add middle button events def _onMiddleButtonDown(self, evt): """Start measuring on an axis.""" x = evt.GetX() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2009-11-03 16:27:23
|
Revision: 7924 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7924&view=rev Author: mdboom Date: 2009-11-03 16:27:13 +0000 (Tue, 03 Nov 2009) Log Message: ----------- [2880836] Save from toolbar changes directory with WX backend Modified Paths: -------------- branches/v0_99_maint/lib/matplotlib/backends/backend_wx.py Modified: branches/v0_99_maint/lib/matplotlib/backends/backend_wx.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/backends/backend_wx.py 2009-11-03 16:23:41 UTC (rev 7923) +++ branches/v0_99_maint/lib/matplotlib/backends/backend_wx.py 2009-11-03 16:27:13 UTC (rev 7924) @@ -1794,7 +1794,7 @@ default_file = "image." + self.canvas.get_default_filetype() dlg = wx.FileDialog(self._parent, "Save to file", "", default_file, filetypes, - wx.SAVE|wx.OVERWRITE_PROMPT|wx.CHANGE_DIR) + wx.SAVE|wx.OVERWRITE_PROMPT) dlg.SetFilterIndex(filter_index) if dlg.ShowModal() == wx.ID_OK: dirname = dlg.GetDirectory() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |