wxSpinCtrl eating <tab> key

I have a basic database form designed using wxPython. Naturally, the user tabs from one field to the next to enter data. This works fine for text boxes and combo boxes, but for some reason, the tabs die in wxSpinCtrl windows. You can tab into them, but not out. I've tried a couple of variations (chiefly setting wxTAB_TRAVERSAL on or off -- not sure if it is relevant here, just experimenting), to no avail. It must be possible to tab out of a spin control (mustn't it?), so I just need someone to help me figure out how. Thanks in advance.

Sincerely,
Derek Croxton

Derek Croxton wrote:

I have a basic database form designed using wxPython. Naturally, the user tabs from one field to the next to enter data. This works fine for text boxes and combo boxes, but for some reason, the tabs die in wxSpinCtrl windows. You can tab into them, but not out. I've tried a couple of variations (chiefly setting wxTAB_TRAVERSAL on or off -- not sure if it is relevant here, just experimenting), to no avail. It must be possible to tab out of a spin control (mustn't it?), so I just need someone to help me figure out how. Thanks in advance.

Which platform and version?

Have you tried using just a wxSpinButton tied together with a wxTextCtrl?

···

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

Robin Dunn wrote:

Derek Croxton wrote:

I have a basic database form designed using wxPython. Naturally, the user tabs from one field to the next to enter data. This works fine for text boxes and combo boxes, but for some reason, the tabs die in wxSpinCtrl windows. You can tab into them, but not out. I've tried a couple of variations (chiefly setting wxTAB_TRAVERSAL on or off -- not sure if it is relevant here, just experimenting), to no avail. It must be possible to tab out of a spin control (mustn't it?), so I just need someone to help me figure out how. Thanks in advance.

Which platform and version?

Have you tried using just a wxSpinButton tied together with a wxTextCtrl?

Sorry, WinXP, Python 2.3, wxWindows 2.4.2.

I have thought of trying that ever since you suggested it to make an empty string a valid entry for the spin control, but haven't gotten around to it. How would one go about deriving one control from two others? Just declare it like this?:

class MySpinControl(wxSpinButton, wxTextCtrl):
  wxSpinButton.__init__(params)
  wxTextCtrl.__init__(params)

Or is there more to it than that?

Sincerely,
Derek Croxton

Derek Croxton wrote:

Which platform and version?

Have you tried using just a wxSpinButton tied together with a wxTextCtrl?

Sorry, WinXP, Python 2.3, wxWindows 2.4.2.

I have thought of trying that ever since you suggested it to make an empty string a valid entry for the spin control, but haven't gotten around to it. How would one go about deriving one control from two others? Just declare it like this?:

class MySpinControl(wxSpinButton, wxTextCtrl):
    wxSpinButton.__init__(params)
    wxTextCtrl.__init__(params)

No, you can't use multiple inheritance with more than one wxWindow class.

One way to do it is shown in the demo for the wxSpinButton sample. Just put both controls on the panel as independent controls, and use the spin events to update the textctrl.

···

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