]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/events.py
wxUniversal fixes:
[wxWidgets.git] / wxPython / src / gtk / events.py
index e5ca31ceb02e1f38f98d84c9d0253add6a8e00d2..067c8ed1f555c72eafe894e600f99f8c761e7b60 100644 (file)
@@ -4,7 +4,9 @@ import eventsc
 from misc import *
 
 from gdi import *
-class wxEventPtr :
+
+from fonts import *
+class wxEventPtr(wxObjectPtr):
     def __init__(self,this):
         self.this = this
         self.thisown = 0
@@ -41,12 +43,15 @@ class wxEventPtr :
     def Skip(self, *_args, **_kwargs):
         val = apply(eventsc.wxEvent_Skip,(self,) + _args, _kwargs)
         return val
+    def Clone(self, *_args, **_kwargs):
+        val = apply(eventsc.wxEvent_Clone,(self,) + _args, _kwargs)
+        if val: val = wxEventPtr(val) 
+        return val
     def __repr__(self):
         return "<C wxEvent instance at %s>" % (self.this,)
 class wxEvent(wxEventPtr):
-    def __init__(self,*_args,**_kwargs):
-        self.this = apply(eventsc.new_wxEvent,_args,_kwargs)
-        self.thisown = 1
+    def __init__(self,this):
+        self.this = this
 
 
 
@@ -105,6 +110,9 @@ class wxCommandEventPtr(wxEventPtr):
     def __init__(self,this):
         self.this = this
         self.thisown = 0
+    def IsChecked(self, *_args, **_kwargs):
+        val = apply(eventsc.wxCommandEvent_IsChecked,(self,) + _args, _kwargs)
+        return val
     def Checked(self, *_args, **_kwargs):
         val = apply(eventsc.wxCommandEvent_Checked,(self,) + _args, _kwargs)
         return val
@@ -132,6 +140,9 @@ class wxCommandEventPtr(wxEventPtr):
     def SetInt(self, *_args, **_kwargs):
         val = apply(eventsc.wxCommandEvent_SetInt,(self,) + _args, _kwargs)
         return val
+    def GetClientData(self, *_args, **_kwargs):
+        val = apply(eventsc.wxCommandEvent_GetClientData,(self,) + _args, _kwargs)
+        return val
     def __repr__(self):
         return "<C wxCommandEvent instance at %s>" % (self.this,)
 class wxCommandEvent(wxCommandEventPtr):
@@ -295,6 +306,79 @@ class wxMouseEventPtr(wxEventPtr):
     def GetY(self, *_args, **_kwargs):
         val = apply(eventsc.wxMouseEvent_GetY,(self,) + _args, _kwargs)
         return val
+    def GetWheelRotation(self, *_args, **_kwargs):
+        val = apply(eventsc.wxMouseEvent_GetWheelRotation,(self,) + _args, _kwargs)
+        return val
+    def GetWheelDelta(self, *_args, **_kwargs):
+        val = apply(eventsc.wxMouseEvent_GetWheelDelta,(self,) + _args, _kwargs)
+        return val
+    def GetLinesPerAction(self, *_args, **_kwargs):
+        val = apply(eventsc.wxMouseEvent_GetLinesPerAction,(self,) + _args, _kwargs)
+        return val
+    def __setattr__(self,name,value):
+        if name == "m_x" :
+            eventsc.wxMouseEvent_m_x_set(self,value)
+            return
+        if name == "m_y" :
+            eventsc.wxMouseEvent_m_y_set(self,value)
+            return
+        if name == "m_leftDown" :
+            eventsc.wxMouseEvent_m_leftDown_set(self,value)
+            return
+        if name == "m_middleDown" :
+            eventsc.wxMouseEvent_m_middleDown_set(self,value)
+            return
+        if name == "m_rightDown" :
+            eventsc.wxMouseEvent_m_rightDown_set(self,value)
+            return
+        if name == "m_controlDown" :
+            eventsc.wxMouseEvent_m_controlDown_set(self,value)
+            return
+        if name == "m_shiftDown" :
+            eventsc.wxMouseEvent_m_shiftDown_set(self,value)
+            return
+        if name == "m_altDown" :
+            eventsc.wxMouseEvent_m_altDown_set(self,value)
+            return
+        if name == "m_metaDown" :
+            eventsc.wxMouseEvent_m_metaDown_set(self,value)
+            return
+        if name == "m_wheelRotation" :
+            eventsc.wxMouseEvent_m_wheelRotation_set(self,value)
+            return
+        if name == "m_wheelDelta" :
+            eventsc.wxMouseEvent_m_wheelDelta_set(self,value)
+            return
+        if name == "m_linesPerAction" :
+            eventsc.wxMouseEvent_m_linesPerAction_set(self,value)
+            return
+        self.__dict__[name] = value
+    def __getattr__(self,name):
+        if name == "m_x" : 
+            return eventsc.wxMouseEvent_m_x_get(self)
+        if name == "m_y" : 
+            return eventsc.wxMouseEvent_m_y_get(self)
+        if name == "m_leftDown" : 
+            return eventsc.wxMouseEvent_m_leftDown_get(self)
+        if name == "m_middleDown" : 
+            return eventsc.wxMouseEvent_m_middleDown_get(self)
+        if name == "m_rightDown" : 
+            return eventsc.wxMouseEvent_m_rightDown_get(self)
+        if name == "m_controlDown" : 
+            return eventsc.wxMouseEvent_m_controlDown_get(self)
+        if name == "m_shiftDown" : 
+            return eventsc.wxMouseEvent_m_shiftDown_get(self)
+        if name == "m_altDown" : 
+            return eventsc.wxMouseEvent_m_altDown_get(self)
+        if name == "m_metaDown" : 
+            return eventsc.wxMouseEvent_m_metaDown_get(self)
+        if name == "m_wheelRotation" : 
+            return eventsc.wxMouseEvent_m_wheelRotation_get(self)
+        if name == "m_wheelDelta" : 
+            return eventsc.wxMouseEvent_m_wheelDelta_get(self)
+        if name == "m_linesPerAction" : 
+            return eventsc.wxMouseEvent_m_linesPerAction_get(self)
+        raise AttributeError,name
     def __repr__(self):
         return "<C wxMouseEvent instance at %s>" % (self.this,)
 class wxMouseEvent(wxMouseEventPtr):
@@ -305,6 +389,23 @@ class wxMouseEvent(wxMouseEventPtr):
 
 
 
+class wxMouseCaptureChangedEventPtr(wxEventPtr):
+    def __init__(self,this):
+        self.this = this
+        self.thisown = 0
+    def GetCapturedWindow(self, *_args, **_kwargs):
+        val = apply(eventsc.wxMouseCaptureChangedEvent_GetCapturedWindow,(self,) + _args, _kwargs)
+        return val
+    def __repr__(self):
+        return "<C wxMouseCaptureChangedEvent instance at %s>" % (self.this,)
+class wxMouseCaptureChangedEvent(wxMouseCaptureChangedEventPtr):
+    def __init__(self,*_args,**_kwargs):
+        self.this = apply(eventsc.new_wxMouseCaptureChangedEvent,_args,_kwargs)
+        self.thisown = 1
+
+
+
+
 class wxKeyEventPtr(wxEventPtr):
     def __init__(self,this):
         self.this = this
@@ -330,6 +431,12 @@ class wxKeyEventPtr(wxEventPtr):
     def HasModifiers(self, *_args, **_kwargs):
         val = apply(eventsc.wxKeyEvent_HasModifiers,(self,) + _args, _kwargs)
         return val
+    def GetRawKeyCode(self, *_args, **_kwargs):
+        val = apply(eventsc.wxKeyEvent_GetRawKeyCode,(self,) + _args, _kwargs)
+        return val
+    def GetRawKeyFlags(self, *_args, **_kwargs):
+        val = apply(eventsc.wxKeyEvent_GetRawKeyFlags,(self,) + _args, _kwargs)
+        return val
     def GetX(self, *_args, **_kwargs):
         val = apply(eventsc.wxKeyEvent_GetX,(self,) + _args, _kwargs)
         return val
@@ -343,6 +450,60 @@ class wxKeyEventPtr(wxEventPtr):
     def GetPositionTuple(self, *_args, **_kwargs):
         val = apply(eventsc.wxKeyEvent_GetPositionTuple,(self,) + _args, _kwargs)
         return val
+    def __setattr__(self,name,value):
+        if name == "m_x" :
+            eventsc.wxKeyEvent_m_x_set(self,value)
+            return
+        if name == "m_y" :
+            eventsc.wxKeyEvent_m_y_set(self,value)
+            return
+        if name == "m_keyCode" :
+            eventsc.wxKeyEvent_m_keyCode_set(self,value)
+            return
+        if name == "m_controlDown" :
+            eventsc.wxKeyEvent_m_controlDown_set(self,value)
+            return
+        if name == "m_shiftDown" :
+            eventsc.wxKeyEvent_m_shiftDown_set(self,value)
+            return
+        if name == "m_altDown" :
+            eventsc.wxKeyEvent_m_altDown_set(self,value)
+            return
+        if name == "m_metaDown" :
+            eventsc.wxKeyEvent_m_metaDown_set(self,value)
+            return
+        if name == "m_scanCode" :
+            eventsc.wxKeyEvent_m_scanCode_set(self,value)
+            return
+        if name == "m_rawCode" :
+            eventsc.wxKeyEvent_m_rawCode_set(self,value)
+            return
+        if name == "m_rawFlags" :
+            eventsc.wxKeyEvent_m_rawFlags_set(self,value)
+            return
+        self.__dict__[name] = value
+    def __getattr__(self,name):
+        if name == "m_x" : 
+            return eventsc.wxKeyEvent_m_x_get(self)
+        if name == "m_y" : 
+            return eventsc.wxKeyEvent_m_y_get(self)
+        if name == "m_keyCode" : 
+            return eventsc.wxKeyEvent_m_keyCode_get(self)
+        if name == "m_controlDown" : 
+            return eventsc.wxKeyEvent_m_controlDown_get(self)
+        if name == "m_shiftDown" : 
+            return eventsc.wxKeyEvent_m_shiftDown_get(self)
+        if name == "m_altDown" : 
+            return eventsc.wxKeyEvent_m_altDown_get(self)
+        if name == "m_metaDown" : 
+            return eventsc.wxKeyEvent_m_metaDown_get(self)
+        if name == "m_scanCode" : 
+            return eventsc.wxKeyEvent_m_scanCode_get(self)
+        if name == "m_rawCode" : 
+            return eventsc.wxKeyEvent_m_rawCode_get(self)
+        if name == "m_rawFlags" : 
+            return eventsc.wxKeyEvent_m_rawFlags_get(self)
+        raise AttributeError,name
     def __repr__(self):
         return "<C wxKeyEvent instance at %s>" % (self.this,)
 class wxKeyEvent(wxKeyEventPtr):
@@ -371,7 +532,6 @@ class wxNavigationKeyEventPtr(wxEventPtr):
         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)
@@ -424,7 +584,6 @@ class wxEraseEventPtr(wxEventPtr):
         self.thisown = 0
     def GetDC(self, *_args, **_kwargs):
         val = apply(eventsc.wxEraseEvent_GetDC,(self,) + _args, _kwargs)
-        if val: val = wxDCPtr(val) 
         return val
     def __repr__(self):
         return "<C wxEraseEvent instance at %s>" % (self.this,)
@@ -450,6 +609,23 @@ class wxFocusEvent(wxFocusEventPtr):
 
 
 
+class wxChildFocusEventPtr(wxCommandEventPtr):
+    def __init__(self,this):
+        self.this = this
+        self.thisown = 0
+    def GetWindow(self, *_args, **_kwargs):
+        val = apply(eventsc.wxChildFocusEvent_GetWindow,(self,) + _args, _kwargs)
+        return val
+    def __repr__(self):
+        return "<C wxChildFocusEvent instance at %s>" % (self.this,)
+class wxChildFocusEvent(wxChildFocusEventPtr):
+    def __init__(self,*_args,**_kwargs):
+        self.this = apply(eventsc.new_wxChildFocusEvent,_args,_kwargs)
+        self.thisown = 1
+
+
+
+
 class wxActivateEventPtr(wxEventPtr):
     def __init__(self,this):
         self.this = this
@@ -488,6 +664,9 @@ class wxMenuEventPtr(wxEventPtr):
     def GetMenuId(self, *_args, **_kwargs):
         val = apply(eventsc.wxMenuEvent_GetMenuId,(self,) + _args, _kwargs)
         return val
+    def IsPopup(self, *_args, **_kwargs):
+        val = apply(eventsc.wxMenuEvent_IsPopup,(self,) + _args, _kwargs)
+        return val
     def __repr__(self):
         return "<C wxMenuEvent instance at %s>" % (self.this,)
 class wxMenuEvent(wxMenuEventPtr):
@@ -522,6 +701,9 @@ class wxIconizeEventPtr(wxEventPtr):
     def __init__(self,this):
         self.this = this
         self.thisown = 0
+    def Iconized(self, *_args, **_kwargs):
+        val = apply(eventsc.wxIconizeEvent_Iconized,(self,) + _args, _kwargs)
+        return val
     def __repr__(self):
         return "<C wxIconizeEvent instance at %s>" % (self.this,)
 class wxIconizeEvent(wxIconizeEventPtr):
@@ -714,6 +896,9 @@ class wxNotifyEventPtr(wxCommandEventPtr):
     def IsAllowed(self, *_args, **_kwargs):
         val = apply(eventsc.wxNotifyEvent_IsAllowed,(self,) + _args, _kwargs)
         return val
+    def Allow(self, *_args, **_kwargs):
+        val = apply(eventsc.wxNotifyEvent_Allow,(self,) + _args, _kwargs)
+        return val
     def Veto(self, *_args, **_kwargs):
         val = apply(eventsc.wxNotifyEvent_Veto,(self,) + _args, _kwargs)
         return val
@@ -727,6 +912,20 @@ class wxNotifyEvent(wxNotifyEventPtr):
 
 
 
+class wxDisplayChangedEventPtr(wxEventPtr):
+    def __init__(self,this):
+        self.this = this
+        self.thisown = 0
+    def __repr__(self):
+        return "<C wxDisplayChangedEvent instance at %s>" % (self.this,)
+class wxDisplayChangedEvent(wxDisplayChangedEventPtr):
+    def __init__(self,*_args,**_kwargs):
+        self.this = apply(eventsc.new_wxDisplayChangedEvent,_args,_kwargs)
+        self.thisown = 1
+
+
+
+
 class wxPaletteChangedEventPtr(wxEventPtr):
     def __init__(self,this):
         self.this = this
@@ -736,7 +935,6 @@ class wxPaletteChangedEventPtr(wxEventPtr):
         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 "<C wxPaletteChangedEvent instance at %s>" % (self.this,)
@@ -774,7 +972,6 @@ class wxWindowCreateEventPtr(wxCommandEventPtr):
         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 "<C wxWindowCreateEvent instance at %s>" % (self.this,)
@@ -792,7 +989,6 @@ class wxWindowDestroyEventPtr(wxCommandEventPtr):
         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 "<C wxWindowDestroyEvent instance at %s>" % (self.this,)
@@ -821,6 +1017,29 @@ class wxTimerEvent(wxTimerEventPtr):
 
 
 
+class wxTextUrlEventPtr(wxCommandEventPtr):
+    def __init__(self,this):
+        self.this = this
+        self.thisown = 0
+    def GetMouseEvent(self, *_args, **_kwargs):
+        val = apply(eventsc.wxTextUrlEvent_GetMouseEvent,(self,) + _args, _kwargs)
+        return val
+    def GetURLStart(self, *_args, **_kwargs):
+        val = apply(eventsc.wxTextUrlEvent_GetURLStart,(self,) + _args, _kwargs)
+        return val
+    def GetURLEnd(self, *_args, **_kwargs):
+        val = apply(eventsc.wxTextUrlEvent_GetURLEnd,(self,) + _args, _kwargs)
+        return val
+    def __repr__(self):
+        return "<C wxTextUrlEvent instance at %s>" % (self.this,)
+class wxTextUrlEvent(wxTextUrlEventPtr):
+    def __init__(self,*_args,**_kwargs):
+        self.this = apply(eventsc.new_wxTextUrlEvent,_args,_kwargs)
+        self.thisown = 1
+
+
+
+
 class wxPyEventPtr(wxEventPtr):
     def __init__(self,this):
         self.this = this
@@ -873,6 +1092,8 @@ class wxPyCommandEvent(wxPyCommandEventPtr):
 
 #-------------- FUNCTION WRAPPERS ------------------
 
+wxNewEventType = eventsc.wxNewEventType
+
 
 
 #-------------- VARIABLE WRAPPERS ------------------