ANN: ShortcutEditor for wxPython :-D

Hi All,

    it's been a while since my last announcement, so I thought I'd
jump in and make another one. I am happy to announce the birth of my
latest child, ShortcutEditor.

NOTE: ShortcutEditor requires AGW 0.9.3 or the latest SVN, due to the
enhancements I made to GenericMessageDialog, CustomTreeCtrl and
HyperTreeList.

Description

···

===========

ShortcutEditor is a widget that allows the user to customize and change keyboard
shortcuts via a dialog. It can be used to edit `wx.MenuItem` shortcuts
or accelerators
defined in a `wx.AcceleratorTable`.

The interface itself is very much inpired by the GIMP shortcut editor:

http://graphicssoft.about.com/od/gimptutorials/tp/keyboard-shortcut-editor.htm

There are very few minor UI differences between ShortcutEditor and the GIMP one,
although the behaviour should be pretty much equivalent.

Various features:

* Shortcuts are listed in a tree-like structure, pretty much reflecting a menu
  hierarchy (as most of the time ShortcutEditor is used to edit `wx.MenuItem`
  shortcuts);
* Accelerators defined via `wx.AcceleratorTable` are handled in a similar way;
* Support for I18N;
* Ability to restore default shortcuts/accelerators via a UI button;
* Possibility to send back the new/updated shortcuts to the original
  `wx.MenuBar` or the original `wx.AcceleratorTable`;
* Filters on the shortcuts label (case-insensitive);
* Basic help window with instructions (customizable via SetHTMLHelpFile),
  via the ``Help`` button.

The docstrings should explain relatively well how to use it, and I am
currently re-building the AGW documentation for the new 0.9.3 version.

Source code: the wxPython SVN repository (please remember to update
the whole of AGW).

Please let me know if you encounter any issue, although patches are
much more welcome :slight_smile:

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

import PyQt4.QtGui

Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
ImportError: No module named PyQt4.QtGui

import pygtk

Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
ImportError: No module named pygtk

import wx

Hi Andrea,

···

2012/3/5 Andrea Gavana <andrea.gavana@gmail.com>:

Hi All,

it's been a while since my last announcement, so I thought I'd
jump in and make another one. I am happy to announce the birth of my
latest child, ShortcutEditor.

That's great! I will surely look into making good use of this widget
for Task Coach.

Thanks, Frank

I realize this post is old, but I was working on a short article about this widget and noticed that the example application in the source didn’t work. You have

wx.Frame.__init(self, parent, -1, “ShortcutEditor Demo”)

instead of

wx.Frame.init(self, parent, -1, “ShortcutEditor Demo”)

in the “usage example” portion. I’ll be posting my little blurb later this week. Thanks for the cool new tool, Andrea!

  • Mike
···

On Monday, March 5, 2012 3:00:11 PM UTC-6, Infinity77 wrote:

Hi All,
it’s been a while since my last announcement, so I thought I’d
jump in and make another one. I am happy to announce the birth of my
latest child, ShortcutEditor.

NOTE: ShortcutEditor requires AGW 0.9.3 or the latest SVN, due to the
enhancements I made to GenericMessageDialog, CustomTreeCtrl and
HyperTreeList.

Description

ShortcutEditor is a widget that allows the user to customize and change keyboard
shortcuts via a dialog. It can be used to edit wx.MenuItem shortcuts
or accelerators
defined in a wx.AcceleratorTable.

The interface itself is very much inpired by the GIMP shortcut editor:

http://graphicssoft.about.com/od/gimptutorials/tp/keyboard-shortcut-editor.htm

There are very few minor UI differences between ShortcutEditor and the GIMP one,
although the behaviour should be pretty much equivalent.

Various features:

  • Shortcuts are listed in a tree-like structure, pretty much reflecting a menu
    hierarchy (as most of the time ShortcutEditor is used to edit wx.MenuItem
    shortcuts);
  • Accelerators defined via wx.AcceleratorTable are handled in a similar way;
  • Support for I18N;
  • Ability to restore default shortcuts/accelerators via a UI button;
  • Possibility to send back the new/updated shortcuts to the original
    wx.MenuBar or the original wx.AcceleratorTable;
  • Filters on the shortcuts label (case-insensitive);
  • Basic help window with instructions (customizable via SetHTMLHelpFile),
    via the Help button.

The docstrings should explain relatively well how to use it, and I am
currently re-building the AGW documentation for the new 0.9.3 version.

Source code: the wxPython SVN repository (please remember to update
the whole of AGW).

Please let me know if you encounter any issue, although patches are
much more welcome :slight_smile:

Andrea.

“Imagination Is The Only Weapon In The War Against Reality.”
http://xoomer.alice.it/infinity77/

