MoveAfterInTabOrder

Hi List,

I am working with unknown controls derived of “MaskEditCtrl”, I need to set order of tabulation of such, but when trying to run the method “MoveAfterInTabOrder”, leaves the error to me “win is not to sibling” since I can do?

Example:

class NumCtrlInt(masked.NumCtrl):
def init(self,parent,lenght,size=15, fractionWidth=2):
masked.NumCtrl.init(self, parent, -1,
style = wx.TE_PROCESS_TAB|wx.TE_RIGHT,
size=(30,17),
integerWidth=int(lenght),
groupDigits = False,
fractionWidth=2,
selectOnEntry = True,
autoSize = False,
decimalChar = ‘.’,
allowNegative=False,
useFixedWidthFont=False)

    self.Refresh()
    return

Mary Dinora Guevara wrote:

Hi List,
I am working with unknown controls derived of "MaskEditCtrl", I need to set order of tabulation of such, but when trying to run the method "MoveAfterInTabOrder", leaves the error to me "win is not to sibling" since I can do?

Do you mean the Unknown Control feature of XRC? If so then there is an extra window used to host the unknown control in the XRC layout and so the widgets are in fact *not* siblings because they don't share the same parent. (I guess they would be cousins in this case. <wink!>)

Probably the best way to work around this is to not use the Unknown Control feature and instead use XRC's subclass feature. It allows you to build the XRC as if you are going to use a normal wx.TextCtrl, but then when it renders the xml into widgets it will actually create an instance of some subclass of wx.TextCtrl, such as your derived NumCtrlInt. There were some examples of how to do this posted to this list a while back, probably about a year ago. If somebody has a link handy please post it, or copy/paste it into a wiki page.

Another approach to try if you can't get the above to work is to change the tab order of the unknown control placeholder windows, something like this:

  ctrl1.GetParent().MoveAfterInTabOrder(ctrl2.GetParent())

···

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