Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

MEP22 Navigation toolbar coexistence TODELETE#2759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
38 commits
Select commitHold shift + click to select a range
dda0cdc
navigation and toolbar coexistence
farizaJan 23, 2014
10f5dc7
mod keypress in figuremanager
farizaJan 23, 2014
08a6020
extra files
farizaJan 23, 2014
c6c0ad3
helper methods in toolbar and navigation
farizaJan 24, 2014
1fc29fa
Adding doc to base methods
farizaJan 24, 2014
979875e
property for active_toggle
farizaJan 26, 2014
c5c4f0f
simulate click
farizaJan 27, 2014
97dfda7
pep8 backend_tools
farizaJan 27, 2014
6b647ad
activate renamed to trigger
farizaJan 28, 2014
99667aa
toggle tools using enable/disable from its trigger method
farizaJan 29, 2014
6c19579
simplifying _handle_toggle
farizaJan 29, 2014
0495aac
reducing number of locks
farizaJan 29, 2014
fb46fc1
pep8 correction
farizaJan 29, 2014
d49c431
changing toggle and persistent attributes for issubclass
farizaFeb 4, 2014
5ba6210
bug in combined key press
farizaFeb 4, 2014
7ca8626
untoggle zoom and pan from keypress while toggled
farizaFeb 4, 2014
dcc0f16
classmethods for default tools modification
farizaFeb 6, 2014
bc703e0
six fixes
farizaApr 24, 2014
68dc711
adding zaxis and some pep8
farizaMay 1, 2014
bb9f1c7
removing legacy method dynamic update
farizaMay 6, 2014
2c2e649
tk backend
farizaMay 6, 2014
a99367f
pep8
farizaMay 6, 2014
3d1be34
example working with Tk
farizaMay 6, 2014
afdd34c
cleanup
farizaMay 7, 2014
5b49c7a
duplicate code in keymap tool initialization
farizaJul 24, 2014
773db88
grammar corrections
farizaJul 24, 2014
2ca6926
moving views and positions to tools
farizaJul 24, 2014
661417d
The views positions mixin automatically adds the clear as axobserver
farizaJul 25, 2014
90ab64f
bug when navigation was not defined
farizaJul 25, 2014
55dd149
Small refactor so that we first initiate the Navigation (ToolManager)…
OceanWolfJul 28, 2014
15ac091
Update for Sphinx documentation
OceanWolfJul 28, 2014
8cd241c
Moved default_tool initilisation to FigureManagerBase and cleaned.
OceanWolfJul 29, 2014
39f5b74
Fix navigation
OceanWolfJul 29, 2014
b20dade
Temporary fix to backends
OceanWolfJul 29, 2014
ff94301
Merge pull request #1 from OceanWolf/navigation-toolbar-coexistence-e…
farizaJul 29, 2014
2cb4501
removing persistent tools
farizaSep 3, 2014
9d3c977
removing unregister
farizaSep 4, 2014
6e0b7e6
change cursor inmediately after toggle
farizaSep 5, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
six fixes
  • Loading branch information
@fariza
fariza committedApr 24, 2014
commitbc703e018f54a921f714c29a923ccb36aa15469c
10 changes: 5 additions & 5 deletionsexamples/user_interfaces/navigation.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,11 +10,11 @@ class ListTools(ToolBase):
#keyboard shortcut
keymap = 'm'
#Name used as id, must be unique between tools of the same navigation
name = 'List'
description = 'List Tools'
name = 'List'
description = 'List Tools'
#Where to put it in the toolbar, -1 = at the end, None = Not in toolbar
position = -1

def trigger(self, event):
#The most important attributes are navigation and figure
self.navigation.list_tools()
Expand All@@ -29,7 +29,7 @@ class CopyTool(ToolBase):
position = -1

def trigger(self, event):
from gi.repository import Gtk, Gdk, GdkPixbuf
from gi.repository import Gtk, Gdk
clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
window = self.figure.canvas.get_window()
x, y, width, height = window.get_geometry()
Expand All@@ -46,7 +46,7 @@ def trigger(self, event):
fig.canvas.manager.navigation.add_tool(ListTools)
fig.canvas.manager.navigation.add_tool(CopyTool)

##Just for fun, lets remove the back button
##Just for fun, lets remove the back button
fig.canvas.manager.navigation.remove_tool('Back')

plt.show()
12 changes: 6 additions & 6 deletionslib/matplotlib/backend_bases.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3258,7 +3258,7 @@ def set_default_tools(cls, tools):
def _get_toolbar(self, toolbar, canvas):
# must be inited after the window, drawingArea and figure
# attrs are set
if rcParams['toolbar'] == 'navigation'and toolbar is not None:
if rcParams['toolbar'] == 'navigation' and toolbar is not None:
toolbar = toolbar(canvas.manager)
else:
toolbar = None
Expand DownExpand Up@@ -3292,7 +3292,7 @@ def get_tool_keymap(self, name):
----------
list : list of keys associated with the Tool
"""
keys = [k for k, i in self._keys.items() if i == name]
keys = [k for k, i insix.iteritems(self._keys) if i == name]
return keys

def set_tool_keymap(self, name, *keys):
Expand All@@ -3308,7 +3308,7 @@ def set_tool_keymap(self, name, *keys):
if name not in self._tools:
raise AttributeError('%s not in Tools' % name)

active_keys = [k for k, i in self._keys.items() if i == name]
active_keys = [k for k, i insix.iteritems(self._keys) if i == name]
for k in active_keys:
del self._keys[k]

Expand DownExpand Up@@ -3353,7 +3353,7 @@ def remove_tool(self, name):
"""
self.unregister(name)
del self._tools[name]
keys = [k for k, v in self._keys.items() if v == name]
keys = [k for k, v insix.iteritems(self._keys) if v == name]
for k in keys:
del self._keys[k]

Expand DownExpand Up@@ -3402,7 +3402,7 @@ def add_tool(self, tool):
toggle)

def _get_cls_to_instantiate(self, callback_class):
if isinstance(callback_class,basestring):
if isinstance(callback_class,six.string_types):
#FIXME: make more complete searching structure
if callback_class in globals():
return globals()[callback_class]
Expand DownExpand Up@@ -3501,7 +3501,7 @@ def list_tools(self):
print ('_' * 80)
for name in sorted(self._tools.keys()):
tool = self._tools[name]
keys = [k for k, i in self._keys.items() if i == name]
keys = [k for k, i insix.iteritems(self._keys) if i == name]
print ("{0:20} {1:50} {2}".format(tool.name, tool.description,
', '.join(keys)))
print ('_' * 80, '\n')
Expand Down
2 changes: 1 addition & 1 deletionlib/matplotlib/backend_tools.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -205,7 +205,7 @@ class ToolEnableNavigation(ToolBase):
"""
name = 'EnableOne'
description = 'Enables one axes navigation'
keymap =range(1,10)
keymap = (1,2, 3, 4, 5, 6, 7, 8, 9)

def trigger(self, event):
if event.inaxes is None:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp