A must-have feature for me is the capability to focus different panes using keyboard shortcuts. I mean, I want to be able to focus the "projects" plugin pane by using some shortcut.I already had a quick look at the code: basically I need to get a reference to AuiManager, then to specific pane (by name) and finally set the focus.As far as I understand there are many ways to implement this:- An editor command (but I'll need a macro system to run it)- Register a "Focus this pane" menu handler (but there's no way to assign a keybinding to plugin menu items in preferences)- Play dirty and manipulate the accelerator table for the main window (but this should be configured within plugin and not globally)- Write another plugin that handles the pane focusing job (but, again, keybinding configuration won't be global)

Well, I can and would like to help in this matter but first let's plan it out...

Modify the Ctrl+Tab functionality to popup up a list of panes/windows within Editra and allow tabbing to them like you can with applications on the desktop (Alt+Tab on windows I believe, Cmd+Tab on OSX, ect..)

This would require:

* Changing the notebook and finding a way to re-implement the tab(buffer) switching command that is currently used by Ctrl+Tab.

* Make Ctrl+Tab a registered action in the MainWindows menu so it can be activated no matter what pane/control has the focus.

Getting the list of objects to show would be as simple as querying the mainwindows AuiMgr and getting the panes, or perhaps adding a method that all auipanes register themselves with to provide a title/icon if need be.

I like this approach because it seems intuitive, would be relatively easy to implement, and should be familiar to most people.

Modify the Ctrl+Tab functionality to popup up a list of panes/windows within Editra and allow tabbing to them like you can with applications on the desktop (Alt+Tab on windows I believe, Cmd+Tab on OSX, ect..)

This would require:

* Changing the notebook and finding a way to re-implement the tab(buffer) switching command that is currently used by Ctrl+Tab.

* Make Ctrl+Tab a registered action in the MainWindows menu so it can be activated no matter what pane/control has the focus.

Getting the list of objects to show would be as simple as querying the mainwindows AuiMgr and getting the panes, or perhaps adding a method that all auipanes register themselves with to provide a title/icon if need be.

I like this approach because it seems intuitive, would be relatively easy to implement, and should be familiar to most people.

How does that sound?

Good starting point. Let me have a look into this. If you have suggestions by all means post them.

After some more thought I think that leaving the current Ctrl+tab functionality alone and binding this to Ctrl+Shift+Tab would make more sense (even though thats kind of a difficult shortcut for the fingers to hit). This would require simply.

1) make a new popup window class that can show the windows. Some sort of borderless window with some (probably custom) icon/text controls on it that can be navigated to by hitting tab while the windows open and ctrl is held down. release ctrl will make the selection and dismiss the window. For an example to get started on this window I would see the TabNavigator in Editra/src/extern/flatnotebook.py.

2) Bind to Ctrl+shift+Tab

I was thinking it would be nice for the window to show a small icon plus the panels title for each of the choices to tab through in this new window. This would require some work on each of the existing plugins to support this so for now just having a generic icon to use that the window can fall back on when the pane doesn't have one to supply would be best. I will try to add one to the art provider this evening.

cody wrote:After some more thought I think that leaving the current Ctrl+tab functionality alone and binding this to Ctrl+Shift+Tab would make more sense (even though thats kind of a difficult shortcut for the fingers to hit). This would require simply.

1) make a new popup window class that can show the windows. Some sort of borderless window with some (probably custom) icon/text controls on it that can be navigated to by hitting tab while the windows open and ctrl is held down. release ctrl will make the selection and dismiss the window. For an example to get started on this window I would see the TabNavigator in Editra/src/extern/flatnotebook.py.

2) Bind to Ctrl+shift+Tab

I've found my way through the code and I can show / populate the popup window. Some random thoughts:- Ctrl-Shift-Tab is not really usable, at least for me.- Is it necessary to have a menu item to show the tab list?- The flatnotebook uses the EVT_KEY_UP for the CTRL key to catch user selection. Keep this behaviour?

Maybe I can assign the dialog to a menuitem (thus getting the standard keymapping system). Then the CTRL-TAB behaviour will apply to panes instead of notebook tabs. Sounds good?

cody wrote:I was thinking it would be nice for the window to show a small icon plus the panels title for each of the choices to tab through in this new window. This would require some work on each of the existing plugins to support this so for now just having a generic icon to use that the window can fall back on when the pane doesn't have one to supply would be best. I will try to add one to the art provider this evening.

I think (and I believe most people would agree) that CTRL+SHIFT+TAB is not a good idea, as people would generally expect that to be Cycle backwards through the tabs (like ALT/CMD+SHIFT+TAB is cycle back through windows). Perhaps for the shelves at least: instead of having CTRL+ALT+<number> always open a new shelf, have that focus the last shelf of that type if one is open otherwise open a new one. If people do want multiple shelves of the same type (multiple PyShell shelves, perhaps), have the menu item always open new shelves, but the key shortcut as described here. Not sure what to do about the side panels, since they don't have a key binding to open them.

Just getting something basic working for now is fine. My main concern is not wanting to break the current functionality of switching tabs as that is what will be used more often than switching panes. Because most of the usage time of a text editor is spent in the text buffers and not in the accessory panes right?

For the keybinding I think that it might be necessary to have it in the main menus, because this dialog should be able to be shown no matter what pane has the focus. If it is not handled by the main menu keybindings (possibly also doable with an Accelerator table on the main frame) then each sub pane would need to duplicate and implement the shortcut handling. Which would make it burdensome to maintain and not automatically extensible when new panes are added. (it would be nice to do it with the AcceleratorTable if possible to avoid needing to clutter the menus more)

