New typemaps for wxString when compiling for Python 2.0 and beyond
that allow Unicode objects to be passed as well as String objects. If a Unicode object is passed PyString_AsStringAndSize is used to convert it to a wxString using the default encoding. Fixed the generic buttons so tool tips work for them. Fixed a bug in the demo's tree control. Added a listbox to the listbox demo that shows how to find items with a patching prefix as keys are typed. Added code to the wxListCtrl demo to show how to get text from a column in report mode. Added code to the toolbar demo to clear the long help from the status bar after 2 seconds. Added wxJoystick. Fixed wxTimer so it can be used as described in the docs, either with a Notify method in a subclass, or sending an event to a wxEvtHandler object, (usually a window.) Added wxNotifyEvent.Allow() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -674,22 +674,49 @@ def EVT_TIMER(win, id, func):
|
||||
def EVT_END_PROCESS(eh, id, func):
|
||||
eh.Connect(id, -1, wxEVT_END_PROCESS, func)
|
||||
|
||||
|
||||
# wxJoyStick
|
||||
def EVT_JOY_DOWN(win, func):
|
||||
win.Connect(-1, -1, wxEVT_JOY_DOWN, func)
|
||||
|
||||
def EVT_JOY_UP(win, func):
|
||||
win.Connect(-1, -1, wxEVT_JOY_UP, func)
|
||||
|
||||
def EVT_JOY_MOVE(win, func):
|
||||
win.Connect(-1, -1, wxEVT_JOY_MOVE, func)
|
||||
|
||||
def EVT_JOY_ZMOVE(win, func):
|
||||
win.Connect(-1, -1, wxEVT_JOY_ZMOVE, func)
|
||||
|
||||
def EVT_JOYSTICK_EVENTS(win, func):
|
||||
win.Connect(-1, -1, wxEVT_JOY_DOWN, func)
|
||||
win.Connect(-1, -1, wxEVT_JOY_UP, func)
|
||||
win.Connect(-1, -1, wxEVT_JOY_MOVE, func)
|
||||
win.Connect(-1, -1, wxEVT_JOY_ZMOVE, func)
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
class wxTimer(wxPyTimer):
|
||||
def __init__(self):
|
||||
wxPyTimer.__init__(self, self.Notify) # derived class must provide
|
||||
# Notify(self) method.
|
||||
def __init__(self, evtHandler = None, id = -1):
|
||||
if evtHandler is None:
|
||||
wxPyTimer.__init__(self, self.Notify) # derived class must provide
|
||||
# Notify(self) method.
|
||||
else:
|
||||
wxPyTimer.__init__(self, None)
|
||||
self.SetOwner(evtHandler, id)
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# Some wxWin methods can take "NULL" as parameters, but the shadow classes
|
||||
# expect an object with the SWIG pointer as a 'this' member. This class
|
||||
# and instance fools the shadow into passing the NULL pointer.
|
||||
|
||||
class NullObj:
|
||||
## NOTE: This is not needed anymore as None can be passed instead and
|
||||
# will be interpreted as NULL.
|
||||
|
||||
class _NullObj:
|
||||
this = 'NULL' # SWIG converts this to (void*)0
|
||||
|
||||
NULL = NullObj()
|
||||
NULL = _NullObj()
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user