Merged the wxPy_newswig branch into the HEAD branch (main trunk)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24541 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-11-12 21:34:20 +00:00
parent eb6a4098a0
commit d14a1e2856
987 changed files with 671143 additions and 783083 deletions

View File

@@ -1,43 +1,9 @@
#----------------------------------------------------------------------------
# Name: wxPython.lib.mixins.grid
# Purpose: Helpful mix-in classes for wxGrid
#
# Author: Robin Dunn
#
# Created: 5-June-2001
# RCS-ID: $Id$
# Copyright: (c) 2001 by Total Control Software
# Licence: wxWindows license
#----------------------------------------------------------------------------
## This file imports items from the wx package into the wxPython package for
## backwards compatibility. Some names will also have a 'wx' added on if
## that is how they used to be named in the old wxPython package.
from wxPython import wx, grid
import wx.lib.mixins.grid
#----------------------------------------------------------------------------
class wxGridAutoEditMixin:
"""A mix-in class that automatically enables the grid edit control when
a cell is selected.
If your class hooks EVT_GRID_SELECT_CELL be sure to call event.Skip so
this handler will be called too.
"""
def __init__(self):
self.__enableEdit = 0
wx.EVT_IDLE(self, self.__OnIdle)
grid.EVT_GRID_SELECT_CELL(self, self.__OnSelectCell)
def __OnIdle(self, evt):
if self.__enableEdit:
if self.CanEnableCellControl():
self.EnableCellEditControl()
self.__enableEdit = 0
evt.Skip()
def __OnSelectCell(self, evt):
self.__enableEdit = 1
evt.Skip()
__doc__ = wx.lib.mixins.grid.__doc__
wxGridAutoEditMixin = wx.lib.mixins.grid.wxGridAutoEditMixin