If you have something working I would like to try it out some, so if possible could you send me a patch against the latest svn.

Airdrik:

Please start a new thread about the shelf. The problem is there is no way to determine if the shortcut action was triggered by clicking on the menu or by using the shortcut. But there may be other ways to work with this.

I think that this functionality for switching panes would also add a way to open sub panes without the need for individual keybindings. As all sub panes of the main window are instantiated and added to the aui manager at main window creation time so the list should always show what panels are being managed and will be able to be shown/hide them on demand. So this should hopefully kill 2 birds with 1 stone .

cody wrote:Just getting something basic working for now is fine. My main concern is not wanting to break the current functionality of switching tabs as that is what will be used more often than switching panes. Because most of the usage time of a text editor is spent in the text buffers and not in the accessory panes right?

Yeah, right.

cody wrote:For the keybinding I think that it might be necessary to have it in the main menus, because this dialog should be able to be shown no matter what pane has the focus. If it is not handled by the main menu keybindings (possibly also doable with an Accelerator table on the main frame) then each sub pane would need to duplicate and implement the shortcut handling. Which would make it burdensome to maintain and not automatically extensible when new panes are added. (it would be nice to do it with the AcceleratorTable if possible to avoid needing to clutter the menus more)

Right again. For now I put it in the view menu but more sense to have it in a global accelerator table. Once popped up, CTRL-TAB to switch panes, closes on CTRL release.

While I was there I added a folding menu with toggle fold / toggle all folds. Toggle all folds does not work...

Feel free to move around / modify whatever.

Sorry for the inlining, but I'm unable to upload attachments (file extension not allowed)

cody wrote:Applied the pane navigation part today after a number of modifications.

Some modifications include using Alt+Tab as a hot key. Listing all panels not just the shown ones and then shown an hidden panel if it is selected.

This stuff is tricky business. Random thoughts:* Cannot reliably use Alt+Tab under Win32: after the first keypress it clashes with the standard OS window switching system* Maybe we want the pane-switching keybind to be user-configurable: if so the AuiPaneNavigator needs to know what this keybind is.* Want to 'highlight' various panes as you're switching through them?

cody wrote:Have some questions about other parts of the patch.

1) I am not completely clear on the purpose of the OnNavigationKey function in ed_pages.

My bad. Leftover of the first tests.

cody wrote:2) Why is there a reference to the aui manager being stored in the notebook, it doesn't seem to be used anywhere.

Again my bad. Did try to set the focus in the EdPaneNavigatorWindow.OnKeyUp but did not work.

cowo wrote:This stuff is tricky business. Random thoughts:* Cannot reliably use Alt+Tab under Win32: after the first keypress it clashes with the standard OS window switching system

Ah, forgot about that thought using Alt+Tab was too obvious of a choice last night. I will probably keep it as the default on OSX, but will need to change it for something else on other platforms. Any preference? Another user emailed me saying that they had used Ctrl+Enter for this feature when using Emacs.

cowo wrote:* Maybe we want the pane-switching keybind to be user-configurable: if so the AuiPaneNavigator needs to know what this keybind is.

It should already be configurable as it is in the Keybinder system of ed_menu. Having navigator know about is another issue. It could probably be done by just adding a method that sets the keybinding from the main window, the main window can then update this as necessary when an EDMSG_MENU_REBIND message is recieved.

cowo wrote:* Want to 'highlight' various panes as you're switching through them?

I think there should be a way to do this, as the aui manager already supports giving highlighting hints when dragging a pane to a new location. Will need to look into it to see if it can be done or not though.

cody wrote:Ah, forgot about that thought using Alt+Tab was too obvious of a choice last night. I will probably keep it as the default on OSX, but will need to change it for something else on other platforms. Any preference? Another user emailed me saying that they had used Ctrl+Enter for this feature when using Emacs.

Well, I'm just used to switch to different panes by Alt+<somenumber>. Maybe Alt+PageDown?However, a quick test of Ctrl+Enter on win32 current SVN shows the Dialog and immediately closes it (while still holding down both of the keys, or just Ctrl)

cody wrote:It should already be configurable as it is in the Keybinder system of ed_menu. Having navigator know about is another issue. It could probably be done by just adding a method that sets the keybinding from the main window, the main window can then update this as necessary when an EDMSG_MENU_REBIND message is recieved.

Fine.

cody wrote:I think there should be a way to do this, as the aui manager already supports giving highlighting hints when dragging a pane to a new location. Will need to look into it to see if it can be done or not though.

I was just thinking about doing a (temporary) SetWindowStyle. Still have to try it however (and besides, this is really low prio)

cowo wrote:Well, I'm just used to switch to different panes by Alt+<somenumber>. Maybe Alt+PageDown?However, a quick test of Ctrl+Enter on win32 current SVN shows the Dialog and immediately closes it (while still holding down both of the keys, or just Ctrl)

This is because WXK_RETURN is currently in the Close keys for the AuiNavigator, and or it probably causes an activation (selection) event in the listbox control. Will experiment with some alternative keybindings.

cowo wrote:I was just thinking about doing a (temporary) SetWindowStyle. Still have to try it however (and besides, this is really low prio)

This is another possibility could be done by setting the border color and style. The widget inspection tool in wxpython does this to show what widget in your program is being inspected.

cody wrote:This is because WXK_RETURN is currently in the Close keys for the AuiNavigator, and or it probably causes an activation (selection) event in the listbox control. Will experiment with some alternative keybindings.

Of course. I love when I'm so smart...

cody wrote:This is another possibility could be done by setting the border color and style. The widget inspection tool in wxpython does this to show what widget in your program is being inspected.