Hello everybody,

first of all I want to thank John for his work on the textbox - it really 
looks better than mine.

On Tuesday 05 June 2007 19:16, Mark Bakker wrote:
> I just saw in the code:
> if event.key is None: # simulate backspace
> So it works properly,
> Mark

In my opinion it would be a better soluton to generally add some more 
key-events (e.g. enter and backspace) than to simulate backspace with 
all 'None'-keys.

Some time ago I posted a suggestion to that (subject: 'additional key
events'), which may be got lost among the lots of mpl-mails. 
I just send the patch once more, because I think it would be helpful 
for such a prompt.

best regards,
Matthias

> On 6/5/07, Mark Bakker <[EMAIL PROTECTED]> wrote:
> > I notice the alignment problem.
> > But it looks like you are close.
> > On my machine (win32), the 'enter' key didn't work either. It works like
> > a backspace. That sounds like what Matthias reported.
> > Mark
> >
> > On 6/5/07, John Hunter <[EMAIL PROTECTED]> wrote:
> > > On 6/5/07, John Hunter <[EMAIL PROTECTED]> wrote:
> > > > I worked on this some time ago, I never got to the point where I
> > > > thought it was ready for production but it is  close.  There is a
> > > > problem if usetex is enabled, because partial tex strings will cause
> > > > errors.  But you can use it with regular text or plain text.
> > >
> > > Typo: "plain text" was meant to be "math text"
> > >
> > > Now I remember what really bothered me about this widget, and it
> > > wasn't just the usetex problem.  The problem is that mpl has three
> > > different vertical alignment methods for text: top, bottom and center.
> > > None of them are right for a text box: you want baseline.  Try typing
> > > "thinking" into the text box and watch what happens when you add and
> > > remove the "g".  We do need to support baseline alignment for text, so
> > > if someone has an interest in adding this it would be a very useful
> > > feature, not just for a text box for for text alignment (eg tick
> > > labels) in general.
> > >
> > > See the image of the "g" at
> > > http://freetype.sourceforge.net/freetype2/docs/glyphs/glyphs-3.html
> > > for a visual representation -- hwat I am calling the "baseline" they
> > > refer to as the "origin" in that graph.  Our default alignment should
> > > be "origin" or "baseline" but we don't have support for that.
> > >
> > > JDH
Index: lib/matplotlib/backends/backend_gtk.py
===================================================================
--- lib/matplotlib/backends/backend_gtk.py	(revision 3257)
+++ lib/matplotlib/backends/backend_gtk.py	(working copy)
@@ -102,6 +102,45 @@
                65362 : 'up',
                65363 : 'right',
                65364 : 'down',
+               65307 : 'escape',
+               65470 : 'f1',
+               65471 : 'f2',
+               65472 : 'f3',
+               65473 : 'f4',
+               65474 : 'f5',
+               65475 : 'f6',
+               65476 : 'f7',
+               65477 : 'f8',
+               65478 : 'f9',
+               65479 : 'f10',
+               65480 : 'f11',
+               65481 : 'f12',
+               65300 : 'scroll_lock',
+               65299 : 'break',
+               65288 : 'backspace',
+               65293 : 'enter',
+               65379 : 'insert',
+               65535 : 'delete',
+               65360 : 'home',
+               65367 : 'end',
+               65365 : 'pageup',
+               65366 : 'pagedown',
+               65438 : '0',
+               65436 : '1',
+               65433 : '2',
+               65435 : '3',
+               65430 : '4',
+               65437 : '5',
+               65432 : '6',
+               65429 : '7',
+               65431 : '8',
+               65434 : '9',
+               65451 : '+',
+               65453 : '-',
+               65450 : '*',
+               65455 : '/',
+               65439 : 'dec',
+               65421 : 'enter',
                }
 
     def __init__(self, figure):
Index: lib/matplotlib/backends/backend_tkagg.py
===================================================================
--- lib/matplotlib/backends/backend_tkagg.py	(revision 3257)
+++ lib/matplotlib/backends/backend_tkagg.py	(working copy)
@@ -104,6 +104,45 @@
                65362 : 'up',
                65363 : 'right',
                65364 : 'down',
+               65307 : 'escape',
+               65470 : 'f1',
+               65471 : 'f2',
+               65472 : 'f3',
+               65473 : 'f4',
+               65474 : 'f5',
+               65475 : 'f6',
+               65476 : 'f7',
+               65477 : 'f8',
+               65478 : 'f9',
+               65479 : 'f10',
+               65480 : 'f11',
+               65481 : 'f12',
+               65300 : 'scroll_lock',
+               65299 : 'break',
+               65288 : 'backspace',
+               65293 : 'enter',
+               65379 : 'insert',
+               65535 : 'delete',
+               65360 : 'home',
+               65367 : 'end',
+               65365 : 'pageup',
+               65366 : 'pagedown',
+               65438 : '0',
+               65436 : '1',
+               65433 : '2',
+               65435 : '3',
+               65430 : '4',
+               65437 : '5',
+               65432 : '6',
+               65429 : '7',
+               65431 : '8',
+               65434 : '9',
+               65451 : '+',
+               65453 : '-',
+               65450 : '*',
+               65455 : '/',
+               65439 : 'dec',
+               65421 : 'enter',
                }
 
     def __init__(self, figure, master=None, resize_callback=None):
