Switch pane focus

Technical questions about Editra, post them here

Switch pane focus

Postby cowo » Fri Dec 12, 2008 4:10 pm

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...
Giuseppe "Cowo" Corbelli
cowo
User
 
Posts: 12
Joined: Fri Dec 12, 2008 11:28 am

Re: Switch pane focus

Postby cody » Fri Dec 12, 2008 4:40 pm

This would be very nice to add.

Here are some of my thoughts/ideas.

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?


Cody
User avatar
cody
Site Admin
 
Posts: 1310
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Re: Switch pane focus

Postby cowo » Mon Dec 15, 2008 10:12 am

cody wrote:This would be very nice to add.

Here are some of my thoughts/ideas.

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.
Giuseppe "Cowo" Corbelli
cowo
User
 
Posts: 12
Joined: Fri Dec 12, 2008 11:28 am

Re: Switch pane focus

Postby cody » Mon Dec 15, 2008 2:04 pm

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
User avatar
cody
Site Admin
 
Posts: 1310
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Re: Switch pane focus

Postby cowo » Mon Dec 15, 2008 3:49 pm

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.


Your shout here, man. I don't care much about icons.
Giuseppe "Cowo" Corbelli
cowo
User
 
Posts: 12
Joined: Fri Dec 12, 2008 11:28 am

Re: Switch pane focus

Postby airdrik » Mon Dec 15, 2008 4:52 pm

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.
airdrik
User
 
Posts: 11
Joined: Sat Dec 13, 2008 11:49 pm

Re: Switch pane focus

Postby cody » Mon Dec 15, 2008 5:45 pm

Hello,

Cowo:

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
User avatar
cody
Site Admin
 
Posts: 1310
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Re: Switch pane focus

Postby cowo » Tue Dec 16, 2008 9:57 am

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)

Code: Select all
Index: src/ed_glob.py
===================================================================
--- src/ed_glob.py   (revision 57351)
+++ src/ed_glob.py   (working copy)
@@ -27,7 +27,7 @@
             'ID_QUICK_FIND', 'ID_PREF', 'ID_ZOOM_OUT',
             'HOME_PAGE', 'CONTACT_MAIL', 'ID_ZOOM_IN', 'ID_ZOOM_NORMAL',
             'ID_SHOW_EDGE', 'ID_SHOW_EOL', 'ID_SHOW_LN', 'ID_SHOW_WS',
-            'ID_PERSPECTIVES', 'ID_INDENT_GUIDES', 'ID_VIEW_TOOL',
+            'ID_PERSPECTIVES', 'ID_INDENT_GUIDES', 'ID_VIEW_TOOL', 'ID_PANELIST',
             'ID_GOTO_LINE', 'ID_NEXT_MARK', 'ID_PRE_MARK', 'ID_FONT',
             'ID_EOL_MAC', 'ID_EOL_UNIX', 'ID_EOL_WIN', 'ID_WORD_WRAP',
             'ID_INDENT', 'ID_UNINDENT', 'ID_TO_UPPER', 'ID_TO_LOWER',
@@ -40,7 +40,7 @@
             'ID_USE_SOFTTABS', 'ID_DUP_LINE', 'ID_TRANSLATE',
             'I18N_PAGE', 'ID_GOTO_MBRACE', 'ID_HLCARET_LINE', 'ID_SHOW_SB',
             'ID_REVERT_FILE', 'ID_RELOAD_ENC', 'ID_DOCPROP', 'ID_PASTE_AFTER',
-            'ID_COLUMN_MODE']
+            'ID_COLUMN_MODE', 'ID_TOGGLEFOLD', 'ID_TOGGLEALLFOLDS']
 
 #---- Project Info ----#
 # The project info was moved to another module so it could be accessed

@@ -172,6 +172,9 @@
 ID_SHOW_SB       = wx.NewId()
 ID_VIEW_TOOL     = wx.NewId()
 ID_SHELF         = wx.NewId()
