List Info

Thread: wxGrid navigation and column tooltips




wxGrid navigation and column tooltips
country flaguser name
United States
2007-10-01 15:43:15
Hi,

I have a wx.Grid that I'm using for as a spreadsheet in one
of my
applications. I would like to override the grid cell
editor's arrow key
navigation so that when I press one of the keys, it will
navigate away
from the cell I am currently editing, like MS Excel does.
While I can
successfully catch the keycodes for the buttons when I am
not editing a
cell, they seem to get eaten once I actually activate the
editor. Is there
a way to do this?

Also, one of my users asked if I could put pop-up tooltips
on the column
name when moused over. I can't find anything about
mouse-over events. I
did find this excellent tutorial on grid cell tooltips:
http://wiki.
wxpython.org/wxGrid_ToolTips

Unfortunately, it doesn't apply to my case. Any help one
these two issues
would be appreciated.

I am using wxPython 2.8.4, Python 2.4 on Windows XP SP2.
Thanks!

Mike Driscoll
Applications Specialist
MCIS - Technology Center


------------------------------------------------------------
---------
To unsubscribe, e-mail: wxPython-users-unsubscribelists.wxwidgets.org
For additional commands, e-mail: wxPython-users-helplists.wxwidgets.org


Re: wxGrid navigation and column tooltips
country flaguser name
United States
2007-10-02 14:39:16
Mike Driscoll wrote:
> Hi,
> 
> I have a wx.Grid that I'm using for as a spreadsheet in
one of my
> applications. I would like to override the grid cell
editor's arrow key
> navigation so that when I press one of the keys, it
will navigate away
> from the cell I am currently editing, like MS Excel
does. While I can
> successfully catch the keycodes for the buttons when I
am not editing a
> cell, they seem to get eaten once I actually activate
the editor. Is there
> a way to do this?

Keep in mind that when the cell editor is shown that there
is another 
widget there, and so the grid itself doses not have the
keyboard focus 
anymore, and so it will not be getting the key events.  You
can however 
bind your own key handler to the cell editor widget and take
care of 
things there.  Bind a handler for the
EVT_GRID_EDITOR_CREATED event and 
in the handler you can use event.GetControl() to get a
reference to the 
widget.

> 
> Also, one of my users asked if I could put pop-up
tooltips on the column
> name when moused over. I can't find anything about
mouse-over events.

You can intercept the mouse events for the 
theGrid.GetGridColLabelWindow() and show a tip window if you
sense that 
the mouse is hovering.  Be sure to call event.Skip() so the
default 
event handlers in the grid will still be called.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java
give you jitters?  Relax with wxPython!


------------------------------------------------------------
---------
To unsubscribe, e-mail: wxPython-users-unsubscribelists.wxwidgets.org
For additional commands, e-mail: wxPython-users-helplists.wxwidgets.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )