X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/59988cd01058e38ea408b0751fdf8bf9cab09f38..53663be8a5ea8e1c6f178839209b67e8228e4642:/wxPython/src/mac/events.py diff --git a/wxPython/src/mac/events.py b/wxPython/src/mac/events.py index 067c8ed1f5..3f52c08034 100644 --- a/wxPython/src/mac/events.py +++ b/wxPython/src/mac/events.py @@ -10,9 +10,12 @@ class wxEventPtr(wxObjectPtr): def __init__(self,this): self.this = this self.thisown = 0 - def __del__(self,eventsc=eventsc): - if self.thisown == 1 : - eventsc.delete_wxEvent(self) + def __del__(self, delfunc=eventsc.delete_wxEvent): + if self.thisown == 1: + try: + delfunc(self) + except: + pass def GetEventObject(self, *_args, **_kwargs): val = apply(eventsc.wxEvent_GetEventObject,(self,) + _args, _kwargs) return val @@ -406,6 +409,36 @@ class wxMouseCaptureChangedEvent(wxMouseCaptureChangedEventPtr): +class wxSetCursorEventPtr(wxEventPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def GetX(self, *_args, **_kwargs): + val = apply(eventsc.wxSetCursorEvent_GetX,(self,) + _args, _kwargs) + return val + def GetY(self, *_args, **_kwargs): + val = apply(eventsc.wxSetCursorEvent_GetY,(self,) + _args, _kwargs) + return val + def SetCursor(self, *_args, **_kwargs): + val = apply(eventsc.wxSetCursorEvent_SetCursor,(self,) + _args, _kwargs) + return val + def GetCursor(self, *_args, **_kwargs): + val = apply(eventsc.wxSetCursorEvent_GetCursor,(self,) + _args, _kwargs) + if val: val = wxCursorPtr(val) + return val + def HasCursor(self, *_args, **_kwargs): + val = apply(eventsc.wxSetCursorEvent_HasCursor,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxSetCursorEvent(wxSetCursorEventPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxSetCursorEvent,_args,_kwargs) + self.thisown = 1 + + + + class wxKeyEventPtr(wxEventPtr): def __init__(self,this): self.this = this @@ -422,9 +455,6 @@ class wxKeyEventPtr(wxEventPtr): def ShiftDown(self, *_args, **_kwargs): val = apply(eventsc.wxKeyEvent_ShiftDown,(self,) + _args, _kwargs) return val - def KeyCode(self, *_args, **_kwargs): - val = apply(eventsc.wxKeyEvent_KeyCode,(self,) + _args, _kwargs) - return val def GetKeyCode(self, *_args, **_kwargs): val = apply(eventsc.wxKeyEvent_GetKeyCode,(self,) + _args, _kwargs) return val @@ -506,6 +536,7 @@ class wxKeyEventPtr(wxEventPtr): raise AttributeError,name def __repr__(self): return "" % (self.this,) + KeyCode = GetKeyCode class wxKeyEvent(wxKeyEventPtr): def __init__(self,*_args,**_kwargs): self.this = apply(eventsc.new_wxKeyEvent,_args,_kwargs) @@ -1000,6 +1031,27 @@ class wxWindowDestroyEvent(wxWindowDestroyEventPtr): +class wxContextMenuEventPtr(wxCommandEventPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def GetPosition(self, *_args, **_kwargs): + val = apply(eventsc.wxContextMenuEvent_GetPosition,(self,) + _args, _kwargs) + if val: val = wxPointPtr(val) + return val + def SetPosition(self, *_args, **_kwargs): + val = apply(eventsc.wxContextMenuEvent_SetPosition,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxContextMenuEvent(wxContextMenuEventPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxContextMenuEvent,_args,_kwargs) + self.thisown = 1 + + + + class wxTimerEventPtr(wxEventPtr): def __init__(self,this): self.this = this @@ -1044,9 +1096,12 @@ class wxPyEventPtr(wxEventPtr): def __init__(self,this): self.this = this self.thisown = 0 - def __del__(self,eventsc=eventsc): - if self.thisown == 1 : - eventsc.delete_wxPyEvent(self) + def __del__(self, delfunc=eventsc.delete_wxPyEvent): + if self.thisown == 1: + try: + delfunc(self) + except: + pass def SetSelf(self, *_args, **_kwargs): val = apply(eventsc.wxPyEvent_SetSelf,(self,) + _args, _kwargs) return val @@ -1068,9 +1123,12 @@ class wxPyCommandEventPtr(wxCommandEventPtr): def __init__(self,this): self.this = this self.thisown = 0 - def __del__(self,eventsc=eventsc): - if self.thisown == 1 : - eventsc.delete_wxPyCommandEvent(self) + def __del__(self, delfunc=eventsc.delete_wxPyCommandEvent): + if self.thisown == 1: + try: + delfunc(self) + except: + pass def SetSelf(self, *_args, **_kwargs): val = apply(eventsc.wxPyCommandEvent_SetSelf,(self,) + _args, _kwargs) return val