+ID_PANELIST      = wx.NewId()
+ID_TOGGLEFOLD    = wx.NewId()
+ID_TOGGLEALLFOLDS= wx.NewId()
 ID_GOTO_LINE     = wx.NewId()
 ID_GOTO_MBRACE   = wx.NewId()
 ID_NEXT_MARK     = wx.ID_FORWARD
Index: src/ed_main.py
===================================================================
--- src/ed_main.py   (revision 57351)
+++ src/ed_main.py   (working copy)
@@ -46,6 +46,8 @@
 import iface
 import eclib.encdlg as encdlg
 
+from extern import flatnotebook as FNB
+
 # Function Aliases
 _ = wx.GetTranslation
 _PGET = profiler.Profile_Get
@@ -53,6 +55,50 @@
 
 #--------------------------------------------------------------------------#
 
+class EdPaneNavigatorWindow(FNB.TabNavigatorWindow):
+    """Navigate through AuiManager panes """
+   
+    closeKeys = [wx.WXK_CONTROL, wx.WXK_RETURN]
+   
+    def __init__(self, parent=None, icon=None, auiMgr=None):
+        """
+        @param auiMgr: Main window Aui Manager
+        """
+        self._auimgr = auiMgr
+        FNB.TabNavigatorWindow.__init__(self, parent, icon)
+        self._listBox.SetSelection(0)
+        #Seems unreliable
+        self._listBox.Bind(wx.EVT_NAVIGATION_KEY, None)
+       
+    def OnKeyUp(self, event):
+        """
+        Select next with TAB and close dialog with CTRL
+        """
+        if event.GetKeyCode() == wx.WXK_TAB:
+            selected = self._listBox.GetSelection() + 1
+            selected %= self._paneitems
+            self._listBox.SetSelection(selected)
+            event.Skip()
+            return
+       
+        if event.GetKeyCode() in EdPaneNavigatorWindow.closeKeys:
+            self.CloseDialog()
+   
+    def PopulateListControl(self, book):
+        """Populates the L{TabNavigatorWindow} listbox with a list of visible panes"""
+        #Number of visible panes
+        self._panes = self._auimgr.GetAllPanes()
+        self._paneitems = 0
+        for pane in self._panes:
+            if (pane.window.IsShown()):
+                self._listBox.Append(pane.name)
+                self._paneitems+=1
+       
+    def CloseDialog(self):
+        """Closes the L{TabNavigatorWindow} dialog, setting selection in L{FlatNotebook}."""
+        self._sel = self._listBox.GetStringSelection()
+        self.EndModal(wx.ID_OK)
+
 class MainWindow(wx.Frame, viewmgr.PerspectiveManager):
     """Editras Main Window
     @todo: modularize the event handling more (pubsub?)
@@ -104,6 +150,9 @@
 
         #---- Command Bar ----#
         self._mpane.HideCommandBar()
+       
+        #---- Pane list ----#
+        self._paneNavigator = None
 
         #---- Setup Toolbar ----#
         self.SetToolBar(ed_toolbar.EdToolBar(self))
@@ -163,6 +212,7 @@
                                        (ID_GOTO_MBRACE, self.DispatchToControl),
                                        (ID_SHOW_SB, self.OnShowStatusBar),
                                        (ID_VIEW_TOOL, self.OnViewTb),
+                                       (ID_PANELIST, self.OnPaneList),
 
                                        # Format Menu
                                        (ID_FONT, self.OnFont),
@@ -924,7 +974,8 @@
                         ID_UNINDENT, ID_TRANSPOSE, ID_COMMENT, ID_UNCOMMENT,
                         ID_SELECTALL, ID_UNDO, ID_REDO, ID_CUT, ID_COPY,
                         ID_PASTE, ID_LINE_BEFORE, ID_LINE_AFTER, ID_DUP_LINE,
-                        ID_PASTE_AFTER, ID_COLUMN_MODE ]
+                        ID_PASTE_AFTER, ID_COLUMN_MODE, ID_TOGGLEFOLD,
+                        ID_TOGGLEALLFOLDS ]
 
         has_focus = self.FindFocus()
         if has_focus != ctrl and e_id in active_only:
@@ -994,6 +1045,23 @@
             dlg.Destroy()
         else:
             evt.Skip()
+   
+    def OnPaneList(self, event):
+        """
+        Navigates through panes
+        @param event: CommandEvent instance
+        """
+        if (self._paneNavigator):
+            return
+        self._paneNavigator = EdPaneNavigatorWindow(parent=self, auiMgr=self._mgr)
+        self._paneNavigator.SetReturnCode(wx.ID_OK)
+        self._paneNavigator.ShowModal()
+        sel = self._paneNavigator.GetSelection()
+        self._paneNavigator.Destroy()
+        self._paneNavigator = None
+        paneInfo = self._mgr.GetPane(sel)
+        if (paneInfo.IsOk()):
+            paneInfo.window.SetFocus()
 
     # Menu Update Handlers
     def OnUpdateFileUI(self, evt):
Index: src/ed_menu.py
===================================================================
--- src/ed_menu.py   (revision 57351)
+++ src/ed_menu.py   (working copy)
@@ -662,6 +662,18 @@
                         _("Show Whitespace Markers"), wx.ITEM_CHECK)
         viewmenu.AppendSubMenu(self._menus['viewedit'], _("Editor"), \
                                _("Toggle Editor View Options"))
+        viewmenu.Append(ed_glob.ID_PANELIST, _("Pane list") + \
+                        EdMenuBar.keybinder.GetBinding(ed_glob.ID_PANELIST),
+                        _("View pane list"))
+        viewfold = self._menus['viewfold'] = EdMenu()
+        viewfold.Append(ed_glob.ID_TOGGLEFOLD, _("Toggle fold") + \
+                        EdMenuBar.keybinder.GetBinding(ed_glob.ID_TOGGLEFOLD),
+                        _("Toggle current fold"))
+        viewfold.Append(ed_glob.ID_TOGGLEALLFOLDS, _("Toggle all folds") + \
+                        EdMenuBar.keybinder.GetBinding(ed_glob.ID_TOGGLEALLFOLDS),
+                        _("Toggle all folds"))
+        viewmenu.AppendSubMenu(self._menus['viewfold'], _("Folding"), \
+                               _("Toggle Folding Options"))
         viewmenu.AppendSeparator()
         viewmenu.Append(ed_glob.ID_GOTO_LINE, _("&Goto Line") + \
                         EdMenuBar.keybinder.GetBinding(ed_glob.ID_GOTO_LINE),
Index: src/ed_pages.py
===================================================================
--- src/ed_pages.py   (revision 57351)
+++ src/ed_pages.py   (working copy)
@@ -76,6 +76,8 @@
         self._index = dict()          # image list index
         self._ses_load = False
         self._menu = None
+       
+        self._auimgr = self.frame.GetFrameManager()
 
         # Set Additional Style Parameters
         self.SetNonActiveTabTextColour(wx.Colour(102, 102, 102))
@@ -790,6 +792,32 @@
         self.LOG("[ed_pages][evt] Closed Page: #%d" % cpage)
         ed_msg.PostMessage(ed_msg.EDMSG_UI_NB_CLOSED, (self, cpage))
 
+    def OnNavigationKey(self, event):
+        """ Navigates through opened files / panes """
+
+        if event.IsWindowChange():
+            if len(self._windows) == 0:
+                return
+            # change pages
+            if self.HasFlag(FNB.FNB_SMART_TABS):
+                if not self._popupWin:
+                    self._popupWin = FNB.TabNavigatorWindow(self, self._naviIcon)
+                    self._popupWin.SetReturnCode(wx.ID_OK)
+                    self._popupWin.ShowModal()
+                    sel = self._popupWin.GetSelection()
+                    self._pages.FireEvent(sel)
+                    self._popupWin.Destroy()
+                    self._popupWin = None
+                else:
+                    # a dialog is already opened
+                    self._popupWin.OnNavigationKey(event)
+                    return
+            else:
+                # change pages
+                self.AdvanceSelection(event.GetDirection())
+   
+        else:
+            event.Skip()
     #---- End Event Handlers ----#
 
     def CloseAllPages(self):
Index: src/ed_stc.py
===================================================================
--- src/ed_stc.py   (revision 57351)
+++ src/ed_stc.py   (working copy)
@@ -1047,7 +1047,6 @@
     def FoldAll(self):
         """Fold Tree In or Out
         @postcondition: code tree is folded open or closed
