]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/mac/events.py
added functions to read/write several elements at once (patch 754986)
[wxWidgets.git] / wxPython / src / mac / events.py
index 03051a07027f94c9fb2e221f96b5987f4f317030..3f52c0803473eab504c7da7a0f98e50878393252 100644 (file)
@@ -4,13 +4,18 @@ import eventsc
 from misc import *
 
 from gdi import *
+
+from fonts import *
 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
@@ -387,6 +392,53 @@ 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 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 "<C wxSetCursorEvent instance at %s>" % (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
@@ -403,15 +455,18 @@ 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
     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
@@ -450,6 +505,12 @@ class wxKeyEventPtr(wxEventPtr):
         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" : 
@@ -468,9 +529,14 @@ class wxKeyEventPtr(wxEventPtr):
             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,)
+    KeyCode = GetKeyCode
 class wxKeyEvent(wxKeyEventPtr):
     def __init__(self,*_args,**_kwargs):
         self.this = apply(eventsc.new_wxKeyEvent,_args,_kwargs)
@@ -629,6 +695,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):
@@ -874,6 +943,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
@@ -948,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 "<C wxContextMenuEvent instance at %s>" % (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
@@ -992,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
@@ -1016,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