tab dosn't end edit in custom table under windows

under windows (works in gnome) my custom table's custom editor doesn't close the edit control and move across to the next grid cell(it instead moves to the next item on the panel). i have no idea why this is, but i am assuming it something to do witht he editor since other custom grids don't display this behavour. here is my endedit function from the custom editor class, which i believe is some how trapping the tab

def EndEdit(self, row, col, grid):
        """
        Complete the editing of the current cell. Returns True if the value
        has changed. If necessary, the control may be destroyed.
        *Must Override*
        """
               changed = False
           val = self._tc.GetValue()
               if val != self.startValue:
            try:
                if re.search(r"[a-zA-Z]", val):
                    self._tc.SetValue('')
                elif int(val) >= 2359:
                    self._tc.SetValue('')
                else:
                    changed = True
                    grid.GetTable().SetValue(row, col, val) # update the table
                    self.startValue = ''
                    self._tc.SetValue('')
            except:
                changed = True
                grid.GetTable().SetValue(row, col, '') # update the table
                self.startValue = ''
                self._tc.SetValue('')
        return changed

Timothy Smith wrote:

under windows (works in gnome) my custom table's custom
editor doesn't close the edit control and move across to the
next grid cell(it instead moves to the next item on the
panel).

I assume you have a Create() function in your editor class. Mine looks like
this, and it works fine. TE_PROCESS_TAB should solve your problem, and
TE_PROCESS_ENTER is necessary if you have an active button elsewhere on your
form, as without it pressing <enter> activates the button instead of moving
down a line in the grid.

    def Create(self, parent, id, evtHandler=None):
        self._tc = wx.TextCtrl(parent, id, "",
            style=wx.TE_PROCESS_TAB|wx.TE_PROCESS_ENTER)

HTH

Frank Millman

Frank Millman wrote:

Timothy Smith wrote:

under windows (works in gnome) my custom table's custom editor doesn't close the edit control and move across to the next grid cell(it instead moves to the next item on the panel).
   
I assume you have a Create() function in your editor class. Mine looks like
this, and it works fine. TE_PROCESS_TAB should solve your problem, and
TE_PROCESS_ENTER is necessary if you have an active button elsewhere on your
form, as without it pressing <enter> activates the button instead of moving
down a line in the grid.

   def Create(self, parent, id, evtHandler=None):
       self._tc = wx.TextCtrl(parent, id, "",
           style=wx.TE_PROCESS_TAB|wx.TE_PROCESS_ENTER)

HTH

Frank Millman

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

yep worked perfectly, thanks champ.