wxTextCtrl problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • austin

    wxTextCtrl problem

    I produced 5 wxTextCtrl.
    My program is to let the user enter the serial number.
    Each wxTextCtrl has 4 maxlength.
    My ideal is
    if the user enter 4 digits on first wxTextCtrl, and the program will move
    the cursor to the second wxTextCtrl.
    I checked the wxTextCtrl::Set InsertingPoint.
    But this function is only move on itself.
    For exammple,

    xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxx

    .....
    .....

    self.tctrl_1 = wxTextCtrl(.... ..)
    self.tctrl_2 = wxTextCtrl(.... ..)

    self.Bind(EVT_T EXT,self.OnText Processing_1,se lf.tctrl_1)
    self.Bind(EVT_T EXT,self.OnText Processing_2,se lf.tctrl_2)

    .....
    .....

    def OnTextProcessin g_1(self,evt):
    if len(evt.GetStri ng())==4:
    self.tctrl_2.Se tInsertionPoint (0)

    xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxx


    The code "self.tctrl_2.S etInsertingPoin t(0)" doesn't work.
    But if i change to "self.tctrl_1.. ." works fine.

    So what's problem?



Working...