- Code: Select all
pane = self._mgr.GetPane(paneName)
pane.ShowHint(c.window.GetRect())
# m.HideHint()
pane = self._mgr.GetPane(paneName)
pane.ShowHint(c.window.GetRect())
# m.HideHint()
cody wrote:I went ahead and implemented this since it was so easy. It looks pretty nice too.
Also temporarily set the default keybinding to Alt+1 on windows/linux. Will still need to add the methods to set the keybinding in the navigator window.
Index: src/eclib/auinavi.py
===================================================================
--- src/eclib/auinavi.py (revision 57430)
+++ src/eclib/auinavi.py (working copy)
@@ -31,20 +31,37 @@
class AuiPaneNavigator(wx.Dialog):
"""Navigate through Aui Panes"""
- def __init__(self, parent, auiMgr, icon=None, title=''):
+ def __init__(self, parent, auiMgr, icon=None, title='', accel=None):
"""@param auiMgr: Main window Aui Manager"""
wx.Dialog.__init__(self, parent, wx.ID_ANY, "", style=wx.STAY_ON_TOP)
# Attributes
self._auimgr = auiMgr
self._selectedItem = -1
self._indexMap = list()
self._sel = 0
self._tabed = 0
- self._close_keys = [wx.WXK_ALT, wx.WXK_CONTROL, wx.WXK_RETURN]
- self._navi_keys = [wx.WXK_TAB, ord('1')] # <- TEMP
-
+ self._close_keys = [wx.WXK_RETURN, wx.WXK_ESCAPE]
+ self._navi_keys = [wx.WXK_TAB]
+
# Setup
+ if (accel):
+ accel = accel.replace('-', '+')
+ #TODO: isn't there a reasonable way to convert an accelerator string
+ #into a list of WXK_* ?
+ allModifiers = {
+ "ALT": wx.WXK_ALT,
+ "CTRL": wx.WXK_CONTROL,
+ "SHIFT": wx.WXK_SHIFT
+ }
+ parts = accel.strip().split('+')
+ modifiers = [allModifiers[k.upper()] for k in parts[0:-1]]
+ #TODO: could as well be a F1 or something not convertible
+ keycode = ord(parts[-1])
+ self._close_keys += modifiers
+ self._navi_keys += [keycode]
+
sz = wx.BoxSizer(wx.VERTICAL)
self._listBox = wx.ListBox(self, wx.ID_ANY, wx.DefaultPosition,
wx.Size(200, 150), list(),
@@ -108,8 +125,6 @@
event.Skip()
elif key_code in self._close_keys:
self.CloseDialog()
- elif key_code == wx.WXK_ESCAPE:
- self.CloseDialog()
else:
event.Skip()
Index: src/ed_main.py
===================================================================
--- src/ed_main.py (revision 57430)
+++ src/ed_main.py (working copy)
@@ -1009,10 +1009,12 @@
if evt.GetId() == ID_PANELIST:
if self._paneNavi is not None:
return
-
+
+ accelKey = ed_menu.EdMenuBar.keybinder.GetBinding(ID_PANELIST)
bmp = wx.ArtProvider.GetBitmap(str(ID_NEW_WINDOW), wx.ART_MENU)
- self._paneNavi = auinavi.AuiPaneNavigator(self, self._mgr, bmp,
- _("Aui Pane Navigator"))
+ self._paneNavi = auinavi.AuiPaneNavigator(
+ self, self._mgr, bmp, _("Aui Pane Navigator"), accelKey
+ )
self._paneNavi.SetReturnCode(wx.ID_OK)
self._paneNavi.ShowModal()
Return to Technical Discussion
Users browsing this forum: No registered users and 0 guests