Thanks Mike, it should be fixed now in SVN.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On 21 June 2012 16:57, Mike Driscoll wrote:

On Monday, March 5, 2012 3:00:11 PM UTC-6, Infinity77 wrote:

Hi All,

it&#39;s been a while since my last announcement, so I thought I&#39;d

jump in and make another one. I am happy to announce the birth of my
latest child, ShortcutEditor.

NOTE: ShortcutEditor requires AGW 0.9.3 or the latest SVN, due to the
enhancements I made to GenericMessageDialog, CustomTreeCtrl and
HyperTreeList.

Description

ShortcutEditor is a widget that allows the user to customize and change
keyboard
shortcuts via a dialog. It can be used to edit `wx.MenuItem` shortcuts
or accelerators
defined in a `wx.AcceleratorTable`.

The interface itself is very much inpired by the GIMP shortcut editor:

http://graphicssoft.about.com/od/gimptutorials/tp/keyboard-shortcut-editor.htm

There are very few minor UI differences between ShortcutEditor and the
GIMP one,
although the behaviour should be pretty much equivalent.

Various features:

* Shortcuts are listed in a tree-like structure, pretty much reflecting a
menu
hierarchy (as most of the time ShortcutEditor is used to edit
`wx.MenuItem`
shortcuts);
* Accelerators defined via `wx.AcceleratorTable` are handled in a similar
way;
* Support for I18N;
* Ability to restore default shortcuts/accelerators via a UI button;
* Possibility to send back the new/updated shortcuts to the original
`wx.MenuBar` or the original `wx.AcceleratorTable`;
* Filters on the shortcuts label (case-insensitive);
* Basic help window with instructions (customizable via SetHTMLHelpFile),
via the ``Help`` button.

The docstrings should explain relatively well how to use it, and I am
currently re-building the AGW documentation for the new 0.9.3 version.

Source code: the wxPython SVN repository (please remember to update
the whole of AGW).

Please let me know if you encounter any issue, although patches are
much more welcome :slight_smile:

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

I realize this post is old, but I was working on a short article about this
widget and noticed that the example application in the source didn't work.
You have

wx.Frame.__init(self, parent, -1, "ShortcutEditor Demo")

instead of

wx.Frame.__init__(self, parent, -1, "ShortcutEditor Demo")

in the "usage example" portion. I'll be posting my little blurb later this
week. Thanks for the cool new tool, Andrea!

Excuse the late reply to this announcement, but I’ve just installed wx 2.9.4 and am playing about, getting this into my program. This is fantastic bit of work here Andrea, but minimal code to consume its service! Brilliant.

I’m going to look into saving the state of the user’s choice so the app can restore it on startup.

thanks again

···

On Monday, 5 March 2012 21:00:11 UTC, Infinity77 wrote:

ShortcutEditor is a widget that allows the user to customize and change keyboard
shortcuts via a dialog. It can be used to edit wx.MenuItem shortcuts
or accelerators
defined in a wx.AcceleratorTable.

The interface itself is very much inpired by the GIMP shortcut editor:

Steven,

···

On 25/11/2012 02:56, Steven Sproat wrote:

Excuse the late reply to this announcement, but I've just installed wx 2.9.4 and am playing about, getting this into my program. This is fantastic bit of work here Andrea, but minimal code to consume its service! Brilliant.

I'm going to look into saving the state of the user's choice so the app can restore it on startup.

I assume you are aware of Andrea's "persist" module, I haven't used the ShortcutEditor so don't know if persist is saving/restoring the actual data.

I use "persist" in my latest version of my stuff, but "data" type entries are stored in a database in my case, so don't use "persist" for that at all.

Werner

Hey Werner!

Yes I'm aware of the persistent controls - I was looking at the demo last night. Seems fun but I may need to do some custom things, e.g. only save what's changed.

I thought of another enhancement - if you open the editor and change some keys and save them, then re-open the dialog, the "restore defaults" button will restore your previously saved settings. I'd expect it to restore the application defaults. Not sure what's the right approach there and doing it my way would be much harder.

Regards,
Steven

···

On 25/11/2012 07:46, Werner wrote:

Steven,

On 25/11/2012 02:56, Steven Sproat wrote:

Excuse the late reply to this announcement, but I've just installed wx 2.9.4 and am playing about, getting this into my program. This is fantastic bit of work here Andrea, but minimal code to consume its service! Brilliant.

I'm going to look into saving the state of the user's choice so the app can restore it on startup.

I assume you are aware of Andrea's "persist" module, I haven't used the ShortcutEditor so don't know if persist is saving/restoring the actual data.

I use "persist" in my latest version of my stuff, but "data" type entries are stored in a database in my case, so don't use "persist" for that at all.

Werner

--
Steven Sproat, BSc
http://www.whyteboard.org/