-
         """
         line_count = self.GetLineCount()
         expanding = True
@@ -1186,7 +1185,9 @@
                   ed_glob.ID_MACRO_START : self.StartRecord,
                   ed_glob.ID_MACRO_STOP : self.StopRecord,
                   ed_glob.ID_MACRO_PLAY : self.PlayMacro,
-                  ed_glob.ID_GOTO_MBRACE : self.GotoBraceMatch
+                  ed_glob.ID_GOTO_MBRACE : self.GotoBraceMatch,
+                  ed_glob.ID_TOGGLEFOLD : self.ToggleFold,
+                  ed_glob.ID_TOGGLEALLFOLDS : self.FoldAll
         }
 
         e_idmap = { ed_glob.ID_ZOOM_OUT : self.DoZoom,
@@ -2123,7 +2124,12 @@
                 else:
                     self.SetProperty(prop[0], prop[1])
         return True
-
+   
+    def ToggleFold(self, lineNo = None):
+        if (not lineNo):
+            lineNo = self.LineFromPosition(self.GetCurrentPos())
+        wx.stc.StyledTextCtrl.ToggleFold(self, lineNo)
+       
     #---- End Function Definitions ----#
 
     #---- Style Function Definitions ----#
Giuseppe "Cowo" Corbelli
cowo
User
 
Posts: 12
Joined: Fri Dec 12, 2008 11:28 am

Re: Switch pane focus

Postby cody » Tue Dec 16, 2008 2:45 pm

Thanks I will review and try to integrate this sometime this evening.

Cody
User avatar
cody
Site Admin
 
Posts: 1310
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Re: Switch pane focus

Postby cody » Thu Dec 18, 2008 5:11 am

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.


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.

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


I will look at adding the fold toggle part next.


Thanks,

Cody
User avatar
cody
Site Admin
 
Posts: 1310
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Re: Switch pane focus

Postby cowo » Thu Dec 18, 2008 10:13 am

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.

cody wrote:I will look at adding the fold toggle part next.


Nothing unusual. Mainly there's been an error in converting SciTE FoldAll.
Giuseppe "Cowo" Corbelli
cowo
User
 
Posts: 12
Joined: Fri Dec 12, 2008 11:28 am

Re: Switch pane focus

Postby cody » Thu Dec 18, 2008 1:10 pm

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
User avatar
cody
Site Admin
 
Posts: 1310
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Re: Switch pane focus

Postby cowo » Thu Dec 18, 2008 4:47 pm

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)
Giuseppe "Cowo" Corbelli
cowo
User
 
Posts: 12
Joined: Fri Dec 12, 2008 11:28 am

Re: Switch pane focus

Postby cody » Thu Dec 18, 2008 5:03 pm

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.

http://wiki.wxpython.org/Widget%20Inspection%20Tool
User avatar
cody
Site Admin
 
Posts: 1310
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Re: Switch pane focus

Postby cowo » Thu Dec 18, 2008 5:25 pm

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.

I'll have a look.
Giuseppe "Cowo" Corbelli
cowo
User
 
Posts: 12
Joined: Fri Dec 12, 2008 11:28 am

Next

Return to Technical Discussion

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests

cron