wxTextCtrl problem

A

austin

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::SetInsertingPoint.
But this function is only move on itself.
For exammple,

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

.....
.....

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

self.Bind(EVT_TEXT,self.OnTextProcessing_1,self.tctrl_1)
self.Bind(EVT_TEXT,self.OnTextProcessing_2,self.tctrl_2)

.....
.....

def OnTextProcessing_1(self,evt):
if len(evt.GetString())==4:
self.tctrl_2.SetInsertionPoint(0)

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


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

So what's problem?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,240
Messages
2,571,211
Members
47,845
Latest member
vojosay

Latest Threads

Top