X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d99702e4b41ed8b4110325e3dd9d710b5d32562..8775b357008a14fd2acdd2e2c70600f1c6346504:/utils/wxPython/src/msw/events.py diff --git a/utils/wxPython/src/msw/events.py b/utils/wxPython/src/msw/events.py index 39025e5429..f088e26c73 100644 --- a/utils/wxPython/src/msw/events.py +++ b/utils/wxPython/src/msw/events.py @@ -6,6 +6,9 @@ class wxEventPtr : def __init__(self,this): self.this = this self.thisown = 0 + def __del__(self,eventsc=eventsc): + if self.thisown == 1 : + eventsc.delete_wxEvent(self) def GetEventObject(self, *_args, **_kwargs): val = apply(eventsc.wxEvent_GetEventObject,(self,) + _args, _kwargs) return val @@ -39,8 +42,9 @@ class wxEventPtr : def __repr__(self): return "" % (self.this,) class wxEvent(wxEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxEvent,_args,_kwargs) + self.thisown = 1 @@ -56,8 +60,9 @@ class wxSizeEventPtr(wxEventPtr): def __repr__(self): return "" % (self.this,) class wxSizeEvent(wxSizeEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxSizeEvent,_args,_kwargs) + self.thisown = 1 @@ -87,8 +92,9 @@ class wxCloseEventPtr(wxEventPtr): def __repr__(self): return "" % (self.this,) class wxCloseEvent(wxCloseEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxCloseEvent,_args,_kwargs) + self.thisown = 1 @@ -115,11 +121,21 @@ class wxCommandEventPtr(wxEventPtr): def IsSelection(self, *_args, **_kwargs): val = apply(eventsc.wxCommandEvent_IsSelection,(self,) + _args, _kwargs) return val + def SetString(self, *_args, **_kwargs): + val = apply(eventsc.wxCommandEvent_SetString,(self,) + _args, _kwargs) + return val + def SetExtraLong(self, *_args, **_kwargs): + val = apply(eventsc.wxCommandEvent_SetExtraLong,(self,) + _args, _kwargs) + return val + def SetInt(self, *_args, **_kwargs): + val = apply(eventsc.wxCommandEvent_SetInt,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxCommandEvent(wxCommandEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxCommandEvent,_args,_kwargs) + self.thisown = 1 @@ -137,8 +153,29 @@ class wxScrollEventPtr(wxCommandEventPtr): def __repr__(self): return "" % (self.this,) class wxScrollEvent(wxScrollEventPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxScrollEvent,_args,_kwargs) + self.thisown = 1 + + + + +class wxScrollWinEventPtr(wxEventPtr): def __init__(self,this): self.this = this + self.thisown = 0 + def GetOrientation(self, *_args, **_kwargs): + val = apply(eventsc.wxScrollWinEvent_GetOrientation,(self,) + _args, _kwargs) + return val + def GetPosition(self, *_args, **_kwargs): + val = apply(eventsc.wxScrollWinEvent_GetPosition,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxScrollWinEvent(wxScrollWinEventPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxScrollWinEvent,_args,_kwargs) + self.thisown = 1 @@ -150,8 +187,9 @@ class wxSpinEventPtr(wxScrollEventPtr): def __repr__(self): return "" % (self.this,) class wxSpinEvent(wxSpinEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxSpinEvent,_args,_kwargs) + self.thisown = 1 @@ -238,13 +276,13 @@ class wxMouseEventPtr(wxEventPtr): def Leaving(self, *_args, **_kwargs): val = apply(eventsc.wxMouseEvent_Leaving,(self,) + _args, _kwargs) return val - def Position(self, *_args, **_kwargs): - val = apply(eventsc.wxMouseEvent_Position,(self,) + _args, _kwargs) - return val def GetPosition(self, *_args, **_kwargs): val = apply(eventsc.wxMouseEvent_GetPosition,(self,) + _args, _kwargs) if val: val = wxPointPtr(val) ; val.thisown = 1 return val + def GetPositionTuple(self, *_args, **_kwargs): + val = apply(eventsc.wxMouseEvent_GetPositionTuple,(self,) + _args, _kwargs) + return val def GetLogicalPosition(self, *_args, **_kwargs): val = apply(eventsc.wxMouseEvent_GetLogicalPosition,(self,) + _args, _kwargs) if val: val = wxPointPtr(val) ; val.thisown = 1 @@ -258,8 +296,9 @@ class wxMouseEventPtr(wxEventPtr): def __repr__(self): return "" % (self.this,) class wxMouseEvent(wxMouseEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxMouseEvent,_args,_kwargs) + self.thisown = 1 @@ -283,11 +322,58 @@ class wxKeyEventPtr(wxEventPtr): def KeyCode(self, *_args, **_kwargs): val = apply(eventsc.wxKeyEvent_KeyCode,(self,) + _args, _kwargs) return val + def GetX(self, *_args, **_kwargs): + val = apply(eventsc.wxKeyEvent_GetX,(self,) + _args, _kwargs) + return val + def GetY(self, *_args, **_kwargs): + val = apply(eventsc.wxKeyEvent_GetY,(self,) + _args, _kwargs) + return val + def GetPosition(self, *_args, **_kwargs): + val = apply(eventsc.wxKeyEvent_GetPosition,(self,) + _args, _kwargs) + if val: val = wxPointPtr(val) ; val.thisown = 1 + return val + def GetPositionTuple(self, *_args, **_kwargs): + val = apply(eventsc.wxKeyEvent_GetPositionTuple,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxKeyEvent(wxKeyEventPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxKeyEvent,_args,_kwargs) + self.thisown = 1 + + + + +class wxNavigationKeyEventPtr(wxEventPtr): def __init__(self,this): self.this = this + self.thisown = 0 + def GetDirection(self, *_args, **_kwargs): + val = apply(eventsc.wxNavigationKeyEvent_GetDirection,(self,) + _args, _kwargs) + return val + def SetDirection(self, *_args, **_kwargs): + val = apply(eventsc.wxNavigationKeyEvent_SetDirection,(self,) + _args, _kwargs) + return val + def IsWindowChange(self, *_args, **_kwargs): + val = apply(eventsc.wxNavigationKeyEvent_IsWindowChange,(self,) + _args, _kwargs) + return val + def SetWindowChange(self, *_args, **_kwargs): + val = apply(eventsc.wxNavigationKeyEvent_SetWindowChange,(self,) + _args, _kwargs) + return val + def GetCurrentFocus(self, *_args, **_kwargs): + val = apply(eventsc.wxNavigationKeyEvent_GetCurrentFocus,(self,) + _args, _kwargs) + if val: val = wxWindowPtr(val) + return val + def SetCurrentFocus(self, *_args, **_kwargs): + val = apply(eventsc.wxNavigationKeyEvent_SetCurrentFocus,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxNavigationKeyEvent(wxNavigationKeyEventPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxNavigationKeyEvent,_args,_kwargs) + self.thisown = 1 @@ -303,8 +389,9 @@ class wxMoveEventPtr(wxEventPtr): def __repr__(self): return "" % (self.this,) class wxMoveEvent(wxMoveEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxMoveEvent,_args,_kwargs) + self.thisown = 1 @@ -316,8 +403,9 @@ class wxPaintEventPtr(wxEventPtr): def __repr__(self): return "" % (self.this,) class wxPaintEvent(wxPaintEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxPaintEvent,_args,_kwargs) + self.thisown = 1 @@ -333,8 +421,9 @@ class wxEraseEventPtr(wxEventPtr): def __repr__(self): return "" % (self.this,) class wxEraseEvent(wxEraseEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxEraseEvent,_args,_kwargs) + self.thisown = 1 @@ -346,8 +435,9 @@ class wxFocusEventPtr(wxEventPtr): def __repr__(self): return "" % (self.this,) class wxFocusEvent(wxFocusEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxFocusEvent,_args,_kwargs) + self.thisown = 1 @@ -362,8 +452,9 @@ class wxActivateEventPtr(wxEventPtr): def __repr__(self): return "" % (self.this,) class wxActivateEvent(wxActivateEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxActivateEvent,_args,_kwargs) + self.thisown = 1 @@ -375,8 +466,9 @@ class wxInitDialogEventPtr(wxEventPtr): def __repr__(self): return "" % (self.this,) class wxInitDialogEvent(wxInitDialogEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxInitDialogEvent,_args,_kwargs) + self.thisown = 1 @@ -391,8 +483,9 @@ class wxMenuEventPtr(wxEventPtr): def __repr__(self): return "" % (self.this,) class wxMenuEvent(wxMenuEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxMenuEvent,_args,_kwargs) + self.thisown = 1 @@ -410,8 +503,9 @@ class wxShowEventPtr(wxEventPtr): def __repr__(self): return "" % (self.this,) class wxShowEvent(wxShowEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxShowEvent,_args,_kwargs) + self.thisown = 1 @@ -423,8 +517,9 @@ class wxIconizeEventPtr(wxEventPtr): def __repr__(self): return "" % (self.this,) class wxIconizeEvent(wxIconizeEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxIconizeEvent,_args,_kwargs) + self.thisown = 1 @@ -436,8 +531,9 @@ class wxMaximizeEventPtr(wxEventPtr): def __repr__(self): return "" % (self.this,) class wxMaximizeEvent(wxMaximizeEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxMaximizeEvent,_args,_kwargs) + self.thisown = 1 @@ -498,8 +594,9 @@ class wxJoystickEventPtr(wxEventPtr): def __repr__(self): return "" % (self.this,) class wxJoystickEvent(wxJoystickEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxJoystickEvent,_args,_kwargs) + self.thisown = 1 @@ -540,8 +637,9 @@ class wxIdleEventPtr(wxEventPtr): def __repr__(self): return "" % (self.this,) class wxIdleEvent(wxIdleEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxIdleEvent,_args,_kwargs) + self.thisown = 1 @@ -580,8 +678,9 @@ class wxUpdateUIEventPtr(wxEventPtr): def __repr__(self): return "" % (self.this,) class wxUpdateUIEvent(wxUpdateUIEventPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxUpdateUIEvent,_args,_kwargs) + self.thisown = 1 @@ -593,24 +692,122 @@ class wxSysColourChangedEventPtr(wxEventPtr): def __repr__(self): return "" % (self.this,) class wxSysColourChangedEvent(wxSysColourChangedEventPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxSysColourChangedEvent,_args,_kwargs) + self.thisown = 1 + + + + +class wxNotifyEventPtr(wxCommandEventPtr): def __init__(self,this): self.this = this + self.thisown = 0 + def IsAllowed(self, *_args, **_kwargs): + val = apply(eventsc.wxNotifyEvent_IsAllowed,(self,) + _args, _kwargs) + return val + def Veto(self, *_args, **_kwargs): + val = apply(eventsc.wxNotifyEvent_Veto,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxNotifyEvent(wxNotifyEventPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxNotifyEvent,_args,_kwargs) + self.thisown = 1 -class wxPyEventPtr(wxCommandEventPtr): +class wxPaletteChangedEventPtr(wxEventPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def SetChangedWindow(self, *_args, **_kwargs): + val = apply(eventsc.wxPaletteChangedEvent_SetChangedWindow,(self,) + _args, _kwargs) + return val + def GetChangedWindow(self, *_args, **_kwargs): + val = apply(eventsc.wxPaletteChangedEvent_GetChangedWindow,(self,) + _args, _kwargs) + if val: val = wxWindowPtr(val) + return val + def __repr__(self): + return "" % (self.this,) +class wxPaletteChangedEvent(wxPaletteChangedEventPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxPaletteChangedEvent,_args,_kwargs) + self.thisown = 1 + + + + +class wxQueryNewPaletteEventPtr(wxEventPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def SetPaletteRealized(self, *_args, **_kwargs): + val = apply(eventsc.wxQueryNewPaletteEvent_SetPaletteRealized,(self,) + _args, _kwargs) + return val + def GetPaletteRealized(self, *_args, **_kwargs): + val = apply(eventsc.wxQueryNewPaletteEvent_GetPaletteRealized,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxQueryNewPaletteEvent(wxQueryNewPaletteEventPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxQueryNewPaletteEvent,_args,_kwargs) + self.thisown = 1 + + + + +class wxWindowCreateEventPtr(wxEventPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def GetWindow(self, *_args, **_kwargs): + val = apply(eventsc.wxWindowCreateEvent_GetWindow,(self,) + _args, _kwargs) + if val: val = wxWindowPtr(val) + return val + def __repr__(self): + return "" % (self.this,) +class wxWindowCreateEvent(wxWindowCreateEventPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxWindowCreateEvent,_args,_kwargs) + self.thisown = 1 + + + + +class wxWindowDestroyEventPtr(wxEventPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def GetWindow(self, *_args, **_kwargs): + val = apply(eventsc.wxWindowDestroyEvent_GetWindow,(self,) + _args, _kwargs) + if val: val = wxWindowPtr(val) + return val + def __repr__(self): + return "" % (self.this,) +class wxWindowDestroyEvent(wxWindowDestroyEventPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxWindowDestroyEvent,_args,_kwargs) + self.thisown = 1 + + + + +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 SetUserData(self, *_args, **_kwargs): - val = apply(eventsc.wxPyEvent_SetUserData,(self,) + _args, _kwargs) + def SetSelf(self, *_args, **_kwargs): + val = apply(eventsc.wxPyEvent_SetSelf,(self,) + _args, _kwargs) return val - def GetUserData(self, *_args, **_kwargs): - val = apply(eventsc.wxPyEvent_GetUserData,(self,) + _args, _kwargs) + def GetSelf(self, *_args, **_kwargs): + val = apply(eventsc.wxPyEvent_GetSelf,(self,) + _args, _kwargs) return val def __repr__(self): return "" % (self.this,) @@ -618,25 +815,31 @@ class wxPyEvent(wxPyEventPtr): def __init__(self,*_args,**_kwargs): self.this = apply(eventsc.new_wxPyEvent,_args,_kwargs) self.thisown = 1 + self.SetSelf(self) -class wxNotifyEventPtr(wxCommandEventPtr): +class wxPyCommandEventPtr(wxCommandEventPtr): def __init__(self,this): self.this = this self.thisown = 0 - def IsAllowed(self, *_args, **_kwargs): - val = apply(eventsc.wxNotifyEvent_IsAllowed,(self,) + _args, _kwargs) + def __del__(self,eventsc=eventsc): + if self.thisown == 1 : + eventsc.delete_wxPyCommandEvent(self) + def SetSelf(self, *_args, **_kwargs): + val = apply(eventsc.wxPyCommandEvent_SetSelf,(self,) + _args, _kwargs) return val - def Veto(self, *_args, **_kwargs): - val = apply(eventsc.wxNotifyEvent_Veto,(self,) + _args, _kwargs) + def GetSelf(self, *_args, **_kwargs): + val = apply(eventsc.wxPyCommandEvent_GetSelf,(self,) + _args, _kwargs) return val def __repr__(self): - return "" % (self.this,) -class wxNotifyEvent(wxNotifyEventPtr): - def __init__(self,this): - self.this = this + return "" % (self.this,) +class wxPyCommandEvent(wxPyCommandEventPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxPyCommandEvent,_args,_kwargs) + self.thisown = 1 + self.SetSelf(self)