Index: lib/matplotlib/backends/backend_wx.py
===================================================================
--- lib/matplotlib/backends/backend_wx.py	(revision 3257)
+++ lib/matplotlib/backends/backend_wx.py	(working copy)
@@ -671,13 +671,66 @@
     """
 
     keyvald = {
-        wx.WXK_CONTROL : 'control',
-        wx.WXK_SHIFT   : 'shift',
-        wx.WXK_ALT     : 'alt',
-        wx.WXK_LEFT    : 'left',
-        wx.WXK_UP      : 'up',
-        wx.WXK_RIGHT   : 'right',
-        wx.WXK_DOWN    : 'down',
+        wx.WXK_CONTROL         : 'control',
+        wx.WXK_SHIFT           : 'shift',
+        wx.WXK_ALT             : 'alt',
+        wx.WXK_LEFT            : 'left',
+        wx.WXK_UP              : 'up',
+        wx.WXK_RIGHT           : 'right',
+        wx.WXK_DOWN            : 'down',
+        wx.WXK_ESCAPE          : 'escape',
+        wx.WXK_F1              : 'f1',
+        wx.WXK_F2              : 'f2',
+        wx.WXK_F3              : 'f3',
+        wx.WXK_F4              : 'f4',
+        wx.WXK_F5              : 'f5',
+        wx.WXK_F6              : 'f6',
+        wx.WXK_F7              : 'f7',
+        wx.WXK_F8              : 'f8',
+        wx.WXK_F9              : 'f9',
+        wx.WXK_F10             : 'f10',
+        wx.WXK_F11             : 'f11',
+        wx.WXK_F12             : 'f12',
+        wx.WXK_SCROLL          : 'scroll_lock',
+        wx.WXK_PAUSE           : 'break',
+        wx.WXK_BACK            : 'backspace',
+        wx.WXK_RETURN          : 'enter',
+        wx.WXK_INSERT          : 'insert',
+        wx.WXK_DELETE          : 'delete',
+        wx.WXK_HOME            : 'home',
+        wx.WXK_END             : 'end',
+        wx.WXK_PRIOR           : 'pageup',
+        wx.WXK_NEXT            : 'pagedown',
+        wx.WXK_PAGEUP          : 'pageup',
+        wx.WXK_PAGEDOWN        : 'pagedown', 
+        wx.WXK_NUMPAD0         : '0',
+        wx.WXK_NUMPAD1         : '1',
+        wx.WXK_NUMPAD2         : '2',
+        wx.WXK_NUMPAD3         : '3',
+        wx.WXK_NUMPAD4         : '4',
+        wx.WXK_NUMPAD5         : '5',
+        wx.WXK_NUMPAD6         : '6',
+        wx.WXK_NUMPAD7         : '7',
+        wx.WXK_NUMPAD8         : '8',
+        wx.WXK_NUMPAD9         : '9',
+        wx.WXK_NUMPAD_ADD      : '+',
+        wx.WXK_NUMPAD_SUBTRACT : '-',
+        wx.WXK_NUMPAD_MULTIPLY : '*',
+        wx.WXK_NUMPAD_DIVIDE   : '/',
+        wx.WXK_NUMPAD_DECIMAL  : 'dec',
+        wx.WXK_NUMPAD_ENTER    : 'enter',
+        wx.WXK_NUMPAD_UP       : 'up',
+        wx.WXK_NUMPAD_RIGHT    : 'right', 
+        wx.WXK_NUMPAD_DOWN     : 'down',
+        wx.WXK_NUMPAD_LEFT     : 'left',
+        wx.WXK_NUMPAD_PRIOR    : 'pageup',
+        wx.WXK_NUMPAD_NEXT     : 'pagedown',
+        wx.WXK_NUMPAD_PAGEUP   : 'pageup',
+        wx.WXK_NUMPAD_PAGEDOWN : 'pagedown', 
+        wx.WXK_NUMPAD_HOME     : 'home',
+        wx.WXK_NUMPAD_END      : 'end',
+        wx.WXK_NUMPAD_INSERT   : 'insert',
+        wx.WXK_NUMPAD_DELETE   : 'delete',
         }    
 
     def __init__(self, parent, id, figure):
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to