]> git.saurik.com Git - wxWidgets.git/commitdiff
Lots of bup fixes, API updates, etc
authorRobin Dunn <robin@alldunn.com>
Fri, 21 Nov 2003 07:39:05 +0000 (07:39 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 21 Nov 2003 07:39:05 +0000 (07:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24621 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

36 files changed:
wxPython/include/wx/wxPython/pyclasses.h
wxPython/include/wx/wxPython/pydrawxxx.h
wxPython/include/wx/wxPython/wxPython_int.h
wxPython/src/_calendar_reverse.txt [new file with mode: 0644]
wxPython/src/_datetime.i
wxPython/src/_dnd.i
wxPython/src/_statusbar.i
wxPython/src/_timer.i
wxPython/src/_window.i
wxPython/src/drawlist.cpp
wxPython/src/gdi.i
wxPython/src/grid.i
wxPython/src/gtk/core.py
wxPython/src/gtk/core_wrap.cpp
wxPython/src/gtk/gdi_wrap.cpp
wxPython/src/gtk/grid.py
wxPython/src/gtk/grid_wrap.cpp
wxPython/src/gtk/misc.py
wxPython/src/gtk/misc_wrap.cpp
wxPython/src/gtk/windows.py
wxPython/src/gtk/windows_wrap.cpp
wxPython/wx/lib/colourchooser/canvas.py
wxPython/wx/lib/colourchooser/pycolourchooser.py
wxPython/wx/lib/colourchooser/pycolourslider.py
wxPython/wx/lib/colourchooser/pypalette.py
wxPython/wx/lib/colourdb.py
wxPython/wx/lib/colourselect.py
wxPython/wx/lib/editor/editor.py
wxPython/wx/lib/floatcanvas.py
wxPython/wx/lib/gridmovers.py
wxPython/wx/lib/maskededit.py
wxPython/wx/lib/multisash.py
wxPython/wx/lib/popupctl.py
wxPython/wxPython/calendar.py
wxPython/wxPython/lib/colourchooser/__init__.py
wxPython/wxPython/lib/editor/__init__.py

index f07a5de9184d26336c7fcbd8aac92b9a9ec96ad8..c74f8cacf94ee835a71387e13d29b3a12a99566f 100644 (file)
@@ -121,6 +121,64 @@ public:
 };
 
 
+//---------------------------------------------------------------------------
+
+class wxPyDropSource : public wxDropSource {
+public:
+#ifndef __WXGTK__
+     wxPyDropSource(wxWindow *win = NULL,
+                    const wxCursor &copy = wxNullCursor,
+                    const wxCursor &move = wxNullCursor,
+                    const wxCursor &none = wxNullCursor)
+         : wxDropSource(win, copy, move, none) {}
+#else
+    wxPyDropSource(wxWindow *win = NULL,
+                   const wxIcon& copy = wxNullIcon,
+                   const wxIcon& move = wxNullIcon,
+                   const wxIcon& none = wxNullIcon)
+        : wxDropSource(win, copy, move, none) {}
+#endif
+    ~wxPyDropSource() { }
+
+    DEC_PYCALLBACK_BOOL_DR(GiveFeedback);
+    PYPRIVATE;
+};
+
+
+class wxPyDropTarget : public wxDropTarget {
+public:
+    wxPyDropTarget(wxDataObject *dataObject = NULL)
+        : wxDropTarget(dataObject) {}
+
+    // called when mouse leaves the window: might be used to remove the
+    // feedback which was given in OnEnter()
+    DEC_PYCALLBACK__(OnLeave);
+
+    // called when the mouse enters the window (only once until OnLeave())
+    DEC_PYCALLBACK_DR_2WXCDR(OnEnter);
+
+    // called when the mouse moves in the window - shouldn't take long to
+    // execute or otherwise mouse movement would be too slow
+    DEC_PYCALLBACK_DR_2WXCDR(OnDragOver);
+    
+    // called after OnDrop() returns True: you will usually just call
+    // GetData() from here and, probably, also refresh something to update the
+    // new data and, finally, return the code indicating how did the operation
+    // complete (returning default value in case of success and wxDragError on
+    // failure is usually ok)
+    DEC_PYCALLBACK_DR_2WXCDR_pure(OnData);
+    
+    // this function is called when data is dropped at position (x, y) - if it
+    // returns True, OnData() will be called immediately afterwards which will
+    // allow to retrieve the data dropped.
+    DEC_PYCALLBACK_BOOL_INTINT(OnDrop);
+
+    PYPRIVATE;
+};
+
+
+
+
 //---------------------------------------------------------------------------
 
 class wxPyVScrolledWindow;
index ccbf1353d9d396474c91a42e09f8689a7319e6be..c2fb1360689420f9a2d9834622b30250d73ac6c9 100644 (file)
@@ -13,6 +13,8 @@
 #ifndef __pydrawxxx_h__
 #define __pydrawxxx_h__
 
+void wxPyDrawList_SetAPIPtr();
+
 typedef bool (*wxPyDrawListOp_t)(wxDC& dc, PyObject* coords);
 PyObject* wxPyDrawXXXList(wxDC& dc, wxPyDrawListOp_t doDraw,
                           PyObject* pyCoords, PyObject* pyPens, PyObject* pyBrushes);
index caab3a90241124fceadd2485e1c030f0679d76a2..b4a7f8475042fd42b3c8988737cab34575984c66 100644 (file)
@@ -29,6 +29,7 @@
 #include <wx/dcps.h>
 #include <wx/dirctrl.h>
 #include <wx/dirdlg.h>
+#include <wx/dnd.h>
 #include <wx/docview.h>
 #include <wx/encconv.h>
 #include <wx/fdrepdlg.h>
diff --git a/wxPython/src/_calendar_reverse.txt b/wxPython/src/_calendar_reverse.txt
new file mode 100644 (file)
index 0000000..a8de5cf
--- /dev/null
@@ -0,0 +1,3 @@
+
+
+EVT*
index 1142cb30fb2901fd662e4287923d65eed8aad09b..6a2dfbd7423e2894960ee3e4b59a568060771914 100644 (file)
 //---------------------------------------------------------------------------
 
 
-%typemap(in) wxDateTime::TimeZone& {
+%typemap(in) wxDateTime::TimeZone& (bool temp=False) {
     $1 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong($input));
+    temp = True;
 }
 %typemap(python,freearg) wxDateTime::TimeZone& {
-    if ($1) delete $1;
+    if (temp$argnum) delete $1;
 }
 
 
index 4c993687548751d251e0f8cf38a704c5830395d5..8e2ce47ab7b94f001ee1641744fcbc96c4abf64a 100644 (file)
@@ -16,7 +16,6 @@
 //---------------------------------------------------------------------------
 
 %{
-#include <wx/dnd.h>
 %}
 
 //---------------------------------------------------------------------------
@@ -55,29 +54,7 @@ bool wxIsDragResultOk(wxDragResult res);
 
 
 %{
-class wxPyDropSource : public wxDropSource {
-public:
-#ifndef __WXGTK__
-     wxPyDropSource(wxWindow *win = NULL,
-                    const wxCursor &copy = wxNullCursor,
-                    const wxCursor &move = wxNullCursor,
-                    const wxCursor &none = wxNullCursor)
-         : wxDropSource(win, copy, move, none) {}
-#else
-    wxPyDropSource(wxWindow *win = NULL,
-                   const wxIcon& copy = wxNullIcon,
-                   const wxIcon& move = wxNullIcon,
-                   const wxIcon& none = wxNullIcon)
-        : wxDropSource(win, copy, move, none) {}
-#endif
-    ~wxPyDropSource() { }
-
-    DEC_PYCALLBACK_BOOL_DR(GiveFeedback);
-    PYPRIVATE;
-};
-
 IMP_PYCALLBACK_BOOL_DR(wxPyDropSource, wxDropSource, GiveFeedback);
-
 %}
 
 
@@ -133,43 +110,11 @@ public:
 
 
 %{
-class wxPyDropTarget : public wxDropTarget {
-public:
-    wxPyDropTarget(wxDataObject *dataObject = NULL)
-        : wxDropTarget(dataObject) {}
-
-    // called when mouse leaves the window: might be used to remove the
-    // feedback which was given in OnEnter()
-    DEC_PYCALLBACK__(OnLeave);
-
-    // called when the mouse enters the window (only once until OnLeave())
-    DEC_PYCALLBACK_DR_2WXCDR(OnEnter);
-
-    // called when the mouse moves in the window - shouldn't take long to
-    // execute or otherwise mouse movement would be too slow
-    DEC_PYCALLBACK_DR_2WXCDR(OnDragOver);
-    
-    // called after OnDrop() returns True: you will usually just call
-    // GetData() from here and, probably, also refresh something to update the
-    // new data and, finally, return the code indicating how did the operation
-    // complete (returning default value in case of success and wxDragError on
-    // failure is usually ok)
-    DEC_PYCALLBACK_DR_2WXCDR_pure(OnData);
-    
-    // this function is called when data is dropped at position (x, y) - if it
-    // returns True, OnData() will be called immediately afterwards which will
-    // allow to retrieve the data dropped.
-    DEC_PYCALLBACK_BOOL_INTINT(OnDrop);
-
-    PYPRIVATE;
-};
-
 IMP_PYCALLBACK__(wxPyDropTarget, wxDropTarget, OnLeave);
 IMP_PYCALLBACK_DR_2WXCDR(wxPyDropTarget, wxDropTarget, OnEnter);
 IMP_PYCALLBACK_DR_2WXCDR(wxPyDropTarget, wxDropTarget, OnDragOver);
 IMP_PYCALLBACK_DR_2WXCDR_pure(wxPyDropTarget, wxDropTarget, OnData);
 IMP_PYCALLBACK_BOOL_INTINT(wxPyDropTarget, wxDropTarget, OnDrop);
-
 %}
 
 
index 360970e3fafb221d69b1d33c9aeec0db461fcfca..48ef90034fc0e40a5250ccaaa23405b99780e714 100644 (file)
@@ -59,8 +59,14 @@ public:
     virtual void SetStatusWidths(int widths, const int* widths_field); // uses typemap in _toplvl.i
 
     // Get the position and size of the field's internal bounding rectangle
-    virtual bool GetFieldRect(int i, wxRect& rect) const;
-
+    %extend {
+        wxRect GetFieldRect(int i) {
+            wxRect r;
+            self->GetFieldRect(i, r);
+            return r;
+        }
+    }
+    
     // sets the minimal vertical size of the status bar
     virtual void SetMinHeight(int height);
 
index baeb1f197ae403dab1991bf0e2677e71b324bdec..6d669bc44f4dc16ce39287a331cf42b2f7a423ee 100644 (file)
@@ -40,6 +40,7 @@ IMP_PYCALLBACK__(wxPyTimer, wxTimer, Notify);
 %name(Timer) class wxPyTimer : public wxEvtHandler
 {
 public:
+    %addtofunc wxPyTimer         "self._setCallbackInfo(self, Timer)"
 
     // if you don't call SetOwner() or provide an owner in the contstructor
     // then you must override Notify() inorder to receive the timer
@@ -48,6 +49,8 @@ public:
     wxPyTimer(wxEvtHandler *owner=NULL, int id = -1);
     virtual ~wxPyTimer();
 
+    void _setCallbackInfo(PyObject* self, PyObject* _class);
+
     // Set the owner instance that will receive the EVT_TIMER events using the
     // given id.
     void SetOwner(wxEvtHandler *owner, int id = -1);
@@ -65,7 +68,7 @@ public:
 
     // override this in your wxTimer-derived class if you want to process timer
     // messages in it, use non default ctor or SetOwner() otherwise
-    virtual void Notify();
+    //virtual void Notify();
 
     // return True if the timer is running
     virtual bool IsRunning() const;
index e0f5229c7d0f724685e8415dc0bc55d9807348a7..5c0cf3a0e1fc9a644a35bf2c5603a3e4a5fb98f7 100644 (file)
@@ -682,8 +682,8 @@ public:
     // set/retrieve the drop target associated with this window (may be
     // NULL; it's owned by the window and will be deleted by it)
     %addtofunc SetDropTarget "args[1].thisown = 0"
-    virtual void SetDropTarget( wxDropTarget *dropTarget );
-    virtual wxDropTarget *GetDropTarget() const;
+    virtual void SetDropTarget( wxPyDropTarget *dropTarget );
+    virtual wxPyDropTarget *GetDropTarget() const;
 
 #ifdef __WXMSW__  // TODO:  should I drop-kick this?
     void DragAcceptFiles(bool accept);
index d2e926204d17afae3c7d432a5354b4f189a12399..0ec57b0ec5d5efb51bf622721466805173e6e422 100644 (file)
 #include "wx/wxPython/pydrawxxx.h"
 
 
-//----------------------------------------------------------------------
+//---------------------------------------------------------------------------
 
 
+// Called from _gdiinit so we can do the API import while the GIL is held
+void wxPyDrawList_SetAPIPtr()
+{
+    wxPyCoreAPI_IMPORT();
+}
 
-PyObject* wxPyDrawXXXList(wxDC& dc, wxPyDrawListOp_t doDraw,
-                          PyObject* pyCoords, PyObject* pyPens, PyObject* pyBrushes) {
 
+PyObject* wxPyDrawXXXList(wxDC& dc, wxPyDrawListOp_t doDraw,
+                          PyObject* pyCoords, PyObject* pyPens, PyObject* pyBrushes)
+{
     wxPyBeginBlockThreads(); 
 
-    if ( !wxPyCoreAPIPtr)
-        wxPyCoreAPI_IMPORT();
-    
     bool      isFastSeq  = PyList_Check(pyCoords) || PyTuple_Check(pyCoords);
     bool      isFastPens = PyList_Check(pyPens) || PyTuple_Check(pyPens);
     bool      isFastBrushes = PyList_Check(pyBrushes) || PyTuple_Check(pyBrushes);
@@ -141,7 +144,8 @@ PyObject* wxPyDrawXXXList(wxDC& dc, wxPyDrawListOp_t doDraw,
 
 
 
-bool wxPyDrawXXXPoint(wxDC& dc, PyObject* coords) {
+bool wxPyDrawXXXPoint(wxDC& dc, PyObject* coords)
+{
     int x, y;
 
     if (! wxPy2int_seq_helper(coords, &x, &y)) {
@@ -152,7 +156,8 @@ bool wxPyDrawXXXPoint(wxDC& dc, PyObject* coords) {
     return True;
 }
 
-bool wxPyDrawXXXLine(wxDC& dc, PyObject* coords) {
+bool wxPyDrawXXXLine(wxDC& dc, PyObject* coords)
+{
     int x1, y1, x2, y2;
 
     if (! wxPy4int_seq_helper(coords, &x1, &y1, &x2, &y2)) {
@@ -163,7 +168,8 @@ bool wxPyDrawXXXLine(wxDC& dc, PyObject* coords) {
     return True;
 }
 
-bool wxPyDrawXXXRectangle(wxDC& dc, PyObject* coords) {
+bool wxPyDrawXXXRectangle(wxDC& dc, PyObject* coords)
+{
     int x, y, w, h;
 
     if (! wxPy4int_seq_helper(coords, &x, &y, &w, &h)) {
@@ -174,7 +180,8 @@ bool wxPyDrawXXXRectangle(wxDC& dc, PyObject* coords) {
     return True;
 }
 
-bool wxPyDrawXXXEllipse(wxDC& dc, PyObject* coords) {
+bool wxPyDrawXXXEllipse(wxDC& dc, PyObject* coords)
+{
     int x, y, w, h;
 
     if (! wxPy4int_seq_helper(coords, &x, &y, &w, &h)) {
@@ -186,7 +193,8 @@ bool wxPyDrawXXXEllipse(wxDC& dc, PyObject* coords) {
 }
 
 
-bool wxPyDrawXXXPolygon(wxDC& dc, PyObject* coords) {
+bool wxPyDrawXXXPolygon(wxDC& dc, PyObject* coords)
+{
     wxPoint* points;
     int numPoints;
 
@@ -200,16 +208,14 @@ bool wxPyDrawXXXPolygon(wxDC& dc, PyObject* coords) {
 }
 
 
-//----------------------------------------------------------------------
+//---------------------------------------------------------------------------
 
 
 
-PyObject* wxPyDrawTextList(wxDC& dc, PyObject* textList, PyObject* pyPoints, PyObject* foregroundList, PyObject* backgroundList) {
+PyObject* wxPyDrawTextList(wxDC& dc, PyObject* textList, PyObject* pyPoints, PyObject* foregroundList, PyObject* backgroundList)
+{
     wxPyBeginBlockThreads();
 
-    if ( !wxPyCoreAPIPtr)
-        wxPyCoreAPI_IMPORT();
-    
     bool      isFastSeq  = PyList_Check(pyPoints) || PyTuple_Check(pyPoints);
     bool      isFastText = PyList_Check(textList) || PyTuple_Check(textList);
     bool      isFastForeground = PyList_Check(foregroundList) || PyTuple_Check(foregroundList);
@@ -353,4 +359,4 @@ PyObject* wxPyDrawTextList(wxDC& dc, PyObject* textList, PyObject* pyPoints, PyO
 
 
 
-//----------------------------------------------------------------------
+//---------------------------------------------------------------------------
index 75400d5a21f83873aca9255da7ee5ee2ceb22e9f..c622181a4f921d61b6c0329e11f2c301f6f4458a 100644 (file)
@@ -51,4 +51,9 @@
 
 
 //---------------------------------------------------------------------------
+%init %{
+    // Work around a chicken/egg problem in drawlist.cpp
+    wxPyDrawList_SetAPIPtr();
+%}
+
 //---------------------------------------------------------------------------
index dd116ffd2ff2ef2aaf9e6061b5f01d65eeb607e5..a689b9af833a9de33309d676caa8c3eb8c18876c 100644 (file)
@@ -952,8 +952,8 @@ class wxGridCellChoiceEditor : public wxGridCellEditor
 {
 public:
     %addtofunc wxGridCellChoiceEditor  "self._setOORInfo(self)"
-    wxGridCellChoiceEditor(int LCOUNT = 0,
-                           const wxString* choices = NULL,
+    wxGridCellChoiceEditor(int choices = 0,
+                           const wxString* choices_array = NULL,
                            bool allowOthers = False);
     virtual wxString GetValue();
 };
index 20a8174624e670a00a05da0a3d535260add60717..4c89e589a6716f6013ccf2ed23ebe0f4382a3fd6 100644 (file)
@@ -5728,13 +5728,13 @@ Get the width, height, decent and leading of the text using the current or speci
         return _core.Window_GetToolTip(*args, **kwargs)
 
     def SetDropTarget(*args, **kwargs):
-        """SetDropTarget(wxDropTarget dropTarget)"""
+        """SetDropTarget(wxPyDropTarget dropTarget)"""
         val = _core.Window_SetDropTarget(*args, **kwargs)
         args[1].thisown = 0
         return val
 
     def GetDropTarget(*args, **kwargs):
-        """GetDropTarget() -> wxDropTarget"""
+        """GetDropTarget() -> wxPyDropTarget"""
         return _core.Window_GetDropTarget(*args, **kwargs)
 
     def SetConstraints(*args, **kwargs):
index 1168c5ac9557795f31a89331bcb9500f4fe85cc8..6aee253f778c033f0c4bdbe100822bc8e4311628 100644 (file)
@@ -321,7 +321,7 @@ SWIGEXPORT(void)              SWIG_Python_InstallConstants(PyObject *d, swig_con
 #define  SWIGTYPE_p_wxPyApp swig_types[103] 
 #define  SWIGTYPE_p_wxCommandEvent swig_types[104] 
 #define  SWIGTYPE_p_wxPyCommandEvent swig_types[105] 
-#define  SWIGTYPE_p_wxDropTarget swig_types[106] 
+#define  SWIGTYPE_p_wxPyDropTarget swig_types[106] 
 #define  SWIGTYPE_p_wxChildFocusEvent swig_types[107] 
 #define  SWIGTYPE_p_wxFocusEvent swig_types[108] 
 #define  SWIGTYPE_p_wxDropFilesEvent swig_types[109] 
@@ -23640,7 +23640,7 @@ static PyObject *_wrap_Window_GetToolTip(PyObject *self, PyObject *args, PyObjec
 static PyObject *_wrap_Window_SetDropTarget(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxWindow *arg1 = (wxWindow *) 0 ;
-    wxDropTarget *arg2 = (wxDropTarget *) 0 ;
+    wxPyDropTarget *arg2 = (wxPyDropTarget *) 0 ;
     PyObject * obj0 = 0 ;
     PyObject * obj1 = 0 ;
     char *kwnames[] = {
@@ -23649,7 +23649,7 @@ static PyObject *_wrap_Window_SetDropTarget(PyObject *self, PyObject *args, PyOb
     
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Window_SetDropTarget",kwnames,&obj0,&obj1)) goto fail;
     if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxWindow,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
-    if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxDropTarget,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
+    if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxPyDropTarget,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
     {
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         (arg1)->SetDropTarget(arg2);
@@ -23667,7 +23667,7 @@ static PyObject *_wrap_Window_SetDropTarget(PyObject *self, PyObject *args, PyOb
 static PyObject *_wrap_Window_GetDropTarget(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxWindow *arg1 = (wxWindow *) 0 ;
-    wxDropTarget *result;
+    wxPyDropTarget *result;
     PyObject * obj0 = 0 ;
     char *kwnames[] = {
         (char *) "self", NULL 
@@ -23677,12 +23677,12 @@ static PyObject *_wrap_Window_GetDropTarget(PyObject *self, PyObject *args, PyOb
     if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxWindow,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
     {
         PyThreadState* __tstate = wxPyBeginAllowThreads();
-        result = (wxDropTarget *)((wxWindow const *)arg1)->GetDropTarget();
+        result = (wxPyDropTarget *)((wxWindow const *)arg1)->GetDropTarget();
         
         wxPyEndAllowThreads(__tstate);
         if (PyErr_Occurred()) SWIG_fail;
     }
-    resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxDropTarget, 0);
+    resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxPyDropTarget, 0);
     return resultobj;
     fail:
     return NULL;
@@ -36740,7 +36740,7 @@ static swig_type_info _swigt__p_wxMouseEvent[] = {{"_p_wxMouseEvent", 0, "wxMous
 static swig_type_info _swigt__p_wxPyApp[] = {{"_p_wxPyApp", 0, "wxPyApp *", 0},{"_p_wxPyApp"},{0}};
 static swig_type_info _swigt__p_wxCommandEvent[] = {{"_p_wxCommandEvent", 0, "wxCommandEvent *", 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxCommandEvent},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxCommandEvent},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxCommandEvent},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxCommandEvent},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxCommandEvent},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxCommandEvent},{"_p_wxCommandEvent"},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxCommandEvent},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxCommandEvent},{0}};
 static swig_type_info _swigt__p_wxPyCommandEvent[] = {{"_p_wxPyCommandEvent", 0, "wxPyCommandEvent *", 0},{"_p_wxPyCommandEvent"},{0}};
-static swig_type_info _swigt__p_wxDropTarget[] = {{"_p_wxDropTarget", 0, "wxDropTarget *", 0},{"_p_wxDropTarget"},{0}};
+static swig_type_info _swigt__p_wxPyDropTarget[] = {{"_p_wxPyDropTarget", 0, "wxPyDropTarget *", 0},{"_p_wxPyDropTarget"},{0}};
 static swig_type_info _swigt__p_wxChildFocusEvent[] = {{"_p_wxChildFocusEvent", 0, "wxChildFocusEvent *", 0},{"_p_wxChildFocusEvent"},{0}};
 static swig_type_info _swigt__p_wxFocusEvent[] = {{"_p_wxFocusEvent", 0, "wxFocusEvent *", 0},{"_p_wxFocusEvent"},{0}};
 static swig_type_info _swigt__p_wxDropFilesEvent[] = {{"_p_wxDropFilesEvent", 0, "wxDropFilesEvent *", 0},{"_p_wxDropFilesEvent"},{0}};
@@ -36856,7 +36856,7 @@ _swigt__p_wxMouseEvent,
 _swigt__p_wxPyApp, 
 _swigt__p_wxCommandEvent, 
 _swigt__p_wxPyCommandEvent, 
-_swigt__p_wxDropTarget, 
+_swigt__p_wxPyDropTarget, 
 _swigt__p_wxChildFocusEvent, 
 _swigt__p_wxFocusEvent, 
 _swigt__p_wxDropFilesEvent, 
index 6919c622531e62ea0aafb445a371bfaf1823b5f5..5d440526248f81b4565596f19e220a82c51c6265 100644 (file)
@@ -17189,5 +17189,9 @@ SWIGEXPORT(void) SWIG_init(void) {
     SWIG_addvarlink(SWIG_globals,(char*)"ThePenList",_wrap_ThePenList_get, _wrap_ThePenList_set);
     SWIG_addvarlink(SWIG_globals,(char*)"TheBrushList",_wrap_TheBrushList_get, _wrap_TheBrushList_set);
     SWIG_addvarlink(SWIG_globals,(char*)"TheColourDatabase",_wrap_TheColourDatabase_get, _wrap_TheColourDatabase_set);
+    
+    // Work around a chicken/egg problem in drawlist.cpp
+    wxPyDrawList_SetAPIPtr();
+    
 }
 
index 0044eaea6f4cc6f667d43eff83bea8cf9d152e88..0cc50a9b02b041599f894c1a305635d793ad1a6a 100644 (file)
@@ -506,7 +506,7 @@ class GridCellChoiceEditor(GridCellEditor):
     def __repr__(self):
         return "<%s.%s; proxy of C++ wxGridCellChoiceEditor instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
     def __init__(self, *args, **kwargs):
-        """__init__(int LCOUNT=0, wxString choices=None, bool allowOthers=False) -> GridCellChoiceEditor"""
+        """__init__(int choices=0, wxString choices_array=None, bool allowOthers=False) -> GridCellChoiceEditor"""
         newobj = _grid.new_GridCellChoiceEditor(*args, **kwargs)
         self.this = newobj.this
         self.thisown = 1
index 5b4ded6275a47c5911a2d2619ddb5cbd59e82c79..91918b230ebb43afc8abbfe99dde022cfc08af0d 100644 (file)
@@ -3151,18 +3151,22 @@ static PyObject *_wrap_new_GridCellChoiceEditor(PyObject *self, PyObject *args,
     wxString *arg2 = (wxString *) NULL ;
     bool arg3 = (bool) False ;
     wxGridCellChoiceEditor *result;
+    PyObject * obj0 = 0 ;
     PyObject * obj1 = 0 ;
-    PyObject * obj2 = 0 ;
     char *kwnames[] = {
-        (char *) "LCOUNT",(char *) "choices",(char *) "allowOthers", NULL 
+        (char *) "choices",(char *) "allowOthers", NULL 
     };
     
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"|iOO:new_GridCellChoiceEditor",kwnames,&arg1,&obj1,&obj2)) goto fail;
-    if (obj1) {
-        if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxString,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"|OO:new_GridCellChoiceEditor",kwnames,&obj0,&obj1)) goto fail;
+    if (obj0) {
+        {
+            arg1 = PyList_Size(obj0);
+            arg2 = wxString_LIST_helper(obj0);
+            if (arg2 == NULL) SWIG_fail;
+        }
     }
-    if (obj2) {
-        arg3 = PyInt_AsLong(obj2) ? true : false;
+    if (obj1) {
+        arg3 = PyInt_AsLong(obj1) ? true : false;
         if (PyErr_Occurred()) SWIG_fail;
     }
     {
@@ -3173,8 +3177,14 @@ static PyObject *_wrap_new_GridCellChoiceEditor(PyObject *self, PyObject *args,
         if (PyErr_Occurred()) SWIG_fail;
     }
     resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxGridCellChoiceEditor, 1);
+    {
+        if (arg2) delete [] arg2;
+    }
     return resultobj;
     fail:
+    {
+        if (arg2) delete [] arg2;
+    }
     return NULL;
 }
 
index 4248ed8d01d7e12b2dfbd3bfd429debc824e0089..07acb98b3b5b01d65ee7a0faa3577fb0c92db0bf 100644 (file)
@@ -935,12 +935,18 @@ class Timer(core.EvtHandler):
         self.this = newobj.this
         self.thisown = 1
         del newobj.thisown
+        self._setCallbackInfo(self, Timer)
+
     def __del__(self, destroy=_misc.delete_Timer):
         """__del__()"""
         try:
             if self.thisown: destroy(self)
         except: pass
 
+    def _setCallbackInfo(*args, **kwargs):
+        """_setCallbackInfo(PyObject self, PyObject _class)"""
+        return _misc.Timer__setCallbackInfo(*args, **kwargs)
+
     def SetOwner(*args, **kwargs):
         """SetOwner(EvtHandler owner, int id=-1)"""
         return _misc.Timer_SetOwner(*args, **kwargs)
@@ -953,10 +959,6 @@ class Timer(core.EvtHandler):
         """Stop()"""
         return _misc.Timer_Stop(*args, **kwargs)
 
-    def Notify(*args, **kwargs):
-        """Notify()"""
-        return _misc.Timer_Notify(*args, **kwargs)
-
     def IsRunning(*args, **kwargs):
         """IsRunning() -> bool"""
         return _misc.Timer_IsRunning(*args, **kwargs)
index accb86b78fa49b7c437644ebf0cdf8a4806ba89b..6233be06a901a53a7594c20a5361890e6c8b25b4 100644 (file)
@@ -1058,65 +1058,11 @@ public:
 };    
 
 
-#include <wx/dnd.h>
 
 
-class wxPyDropSource : public wxDropSource {
-public:
-#ifndef __WXGTK__
-     wxPyDropSource(wxWindow *win = NULL,
-                    const wxCursor &copy = wxNullCursor,
-                    const wxCursor &move = wxNullCursor,
-                    const wxCursor &none = wxNullCursor)
-         : wxDropSource(win, copy, move, none) {}
-#else
-    wxPyDropSource(wxWindow *win = NULL,
-                   const wxIcon& copy = wxNullIcon,
-                   const wxIcon& move = wxNullIcon,
-                   const wxIcon& none = wxNullIcon)
-        : wxDropSource(win, copy, move, none) {}
-#endif
-    ~wxPyDropSource() { }
-
-    DEC_PYCALLBACK_BOOL_DR(GiveFeedback);
-    PYPRIVATE;
-};
-
 IMP_PYCALLBACK_BOOL_DR(wxPyDropSource, wxDropSource, GiveFeedback);
 
 
-
-class wxPyDropTarget : public wxDropTarget {
-public:
-    wxPyDropTarget(wxDataObject *dataObject = NULL)
-        : wxDropTarget(dataObject) {}
-
-    // called when mouse leaves the window: might be used to remove the
-    // feedback which was given in OnEnter()
-    DEC_PYCALLBACK__(OnLeave);
-
-    // called when the mouse enters the window (only once until OnLeave())
-    DEC_PYCALLBACK_DR_2WXCDR(OnEnter);
-
-    // called when the mouse moves in the window - shouldn't take long to
-    // execute or otherwise mouse movement would be too slow
-    DEC_PYCALLBACK_DR_2WXCDR(OnDragOver);
-    
-    // called after OnDrop() returns True: you will usually just call
-    // GetData() from here and, probably, also refresh something to update the
-    // new data and, finally, return the code indicating how did the operation
-    // complete (returning default value in case of success and wxDragError on
-    // failure is usually ok)
-    DEC_PYCALLBACK_DR_2WXCDR_pure(OnData);
-    
-    // this function is called when data is dropped at position (x, y) - if it
-    // returns True, OnData() will be called immediately afterwards which will
-    // allow to retrieve the data dropped.
-    DEC_PYCALLBACK_BOOL_INTINT(OnDrop);
-
-    PYPRIVATE;
-};
-
 IMP_PYCALLBACK__(wxPyDropTarget, wxDropTarget, OnLeave);
 IMP_PYCALLBACK_DR_2WXCDR(wxPyDropTarget, wxDropTarget, OnEnter);
 IMP_PYCALLBACK_DR_2WXCDR(wxPyDropTarget, wxDropTarget, OnDragOver);
@@ -1124,7 +1070,6 @@ IMP_PYCALLBACK_DR_2WXCDR_pure(wxPyDropTarget, wxDropTarget, OnData);
 IMP_PYCALLBACK_BOOL_INTINT(wxPyDropTarget, wxDropTarget, OnDrop);
 
 
-
 class wxPyTextDropTarget : public wxTextDropTarget {
 public:
     wxPyTextDropTarget() {}
@@ -5706,6 +5651,36 @@ static PyObject *_wrap_delete_Timer(PyObject *self, PyObject *args, PyObject *kw
 }
 
 
+static PyObject *_wrap_Timer__setCallbackInfo(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxPyTimer *arg1 = (wxPyTimer *) 0 ;
+    PyObject *arg2 = (PyObject *) 0 ;
+    PyObject *arg3 = (PyObject *) 0 ;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    PyObject * obj2 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "self",(char *) "_class", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Timer__setCallbackInfo",kwnames,&obj0,&obj1,&obj2)) goto fail;
+    if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxPyTimer,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
+    arg2 = obj1;
+    arg3 = obj2;
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        (arg1)->_setCallbackInfo(arg2,arg3);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    Py_INCREF(Py_None); resultobj = Py_None;
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_Timer_SetOwner(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxPyTimer *arg1 = (wxPyTimer *) 0 ;
@@ -5790,30 +5765,6 @@ static PyObject *_wrap_Timer_Stop(PyObject *self, PyObject *args, PyObject *kwar
 }
 
 
-static PyObject *_wrap_Timer_Notify(PyObject *self, PyObject *args, PyObject *kwargs) {
-    PyObject *resultobj;
-    wxPyTimer *arg1 = (wxPyTimer *) 0 ;
-    PyObject * obj0 = 0 ;
-    char *kwnames[] = {
-        (char *) "self", NULL 
-    };
-    
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Timer_Notify",kwnames,&obj0)) goto fail;
-    if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxPyTimer,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
-    {
-        PyThreadState* __tstate = wxPyBeginAllowThreads();
-        (arg1)->Notify();
-        
-        wxPyEndAllowThreads(__tstate);
-        if (PyErr_Occurred()) SWIG_fail;
-    }
-    Py_INCREF(Py_None); resultobj = Py_None;
-    return resultobj;
-    fail:
-    return NULL;
-}
-
-
 static PyObject *_wrap_Timer_IsRunning(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxPyTimer *arg1 = (wxPyTimer *) 0 ;
@@ -16673,6 +16624,7 @@ static PyObject *_wrap_DateTime_ToTimezone(PyObject *self, PyObject *args, PyObj
     wxDateTime::TimeZone *arg2 = 0 ;
     bool arg3 = (bool) False ;
     wxDateTime result;
+    bool temp2 = False ;
     PyObject * obj0 = 0 ;
     PyObject * obj1 = 0 ;
     PyObject * obj2 = 0 ;
@@ -16684,6 +16636,7 @@ static PyObject *_wrap_DateTime_ToTimezone(PyObject *self, PyObject *args, PyObj
     if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
     {
         arg2 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(obj1));
+        temp2 = True;
     }
     if (obj2) {
         arg3 = PyInt_AsLong(obj2) ? true : false;
@@ -16702,12 +16655,12 @@ static PyObject *_wrap_DateTime_ToTimezone(PyObject *self, PyObject *args, PyObj
         resultobj = SWIG_NewPointerObj((void *) resultptr, SWIGTYPE_p_wxDateTime, 1);
     }
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return resultobj;
     fail:
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return NULL;
 }
@@ -16719,6 +16672,7 @@ static PyObject *_wrap_DateTime_MakeTimezone(PyObject *self, PyObject *args, PyO
     wxDateTime::TimeZone *arg2 = 0 ;
     bool arg3 = (bool) False ;
     wxDateTime *result;
+    bool temp2 = False ;
     PyObject * obj0 = 0 ;
     PyObject * obj1 = 0 ;
     PyObject * obj2 = 0 ;
@@ -16730,6 +16684,7 @@ static PyObject *_wrap_DateTime_MakeTimezone(PyObject *self, PyObject *args, PyO
     if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
     {
         arg2 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(obj1));
+        temp2 = True;
     }
     if (obj2) {
         arg3 = PyInt_AsLong(obj2) ? true : false;
@@ -16747,12 +16702,12 @@ static PyObject *_wrap_DateTime_MakeTimezone(PyObject *self, PyObject *args, PyO
     }
     resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxDateTime, 0);
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return resultobj;
     fail:
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return NULL;
 }
@@ -16909,6 +16864,7 @@ static PyObject *_wrap_DateTime_GetYear(PyObject *self, PyObject *args, PyObject
     wxDateTime::TimeZone const &arg2_defvalue = LOCAL_TZ ;
     wxDateTime::TimeZone *arg2 = (wxDateTime::TimeZone *) &arg2_defvalue ;
     int result;
+    bool temp2 = False ;
     PyObject * obj0 = 0 ;
     PyObject * obj1 = 0 ;
     char *kwnames[] = {
@@ -16920,6 +16876,7 @@ static PyObject *_wrap_DateTime_GetYear(PyObject *self, PyObject *args, PyObject
     if (obj1) {
         {
             arg2 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(obj1));
+            temp2 = True;
         }
     }
     {
@@ -16931,12 +16888,12 @@ static PyObject *_wrap_DateTime_GetYear(PyObject *self, PyObject *args, PyObject
     }
     resultobj = PyInt_FromLong((long)result);
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return resultobj;
     fail:
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return NULL;
 }
@@ -16948,6 +16905,7 @@ static PyObject *_wrap_DateTime_GetMonth(PyObject *self, PyObject *args, PyObjec
     wxDateTime::TimeZone const &arg2_defvalue = LOCAL_TZ ;
     wxDateTime::TimeZone *arg2 = (wxDateTime::TimeZone *) &arg2_defvalue ;
     int result;
+    bool temp2 = False ;
     PyObject * obj0 = 0 ;
     PyObject * obj1 = 0 ;
     char *kwnames[] = {
@@ -16959,6 +16917,7 @@ static PyObject *_wrap_DateTime_GetMonth(PyObject *self, PyObject *args, PyObjec
     if (obj1) {
         {
             arg2 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(obj1));
+            temp2 = True;
         }
     }
     {
@@ -16970,12 +16929,12 @@ static PyObject *_wrap_DateTime_GetMonth(PyObject *self, PyObject *args, PyObjec
     }
     resultobj = PyInt_FromLong((long)result);
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return resultobj;
     fail:
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return NULL;
 }
@@ -16987,6 +16946,7 @@ static PyObject *_wrap_DateTime_GetDay(PyObject *self, PyObject *args, PyObject
     wxDateTime::TimeZone const &arg2_defvalue = LOCAL_TZ ;
     wxDateTime::TimeZone *arg2 = (wxDateTime::TimeZone *) &arg2_defvalue ;
     int result;
+    bool temp2 = False ;
     PyObject * obj0 = 0 ;
     PyObject * obj1 = 0 ;
     char *kwnames[] = {
@@ -16998,6 +16958,7 @@ static PyObject *_wrap_DateTime_GetDay(PyObject *self, PyObject *args, PyObject
     if (obj1) {
         {
             arg2 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(obj1));
+            temp2 = True;
         }
     }
     {
@@ -17009,12 +16970,12 @@ static PyObject *_wrap_DateTime_GetDay(PyObject *self, PyObject *args, PyObject
     }
     resultobj = PyInt_FromLong((long)result);
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return resultobj;
     fail:
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return NULL;
 }
@@ -17026,6 +16987,7 @@ static PyObject *_wrap_DateTime_GetWeekDay(PyObject *self, PyObject *args, PyObj
     wxDateTime::TimeZone const &arg2_defvalue = LOCAL_TZ ;
     wxDateTime::TimeZone *arg2 = (wxDateTime::TimeZone *) &arg2_defvalue ;
     int result;
+    bool temp2 = False ;
     PyObject * obj0 = 0 ;
     PyObject * obj1 = 0 ;
     char *kwnames[] = {
@@ -17037,6 +16999,7 @@ static PyObject *_wrap_DateTime_GetWeekDay(PyObject *self, PyObject *args, PyObj
     if (obj1) {
         {
             arg2 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(obj1));
+            temp2 = True;
         }
     }
     {
@@ -17048,12 +17011,12 @@ static PyObject *_wrap_DateTime_GetWeekDay(PyObject *self, PyObject *args, PyObj
     }
     resultobj = PyInt_FromLong((long)result);
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return resultobj;
     fail:
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return NULL;
 }
@@ -17065,6 +17028,7 @@ static PyObject *_wrap_DateTime_GetHour(PyObject *self, PyObject *args, PyObject
     wxDateTime::TimeZone const &arg2_defvalue = LOCAL_TZ ;
     wxDateTime::TimeZone *arg2 = (wxDateTime::TimeZone *) &arg2_defvalue ;
     int result;
+    bool temp2 = False ;
     PyObject * obj0 = 0 ;
     PyObject * obj1 = 0 ;
     char *kwnames[] = {
@@ -17076,6 +17040,7 @@ static PyObject *_wrap_DateTime_GetHour(PyObject *self, PyObject *args, PyObject
     if (obj1) {
         {
             arg2 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(obj1));
+            temp2 = True;
         }
     }
     {
@@ -17087,12 +17052,12 @@ static PyObject *_wrap_DateTime_GetHour(PyObject *self, PyObject *args, PyObject
     }
     resultobj = PyInt_FromLong((long)result);
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return resultobj;
     fail:
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return NULL;
 }
@@ -17104,6 +17069,7 @@ static PyObject *_wrap_DateTime_GetMinute(PyObject *self, PyObject *args, PyObje
     wxDateTime::TimeZone const &arg2_defvalue = LOCAL_TZ ;
     wxDateTime::TimeZone *arg2 = (wxDateTime::TimeZone *) &arg2_defvalue ;
     int result;
+    bool temp2 = False ;
     PyObject * obj0 = 0 ;
     PyObject * obj1 = 0 ;
     char *kwnames[] = {
@@ -17115,6 +17081,7 @@ static PyObject *_wrap_DateTime_GetMinute(PyObject *self, PyObject *args, PyObje
     if (obj1) {
         {
             arg2 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(obj1));
+            temp2 = True;
         }
     }
     {
@@ -17126,12 +17093,12 @@ static PyObject *_wrap_DateTime_GetMinute(PyObject *self, PyObject *args, PyObje
     }
     resultobj = PyInt_FromLong((long)result);
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return resultobj;
     fail:
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return NULL;
 }
@@ -17143,6 +17110,7 @@ static PyObject *_wrap_DateTime_GetSecond(PyObject *self, PyObject *args, PyObje
     wxDateTime::TimeZone const &arg2_defvalue = LOCAL_TZ ;
     wxDateTime::TimeZone *arg2 = (wxDateTime::TimeZone *) &arg2_defvalue ;
     int result;
+    bool temp2 = False ;
     PyObject * obj0 = 0 ;
     PyObject * obj1 = 0 ;
     char *kwnames[] = {
@@ -17154,6 +17122,7 @@ static PyObject *_wrap_DateTime_GetSecond(PyObject *self, PyObject *args, PyObje
     if (obj1) {
         {
             arg2 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(obj1));
+            temp2 = True;
         }
     }
     {
@@ -17165,12 +17134,12 @@ static PyObject *_wrap_DateTime_GetSecond(PyObject *self, PyObject *args, PyObje
     }
     resultobj = PyInt_FromLong((long)result);
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return resultobj;
     fail:
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return NULL;
 }
@@ -17182,6 +17151,7 @@ static PyObject *_wrap_DateTime_GetMillisecond(PyObject *self, PyObject *args, P
     wxDateTime::TimeZone const &arg2_defvalue = LOCAL_TZ ;
     wxDateTime::TimeZone *arg2 = (wxDateTime::TimeZone *) &arg2_defvalue ;
     int result;
+    bool temp2 = False ;
     PyObject * obj0 = 0 ;
     PyObject * obj1 = 0 ;
     char *kwnames[] = {
@@ -17193,6 +17163,7 @@ static PyObject *_wrap_DateTime_GetMillisecond(PyObject *self, PyObject *args, P
     if (obj1) {
         {
             arg2 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(obj1));
+            temp2 = True;
         }
     }
     {
@@ -17204,12 +17175,12 @@ static PyObject *_wrap_DateTime_GetMillisecond(PyObject *self, PyObject *args, P
     }
     resultobj = PyInt_FromLong((long)result);
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return resultobj;
     fail:
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return NULL;
 }
@@ -17221,6 +17192,7 @@ static PyObject *_wrap_DateTime_GetDayOfYear(PyObject *self, PyObject *args, PyO
     wxDateTime::TimeZone const &arg2_defvalue = LOCAL_TZ ;
     wxDateTime::TimeZone *arg2 = (wxDateTime::TimeZone *) &arg2_defvalue ;
     int result;
+    bool temp2 = False ;
     PyObject * obj0 = 0 ;
     PyObject * obj1 = 0 ;
     char *kwnames[] = {
@@ -17232,6 +17204,7 @@ static PyObject *_wrap_DateTime_GetDayOfYear(PyObject *self, PyObject *args, PyO
     if (obj1) {
         {
             arg2 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(obj1));
+            temp2 = True;
         }
     }
     {
@@ -17243,12 +17216,12 @@ static PyObject *_wrap_DateTime_GetDayOfYear(PyObject *self, PyObject *args, PyO
     }
     resultobj = PyInt_FromLong((long)result);
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return resultobj;
     fail:
     {
-        if (arg2) delete arg2;
+        if (temp2) delete arg2;
     }
     return NULL;
 }
@@ -17261,6 +17234,7 @@ static PyObject *_wrap_DateTime_GetWeekOfYear(PyObject *self, PyObject *args, Py
     wxDateTime::TimeZone const &arg3_defvalue = LOCAL_TZ ;
     wxDateTime::TimeZone *arg3 = (wxDateTime::TimeZone *) &arg3_defvalue ;
     int result;
+    bool temp3 = False ;
     PyObject * obj0 = 0 ;
     PyObject * obj2 = 0 ;
     char *kwnames[] = {
@@ -17272,6 +17246,7 @@ static PyObject *_wrap_DateTime_GetWeekOfYear(PyObject *self, PyObject *args, Py
     if (obj2) {
         {
             arg3 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(obj2));
+            temp3 = True;
         }
     }
     {
@@ -17283,12 +17258,12 @@ static PyObject *_wrap_DateTime_GetWeekOfYear(PyObject *self, PyObject *args, Py
     }
     resultobj = PyInt_FromLong((long)result);
     {
-        if (arg3) delete arg3;
+        if (temp3) delete arg3;
     }
     return resultobj;
     fail:
     {
-        if (arg3) delete arg3;
+        if (temp3) delete arg3;
     }
     return NULL;
 }
@@ -17301,6 +17276,7 @@ static PyObject *_wrap_DateTime_GetWeekOfMonth(PyObject *self, PyObject *args, P
     wxDateTime::TimeZone const &arg3_defvalue = LOCAL_TZ ;
     wxDateTime::TimeZone *arg3 = (wxDateTime::TimeZone *) &arg3_defvalue ;
     int result;
+    bool temp3 = False ;
     PyObject * obj0 = 0 ;
     PyObject * obj2 = 0 ;
     char *kwnames[] = {
@@ -17312,6 +17288,7 @@ static PyObject *_wrap_DateTime_GetWeekOfMonth(PyObject *self, PyObject *args, P
     if (obj2) {
         {
             arg3 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(obj2));
+            temp3 = True;
         }
     }
     {
@@ -17323,12 +17300,12 @@ static PyObject *_wrap_DateTime_GetWeekOfMonth(PyObject *self, PyObject *args, P
     }
     resultobj = PyInt_FromLong((long)result);
     {
-        if (arg3) delete arg3;
+        if (temp3) delete arg3;
     }
     return resultobj;
     fail:
     {
-        if (arg3) delete arg3;
+        if (temp3) delete arg3;
     }
     return NULL;
 }
@@ -18785,6 +18762,7 @@ static PyObject *_wrap_DateTime_Format(PyObject *self, PyObject *args, PyObject
     wxDateTime::TimeZone *arg3 = (wxDateTime::TimeZone *) &arg3_defvalue ;
     wxString result;
     bool temp2 = False ;
+    bool temp3 = False ;
     PyObject * obj0 = 0 ;
     PyObject * obj1 = 0 ;
     PyObject * obj2 = 0 ;
@@ -18804,6 +18782,7 @@ static PyObject *_wrap_DateTime_Format(PyObject *self, PyObject *args, PyObject
     if (obj2) {
         {
             arg3 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(obj2));
+            temp3 = True;
         }
     }
     {
@@ -18825,7 +18804,7 @@ static PyObject *_wrap_DateTime_Format(PyObject *self, PyObject *args, PyObject
         delete arg2;
     }
     {
-        if (arg3) delete arg3;
+        if (temp3) delete arg3;
     }
     return resultobj;
     fail:
@@ -18834,7 +18813,7 @@ static PyObject *_wrap_DateTime_Format(PyObject *self, PyObject *args, PyObject
         delete arg2;
     }
     {
-        if (arg3) delete arg3;
+        if (temp3) delete arg3;
     }
     return NULL;
 }
@@ -24475,10 +24454,10 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"CreateFileTipProvider", (PyCFunction) _wrap_CreateFileTipProvider, METH_VARARGS | METH_KEYWORDS },
         { (char *)"new_Timer", (PyCFunction) _wrap_new_Timer, METH_VARARGS | METH_KEYWORDS },
         { (char *)"delete_Timer", (PyCFunction) _wrap_delete_Timer, METH_VARARGS | METH_KEYWORDS },
+        { (char *)"Timer__setCallbackInfo", (PyCFunction) _wrap_Timer__setCallbackInfo, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Timer_SetOwner", (PyCFunction) _wrap_Timer_SetOwner, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Timer_Start", (PyCFunction) _wrap_Timer_Start, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Timer_Stop", (PyCFunction) _wrap_Timer_Stop, METH_VARARGS | METH_KEYWORDS },
-        { (char *)"Timer_Notify", (PyCFunction) _wrap_Timer_Notify, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Timer_IsRunning", (PyCFunction) _wrap_Timer_IsRunning, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Timer_GetInterval", (PyCFunction) _wrap_Timer_GetInterval, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Timer_IsOneShot", (PyCFunction) _wrap_Timer_IsOneShot, METH_VARARGS | METH_KEYWORDS },
index 2237dbefc0ad9f2e3bece4a5959e7738bffbe158..3688c79ea96a0d8e76fca53f0fed24da0db12275 100644 (file)
@@ -657,7 +657,7 @@ class StatusBar(core.Window):
         return _windows.StatusBar_SetStatusWidths(*args, **kwargs)
 
     def GetFieldRect(*args, **kwargs):
-        """GetFieldRect(int i, Rect rect) -> bool"""
+        """GetFieldRect(int i) -> Rect"""
         return _windows.StatusBar_GetFieldRect(*args, **kwargs)
 
     def SetMinHeight(*args, **kwargs):
index 8d2dfbff1118643245d5ed3f15554964cac9ab7d..b8f0ec3dd940a05cbb3efffc092b5c3441512a46 100644 (file)
@@ -365,6 +365,11 @@ bool wxDialog_IsModalShowing(wxDialog *self){
         }
 
 
+wxRect wxStatusBar_GetFieldRect(wxStatusBar *self,int i){
+            wxRect r;
+            self->GetFieldRect(i, r);
+            return r;
+        }
 
     static const wxChar* wxSplitterNameStr = wxT("splitter");
     DECLARE_DEF_STRING(SplitterNameStr);
@@ -4848,29 +4853,26 @@ static PyObject *_wrap_StatusBar_GetFieldRect(PyObject *self, PyObject *args, Py
     PyObject *resultobj;
     wxStatusBar *arg1 = (wxStatusBar *) 0 ;
     int arg2 ;
-    wxRect *arg3 = 0 ;
-    bool result;
-    wxRect temp3 ;
+    wxRect result;
     PyObject * obj0 = 0 ;
-    PyObject * obj2 = 0 ;
     char *kwnames[] = {
-        (char *) "self",(char *) "i",(char *) "rect", NULL 
+        (char *) "self",(char *) "i", NULL 
     };
     
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OiO:StatusBar_GetFieldRect",kwnames,&obj0,&arg2,&obj2)) goto fail;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"Oi:StatusBar_GetFieldRect",kwnames,&obj0,&arg2)) goto fail;
     if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxStatusBar,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
-    {
-        arg3 = &temp3;
-        if ( ! wxRect_helper(obj2, &arg3)) SWIG_fail;
-    }
     {
         PyThreadState* __tstate = wxPyBeginAllowThreads();
-        result = (bool)((wxStatusBar const *)arg1)->GetFieldRect(arg2,*arg3);
+        result = wxStatusBar_GetFieldRect(arg1,arg2);
         
         wxPyEndAllowThreads(__tstate);
         if (PyErr_Occurred()) SWIG_fail;
     }
-    resultobj = PyInt_FromLong((long)result);
+    {
+        wxRect * resultptr;
+        resultptr = new wxRect((wxRect &) result);
+        resultobj = SWIG_NewPointerObj((void *) resultptr, SWIGTYPE_p_wxRect, 1);
+    }
     return resultobj;
     fail:
     return NULL;
index 730a6fb6295e216abb856923f28239b09afe4107..97712542a8a7ab09f51525ba8cf28d91ca343023 100644 (file)
@@ -103,7 +103,7 @@ class Canvas(wxWindow):
         """Performs the blit of the buffer contents on-screen."""
         width, height = self.buffer.GetSize()
         dc.BeginDrawing()
-        dc.Blit(0, 0, width, height, self.buffer, 0, 0)
+        dc.Blit((0, 0), (width, height), self.buffer, (0, 0))
         dc.EndDrawing()
 
     def GetBoundingRect(self):
index 28c691060f09bd69e77adcfa77efdc43ad727c17..21451c1308cfdb7f3ba18e760aa20e8bc4cb0013 100644 (file)
@@ -134,15 +134,15 @@ class wxPyColourChooser(wxPanel):
             self.custom_boxs.append(custom)
 
         csizer = wxBoxSizer(wxVERTICAL)
-        csizer.Add(1, 25)
+        csizer.Add((1, 25))
         csizer.Add(self.basic_label, 0, wxEXPAND)
-        csizer.Add(1, 5)
+        csizer.Add((1, 5))
         csizer.Add(colour_grid, 0, wxEXPAND)
-        csizer.Add(1, 25)
+        csizer.Add((1, 25))
         csizer.Add(self.custom_label, 0, wxEXPAND)
-        csizer.Add(1, 5)
+        csizer.Add((1, 5))
         csizer.Add(custom_grid, 0, wxEXPAND)
-        csizer.Add(1, 5)
+        csizer.Add((1, 5))
         csizer.Add(self.add_button, 0, wxEXPAND)
 
         self.palette = pypalette.PyPalette(self, -1)
@@ -152,7 +152,7 @@ class wxPyColourChooser(wxPanel):
         EVT_COMMAND_SCROLL(self, self.idSCROLL, self.onScroll)
         psizer = wxBoxSizer(wxHORIZONTAL)
         psizer.Add(self.palette, 0, 0)
-        psizer.Add(10, 1)
+        psizer.Add((10, 1))
         psizer.Add(self.colour_slider, 0, wxALIGN_CENTER_VERTICAL)
         psizer.Add(self.slider, 0, wxALIGN_CENTER_VERTICAL)
 
@@ -166,7 +166,7 @@ class wxPyColourChooser(wxPanel):
         slabel = wxStaticText(self, -1, _("Solid Colour"))
         ssizer = wxBoxSizer(wxVERTICAL)
         ssizer.Add(self.solid, 0, 0)
-        ssizer.Add(1, 2)
+        ssizer.Add((1, 2))
         ssizer.Add(slabel, 0, wxALIGN_CENTER_HORIZONTAL)
 
         hlabel = wxStaticText(self, -1, _("H:"))
@@ -212,15 +212,15 @@ class wxPyColourChooser(wxPanel):
         hsizer.Add(gsizer, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL)
 
         vsizer = wxBoxSizer(wxVERTICAL)
-        vsizer.Add(1, 5)
+        vsizer.Add((1, 5))
         vsizer.Add(psizer, 0, 0)
-        vsizer.Add(1, 15)
+        vsizer.Add((1, 15))
         vsizer.Add(hsizer, 0, wxEXPAND)
 
         sizer = wxBoxSizer(wxHORIZONTAL)
-        sizer.Add(5, 1)
+        sizer.Add((5, 1))
         sizer.Add(csizer, 0, wxEXPAND)
-        sizer.Add(10, 1)
+        sizer.Add((10, 1))
         sizer.Add(vsizer, 0, wxEXPAND)
         self.SetAutoLayout(True)
         self.SetSizer(sizer)
index 87a4442579305a1f5fc489757dbb78732e64d7a4..7e00a1d10a076cbaf5afac91ec10545d76a7978f 100644 (file)
@@ -58,7 +58,7 @@ class PyColourSlider(canvas.Canvas):
         """Returns the colour value for a position on the slider. The position
         must be within the valid height of the slider, or results can be
         unpredictable."""
-        return self.buffer.GetPixel(0, pos)
+        return self.buffer.GetPixel((0, pos))
 
     def DrawBuffer(self):
         """Actual implementation of the widget's drawing. We simply draw
@@ -78,5 +78,5 @@ class PyColourSlider(canvas.Canvas):
             r,g,b = [c * 255.0 for c in colorsys.hsv_to_rgb(h,s,v)]
             colour = wxColour(int(r), int(g), int(b))
             self.buffer.SetPen(wxPen(colour, 1, wxSOLID))
-            self.buffer.DrawRectangle(0, y_pos, 15, 1)
+            self.buffer.DrawRectangle((0, y_pos), (15, 1))
             v = v - vstep
index 8b137d4e6df0a0a24538844dabfb4ae80a270174..321750c1b11ca9574c807eed39a194700a2c3648 100644 (file)
@@ -163,12 +163,12 @@ class PyPalette(canvas.Canvas):
         """Returns a colour value at a specific x, y coordinate pair. This
         is useful for determining the colour found a specific mouse click
         in an external event handler."""
-        return self.buffer.GetPixel(x, y)
+        return self.buffer.GetPixel((x, y))
 
     def DrawBuffer(self):
         """Draws the palette XPM into the memory buffer."""
         #self.GeneratePaletteBMP ("foo.bmp")
-        self.buffer.DrawBitmap(self.palette, 0, 0, 0)
+        self.buffer.DrawBitmap(self.palette, (0, 0), 0)
 
     def HighlightPoint(self, x, y):
         """Highlights an area of the palette with a little circle around
@@ -176,7 +176,7 @@ class PyPalette(canvas.Canvas):
         colour = wxColour(0, 0, 0)
         self.buffer.SetPen(wxPen(colour, 1, wxSOLID))
         self.buffer.SetBrush(wxBrush(colour, wxTRANSPARENT))
-        self.buffer.DrawCircle(x, y, 3)
+        self.buffer.DrawCircle((x, y), 3)
         self.Refresh()
 
     def GeneratePaletteBMP(self, file_name, granularity=1):
@@ -204,9 +204,8 @@ class PyPalette(canvas.Canvas):
                 colour = wxColour(int(r * 255.0), int(g * 255.0), int(b * 255.0))
                 self.buffer.SetPen(wxPen(colour, 1, wxSOLID))
                 self.buffer.SetBrush(wxBrush(colour, wxSOLID))
-                self.buffer.DrawRectangle(x, y,
-                                          self.HORIZONTAL_STEP,
-                                          self.vertical_step)
+                self.buffer.DrawRectangle((x, y),
+                                          (self.HORIZONTAL_STEP, self.vertical_step))
 
         # this code is now simpler (and works)
         bitmap = self.buffer.GetBitmap()
index ec9ae457f21dba655e44c85f0770cee2b3b1c6aa..8f14df111bb208c5b162b3ea9280f9d4fe9be108 100644 (file)
@@ -661,9 +661,10 @@ _haveUpdated = False
 def updateColourDB():
     global _haveUpdated
     if not _haveUpdated:
-        from wxPython.wx import wxTheColourDatabase
+        import wx
+        assert wx.GetApp() is not None, "You must have a wx.App object before you can use the colour database."
         cl = getColourInfoList()
         for info in cl:
-            wxTheColourDatabase.Append(*info)
+            wx.TheColourDatabase.Append(*info)
 
 
index fbf1999f37888bbeebeafec7f20e50f64d7cbbe9..1572ace9d8fb16429a0ea9945dc3fc9b29d1dcdf 100644 (file)
@@ -32,42 +32,91 @@ from wxPython.wx import *
 EVT_COMMAND_COLOURSELECT = wxNewId()
 
 class ColourSelectEvent(wxPyCommandEvent):
-        def __init__(self, id, value):
-                wxPyCommandEvent.__init__(self, id = id)
-                self.SetEventType(EVT_COMMAND_COLOURSELECT)
-                self.value = value
+    def __init__(self, id, value):
+        wxPyCommandEvent.__init__(self, id = id)
+        self.SetEventType(EVT_COMMAND_COLOURSELECT)
+        self.value = value
 
-        def GetValue(self):
-                return self.value
+    def GetValue(self):
+        return self.value
 
 def EVT_COLOURSELECT(win, id, func):
     win.Connect(id, -1, EVT_COMMAND_COLOURSELECT, func)
 
-class ColourSelect(wxButton):
-    def __init__(self, parent, id, label = "", bcolour=(0, 0, 0),
-            pos = wxDefaultPosition, size = wxDefaultSize,
-                callback = None):
-        wxButton.__init__(self, parent, id, label, pos=pos, size=size)
-        self.SetColour(bcolour)
+
+
+
+class ColourSelect(wxBitmapButton):
+    def __init__(self, parent, id, label="", colour=wxBLACK,
+                 pos=wxDefaultPosition, size=wxDefaultSize,
+                 callback=None, style=0):
+        if label:
+            w, h = parent.GetTextExtent(label)
+            w += 6
+            h += 6
+        else:
+            w, h = 20, 20
+        wxBitmapButton.__init__(self, parent, id, wxEmptyBitmap(w,h),
+                                pos=pos, size=size, style=style|wxBU_AUTODRAW)
+        if type(colour) == type( () ):
+            colour = wxColour(*colour)
+        self.colour = colour
+        self.SetLabel(label)
         self.callback = callback
+        bmp = self.MakeBitmap()
+        self.SetBitmap(bmp)
         EVT_BUTTON(parent, self.GetId(), self.OnClick)
 
+
     def GetColour(self):
-        return self.set_colour
+        return self.colour
 
-    def GetValue(self):
-        return self.set_colour
 
-    def SetColour(self, bcolour):
-        self.set_colour_val = wxColor(bcolour[0], bcolour[1], bcolour[2])
-        self.SetBackgroundColour(self.set_colour_val)
-        avg = reduce(lambda a, b: a + b, bcolour) / 3
-        fcolour = avg > 128 and (0, 0, 0) or (255, 255, 255)
-        self.SetForegroundColour(apply(wxColour, fcolour))
-        self.set_colour = bcolour
+    def GetValue(self):
+        return self.colour
+
+
+    def SetValue(self, colour):
+        self.SetColour(colour)
+
+
+    def SetColour(self, colour):
+        if type(colour) == type( () ):
+            colour = wxColour(*colour)
+        self.colour = colour
+        bmp = self.MakeBitmap()
+        self.SetBitmap(bmp)
+
+
+    def MakeBitmap(self):
+        bdr = 10
+        sz = self.GetSize()
+        bmp = wxEmptyBitmap(sz.width-bdr, sz.height-bdr)
+        dc = wxMemoryDC()
+        dc.SelectObject(bmp)
+        label = self.GetLabel()
+        # Just make a little colored bitmap
+        dc.SetBackground(wxBrush(self.colour))
+        dc.Clear()
+        if label:
+            # Add a label to it
+            avg = reduce(lambda a, b: a + b, self.colour.Get()) / 3
+            fcolour = avg > 128 and wxBLACK or wxWHITE
+            dc.SetTextForeground(fcolour)
+            dc.DrawLabel(label, (0,0, sz.width-bdr, sz.height-bdr),
+                         wxALIGN_CENTER)
+            
+        dc.SelectObject(wxNullBitmap)
+        return bmp
+
+
+    def SetBitmap(self, bmp):
+        self.SetBitmapLabel(bmp)
+        self.SetBitmapSelected(bmp)
+        self.SetBitmapDisabled(bmp)
+        self.SetBitmapFocus(bmp)
+        self.SetBitmapSelected(bmp)
 
-    def SetValue(self, bcolour):
-        self.SetColour(bcolour)
 
     def OnChange(self):
         wxPostEvent(self, ColourSelectEvent(self.GetId(), self.GetValue()))
@@ -77,12 +126,12 @@ class ColourSelect(wxButton):
     def OnClick(self, event):
         data = wxColourData()
         data.SetChooseFull(True)
-        data.SetColour(self.set_colour_val)
+        data.SetColour(self.colour)
         dlg = wxColourDialog(self.GetParent(), data)
         changed = dlg.ShowModal() == wxID_OK
         if changed:
             data = dlg.GetColourData()
-            self.SetColour(data.GetColour().Get())
+            self.SetColour(data.GetColour())
         dlg.Destroy()
 
         if changed:
index d3912e58949464dc2b59ef009c42284c0a60d381..57f1d778708a3410aac3323192eb26254706187f 100644 (file)
@@ -149,12 +149,12 @@ class wxEditor(wxScrolledWindow):
         else:
             self.sh = self.bh / self.fh
             if self.LinesInFile() >= self.sh:
-                self.bw = self.bw - wxSystemSettings_GetSystemMetric(wxSYS_VSCROLL_X)
+                self.bw = self.bw - wxSystemSettings_GetMetric(wxSYS_VSCROLL_X)
                 self.sw = (self.bw / self.fw) - 1
 
             self.sw = (self.bw / self.fw) - 1
             if self.CalcMaxLineLen() >= self.sw:
-                self.bh = self.bh - wxSystemSettings_GetSystemMetric(wxSYS_HSCROLL_Y)
+                self.bh = self.bh - wxSystemSettings_GetMetric(wxSYS_HSCROLL_Y)
                 self.sh = self.bh / self.fh
 
 
@@ -197,7 +197,7 @@ class wxEditor(wxScrolledWindow):
         pass
 
     def DrawEditText(self, t, x, y, dc):
-        dc.DrawText(t, x * self.fw, y * self.fh)
+        dc.DrawText(t, (x * self.fw, y * self.fh))
 
     def DrawLine(self, line, dc):
         if self.IsLine(line):
@@ -245,7 +245,7 @@ class wxEditor(wxScrolledWindow):
         x = 0
         y = (len(self.lines) - self.sy) * self.fh
         hasTransparency = 1
-        dc.DrawBitmap(self.eofMarker, x, y, hasTransparency)
+        dc.DrawBitmap(self.eofMarker, (x, y), hasTransparency)
 
 ##------------------ cursor-related functions
 
@@ -274,7 +274,7 @@ class wxEditor(wxScrolledWindow):
         szy = self.fh
         x = xp * szx
         y = yp * szy
-        dc.Blit(x,y,szx,szy,dc,x,y,wxSRC_INVERT)
+        dc.Blit((x,y), (szx,szy), dc, (x,y), wxSRC_INVERT)
         self.sco_x = xp
         self.sco_y = yp
 
index 8f88ebbb31570d2807aa0ec64b961a974944904c..1d1cdb57054ff309a4c5d458386044b358b31338 100644 (file)
@@ -450,7 +450,7 @@ class PointSet(draw_object):
                 dc.SetBrush(self.Brush)
                 radius = int(round(self.Diameter/2))
                 for (x,y) in Points:
-                    dc.DrawEllipse((x - radius), (y - radius), self.Diameter, self.Diameter)
+                    dc.DrawEllipse(((x - radius), (y - radius)), (self.Diameter, self.Diameter))
 
 
                     
@@ -486,7 +486,7 @@ class Dot(draw_object):
         dc.SetBrush(self.Brush)
         radius = int(round(self.Diameter/2))
         (X,Y) = WorldToPixel((self.X,self.Y))
-        dc.DrawEllipse((X - radius), (Y - radius), self.Diameter, self.Diameter)
+        dc.DrawEllipse(((X - radius), (Y - radius)), (self.Diameter, self.Diameter))
 
 
 class Rectangle(draw_object):
@@ -513,7 +513,7 @@ class Rectangle(draw_object):
 
         dc.SetPen(self.Pen)
         dc.SetBrush(self.Brush)
-        dc.DrawRectangle(X,Y,Width,Height)
+        dc.DrawRectangle((X,Y), (Width,Height))
 
 class Ellipse(draw_object):
     def __init__(self,x,y,width,height,LineColor,LineStyle,LineWidth,FillColor,FillStyle,Foreground = 0):
@@ -539,7 +539,7 @@ class Ellipse(draw_object):
 
         dc.SetPen(self.Pen)
         dc.SetBrush(self.Brush)
-        dc.DrawEllipse(X,Y,Width,Height)
+        dc.DrawEllipse((X,Y), (Width,Height))
 
 class Circle(draw_object):
     def __init__(self,x,y,Diameter,LineColor,LineStyle,LineWidth,FillColor,FillStyle,Foreground = 0):
@@ -564,7 +564,7 @@ class Circle(draw_object):
 
         dc.SetPen(self.Pen)
         dc.SetBrush(self.Brush)
-        dc.DrawEllipse(X-Diameter/2,Y-Diameter/2,Diameter,Diameter)
+        dc.DrawEllipse((X-Diameter/2,Y-Diameter/2), (Diameter,Diameter))
 
 class Text(draw_object):
     """
@@ -647,7 +647,7 @@ class Text(draw_object):
                     raise "Invalid value for Text Object Position Attribute"
             self.x_shift = x_shift
             self.y_shift = y_shift
-        dc.DrawText(self.String, X-self.x_shift, Y-self.y_shift)
+        dc.DrawText(self.String, (X-self.x_shift, Y-self.y_shift))
 
 
 #---------------------------------------------------------------------------
@@ -808,13 +808,13 @@ class FloatCanvas(wxPanel):
         
         tb.SetToolBitmapSize((23,23))
         
-        tb.AddTool(ID_ZOOM_IN_BUTTON, GetPlusBitmap(), isToggle=true,shortHelpString = "Zoom In")
+        tb.AddTool(ID_ZOOM_IN_BUTTON, GetPlusBitmap(), isToggle=True,shortHelpString = "Zoom In")
         EVT_TOOL(self, ID_ZOOM_IN_BUTTON, self.SetMode)
         
-        tb.AddTool(ID_ZOOM_OUT_BUTTON, GetMinusBitmap(), isToggle=true,shortHelpString = "Zoom Out")
+        tb.AddTool(ID_ZOOM_OUT_BUTTON, GetMinusBitmap(), isToggle=True,shortHelpString = "Zoom Out")
         EVT_TOOL(self, ID_ZOOM_OUT_BUTTON, self.SetMode)
         
-        tb.AddTool(ID_MOVE_MODE_BUTTON, GetHandBitmap(), isToggle=true,shortHelpString = "Move")
+        tb.AddTool(ID_MOVE_MODE_BUTTON, GetHandBitmap(), isToggle=True,shortHelpString = "Move")
         EVT_TOOL(self, ID_MOVE_MODE_BUTTON, self.SetMode)
         
         tb.AddSeparator()
@@ -869,8 +869,8 @@ class FloatCanvas(wxPanel):
                     dc.SetBrush(wxTRANSPARENT_BRUSH)
                     dc.SetLogicalFunction(wxXOR)
                     if self.PrevRBBox:
-                        dc.DrawRectangle(*self.PrevRBBox)
-                    dc.DrawRectangle(x_c-w/2,y_c-h/2,w,h)
+                        dc.DrawRectangleXY(*self.PrevRBBox)
+                    dc.DrawRectangleXY(x_c-w/2,y_c-h/2,w,h)
                     self.PrevRBBox = (x_c-w/2,y_c-h/2,w,h)
                     dc.EndDrawing()
                     
@@ -908,8 +908,8 @@ class FloatCanvas(wxPanel):
                     dc.SetBrush(wxTRANSPARENT_BRUSH)
                     dc.SetLogicalFunction(wxXOR)
                     if self.PrevMoveBox:
-                        dc.DrawRectangle(*self.PrevMoveBox)
-                    dc.DrawRectangle(x_tl,y_tl,w,h)
+                        dc.DrawRectangleXY(*self.PrevMoveBox)
+                    dc.DrawRectangleXY(x_tl,y_tl,w,h)
                     self.PrevMoveBox = (x_tl,y_tl,w,h)
                     dc.EndDrawing()
                   
@@ -954,7 +954,7 @@ class FloatCanvas(wxPanel):
     def OnPaint(self, event):
         #dc = wxBufferedPaintDC(self.DrawPanel, self._Buffer)
         dc = wxPaintDC(self.DrawPanel)
-        dc.DrawBitmap(self._Buffer,0,0)
+        dc.DrawBitmap(self._Buffer, (0,0))
 
     def Draw(self):
         """
@@ -990,7 +990,7 @@ class FloatCanvas(wxPanel):
                             i+=1
                             Object._Draw(dc,self.WorldToPixel,self.ScaleFunction)
                             if i % self.NumBetweenBlits == 0:
-                                ScreenDC.Blit(0, 0, self.PanelSize[0],self.PanelSize[1], dc, 0, 0)
+                                ScreenDC.Blit((0, 0), self.PanelSize, dc, (0, 0))
                     dc.EndDrawing()
             else:
                 dc.Clear()
@@ -1005,7 +1005,7 @@ class FloatCanvas(wxPanel):
                 i+=1
                 Object._Draw(dc,self.WorldToPixel,self.ScaleFunction)
                 if i % self.NumBetweenBlits == 0:
-                    ScreenDC.Blit(0, 0, self.PanelSize[0],self.PanelSize[1], dc, 0, 0)
+                    ScreenDC.Blit((0, 0), self.PanelSize, dc, (0, 0))
             dc.EndDrawing()
         else: # not using a Background DC
             dc = wxMemoryDC()
@@ -1021,25 +1021,25 @@ class FloatCanvas(wxPanel):
                         i+=1
                         Object._Draw(dc,self.WorldToPixel,self.ScaleFunction)
                         if i % self.NumBetweenBlits == 0:
-                            ScreenDC.Blit(0, 0, self.PanelSize[0],self.PanelSize[1], dc, 0, 0)
+                            ScreenDC.Blit((0, 0), self.PanelSize, dc, (0, 0))
                 dc.EndDrawing()
             else:
                 dc.Clear()
         # now refresh the screen
         #ScreenDC.DrawBitmap(self._Buffer,0,0) #NOTE: uisng DrawBitmap didn't work right on MSW
-        ScreenDC.Blit(0, 0, self.PanelSize[0],self.PanelSize[1], dc, 0, 0)
+        ScreenDC.Blit((0, 0), self.PanelSize, dc, (0, 0))
 
         # If the canvas is in the middle of a zoom or move, the Rubber Band box needs to be re-drawn
         if self.PrevRBBox:
             ScreenDC.SetPen(wxPen('WHITE', 2,wxSHORT_DASH))
             ScreenDC.SetBrush(wxTRANSPARENT_BRUSH)
             ScreenDC.SetLogicalFunction(wxXOR)
-            ScreenDC.DrawRectangle(*self.PrevRBBox)
+            ScreenDC.DrawRectangleXY(*self.PrevRBBox)
         elif self.PrevMoveBox:
             ScreenDC.SetPen(wxPen('WHITE', 1,))
             ScreenDC.SetBrush(wxTRANSPARENT_BRUSH)
             ScreenDC.SetLogicalFunction(wxXOR)
-            ScreenDC.DrawRectangle(*self.PrevMoveBox)
+            ScreenDC.DrawRectangleXY(*self.PrevMoveBox)
         if self.Debug: print "Drawing took %f seconds of CPU time"%(clock()-start)
 
     def BBCheck(self, BB1, BB2):
index b3163e7edc752f267d63d6a3f2c3eb0c6fcf3714..018e80fc15c023437846bf45966d62a01be52d2e 100644 (file)
@@ -92,7 +92,7 @@ wxGrid.RowToRect = _RowToRect
 
 class ColDragWindow(wxWindow):
     def __init__(self,parent,image,dragCol):
-        wxWindow.__init__(self,parent,wxSIMPLE_BORDER)
+        wxWindow.__init__(self,parent,-1, style=wxSIMPLE_BORDER)
         self.image = image
         self.SetSize((self.image.GetWidth(),self.image.GetHeight()))
         self.ux = parent.GetScrollPixelsPerUnit()[0]
@@ -139,19 +139,19 @@ class ColDragWindow(wxWindow):
     def OnPaint(self,evt):
         dc = wxPaintDC(self)
         w,h = self.GetSize()
-        dc.DrawBitmap(self.image,0,0)
+        dc.DrawBitmap(self.image, (0,0))
         dc.SetPen(wxPen(wxBLACK,1,wxSOLID))
         dc.SetBrush(wxTRANSPARENT_BRUSH)
-        dc.DrawRectangle(0,0,w,h)
+        dc.DrawRectangle((0,0), (w,h))
         iPos = self.GetInsertionPos()
-        dc.DrawLine(iPos,h - 10,iPos,h)
+        dc.DrawLine((iPos,h - 10), (iPos,h))
 
 
 
 
 class RowDragWindow(wxWindow):
     def __init__(self,parent,image,dragRow):
-        wxWindow.__init__(self,parent,wxSIMPLE_BORDER)
+        wxWindow.__init__(self,parent,-1, style=wxSIMPLE_BORDER)
         self.image = image
         self.SetSize((self.image.GetWidth(),self.image.GetHeight()))
         self.uy = parent.GetScrollPixelsPerUnit()[1]
@@ -198,12 +198,12 @@ class RowDragWindow(wxWindow):
     def OnPaint(self,evt):
         dc = wxPaintDC(self)
         w,h = self.GetSize()
-        dc.DrawBitmap(self.image,0,0)
+        dc.DrawBitmap(self.image, (0,0))
         dc.SetPen(wxPen(wxBLACK,1,wxSOLID))
         dc.SetBrush(wxTRANSPARENT_BRUSH)
-        dc.DrawRectangle(0,0,w,h)
+        dc.DrawRectangle((0,0), (w,h))
         iPos = self.GetInsertionPos()
-        dc.DrawLine(w - 10,iPos,w,iPos)
+        dc.DrawLine((w - 10,iPos), (w,iPos))
 
 #----------------------------------------------------------------------------
 
@@ -306,7 +306,7 @@ class wxGridColMover(wxEvtHandler):
         memdc = wxMemoryDC()
         memdc.SelectObject(bmp)
         dc = wxWindowDC(self.lwin)
-        memdc.Blit(0,0,rect.width,rect.height,dc,rect.x,rect.y)
+        memdc.Blit((0,0), rect.GetSize(), dc, rect.GetPosition())
         memdc.SelectObject(wxNullBitmap)
         return bmp
 
@@ -411,7 +411,7 @@ class wxGridRowMover(wxEvtHandler):
         memdc = wxMemoryDC()
         memdc.SelectObject(bmp)
         dc = wxWindowDC(self.lwin)
-        memdc.Blit(0,0,rect.width,rect.height,dc,rect.x,rect.y)
+        memdc.Blit((0,0), rect.GetSize(), dc, rect.GetPosition())
         memdc.SelectObject(wxNullBitmap)
         return bmp
 
index ec91ae53e1dc6cb177189a383ae60cd44fa5451d..00d3c9aaa977e1a5cf629475f09872c2ada9aa5e 100644 (file)
@@ -1723,7 +1723,7 @@ class wxMaskedEditMixin:
                     'foregroundColour', 'signedForegroundColour'):
             if ctrl_kwargs.has_key(key):
                 if type(ctrl_kwargs[key]) in (types.StringType, types.UnicodeType):
-                    c = wxNamedColor(ctrl_kwargs[key])
+                    c = wxNamedColour(ctrl_kwargs[key])
                     if c.Get() == (-1, -1, -1):
                         raise TypeError('%s not a legal color specification for %s' % (repr(ctrl_kwargs[key]), key))
                     else:
@@ -2262,7 +2262,7 @@ class wxMaskedEditMixin:
             # if no fillchar change, but old value == old template, replace it:
             if newvalue == old_template:
                 newvalue = self._template
-                reset_value = true
+                reset_value = True
         else:
             self._defaultValue = None
 
@@ -2768,7 +2768,7 @@ class wxMaskedEditMixin:
                         if newfield != field and newfield._selectOnFieldEntry:
                             dbg('queuing selection: (%d, %d)' % (newfield._extent[0], newfield._extent[1]))
                             wxCallAfter(self._SetSelection, newfield._extent[0], newfield._extent[1])
-                    keep_processing = false
+                    keep_processing = False
 
             elif keep_processing:
                 dbg('char not allowed')
@@ -2985,7 +2985,7 @@ class wxMaskedEditMixin:
 
     def _OnCtrl_Z(self, event=None):
         """ Handles ctrl-Z keypress in control and Undo operation on context menu.
-            Should return false to skip other processing. """
+            Should return False to skip other processing. """
         dbg("wxMaskedEditMixin::_OnCtrl_Z", indent=1)
         self.Undo()
         dbg(indent=0)
@@ -3415,7 +3415,7 @@ class wxMaskedEditMixin:
                 dbg('cursor before 1st field; cannot change to a previous field')
                 if not wxValidator_IsSilent():
                     wxBell()
-                return false
+                return False
 
             if event.ControlDown():
                 dbg('queuing select to beginning of field:', field_start, pos)
@@ -4218,7 +4218,7 @@ class wxMaskedEditMixin:
 
 
         if self._isTemplateChar( pos ):  ## if a template character, return empty
-            dbg('%d is a template character; returning false' % pos, indent=0)
+            dbg('%d is a template character; returning False' % pos, indent=0)
             return False
 
         if self._isMaskChar( pos ):
@@ -4263,7 +4263,7 @@ class wxMaskedEditMixin:
             dbg(indent=0)
             return approved
         else:
-            dbg('%d is a !???! character; returning false', indent=0)
+            dbg('%d is a !???! character; returning False', indent=0)
             return False
 
 
@@ -4846,7 +4846,7 @@ class wxMaskedEditMixin:
         else:
             text = candidate
 
-        valid = True    # assume true
+        valid = True    # assume True
         for i in [-1] + self._field_indices:   # process global constraints first:
             field = self._fields[i]
             start, end = field._extent
@@ -5840,12 +5840,12 @@ class wxMaskedTextCtrl( wxTextCtrl, wxMaskedEditMixin ):
                 self._isNeg = False     # (clear current assumptions)
                 value = self._adjustInt(value)
             elif self._isDate and not self.IsValid(value) and self._4digityear:
-                value = self._adjustDate(value, fixcentury=true)
+                value = self._adjustDate(value, fixcentury=True)
         except ValueError:
             # If date, year might be 2 digits vs. 4; try adjusting it:
             if self._isDate and self._4digityear:
                 dateparts = value.split(' ')
-                dateparts[0] = self._adjustDate(dateparts[0], fixcentury=true)
+                dateparts[0] = self._adjustDate(dateparts[0], fixcentury=True)
                 value = string.join(dateparts, ' ')
                 dbg('adjusted value: "%s"' % value)
                 value = self._Paste(value, raise_on_invalid=True, just_return_value=True)
@@ -6157,12 +6157,12 @@ class wxMaskedComboBox( wxComboBox, wxMaskedEditMixin ):
                 self._isNeg = False     # (clear current assumptions)
                 value = self._adjustInt(value)
             elif self._isDate and not self.IsValid(value) and self._4digityear:
-                value = self._adjustDate(value, fixcentury=true)
+                value = self._adjustDate(value, fixcentury=True)
         except ValueError:
             # If date, year might be 2 digits vs. 4; try adjusting it:
             if self._isDate and self._4digityear:
                 dateparts = value.split(' ')
-                dateparts[0] = self._adjustDate(dateparts[0], fixcentury=true)
+                dateparts[0] = self._adjustDate(dateparts[0], fixcentury=True)
                 value = string.join(dateparts, ' ')
                 dbg('adjusted value: "%s"' % value)
                 value = self._Paste(value, raise_on_invalid=True, just_return_value=True)
@@ -6547,7 +6547,7 @@ class wxIpAddrCtrl( wxMaskedTextCtrl ):
             dbg(indent=0)
             raise ValueError('%s must be a string', str(value))
 
-        bValid = True   # assume true
+        bValid = True   # assume True
         parts = value.split('.')
         if len(parts) != 4:
             bValid = False
index 9f5602e5a6647a4f52c441a64cadf837edb55221..2c7d5a537bcf913b3d523c6ec37797cf3cdec1a6 100644 (file)
@@ -592,10 +592,8 @@ class MultiCreator(wxWindow):
         dc.SetBackground(wxBrush(self.GetBackgroundColour(),wxSOLID))
         dc.Clear()
 
-        highlight = wxPen(wxSystemSettings_GetSystemColour(
-            wxSYS_COLOUR_BTNHIGHLIGHT),1,wxSOLID)
-        shadow = wxPen(wxSystemSettings_GetSystemColour(
-            wxSYS_COLOUR_BTNSHADOW),1,wxSOLID)
+        highlight = wxPen(wxSystemSettings_GetColour(wxSYS_COLOUR_BTNHIGHLIGHT), 1, wxSOLID)
+        shadow = wxPen(wxSystemSettings_GetColour(wxSYS_COLOUR_BTNSHADOW), 1, wxSOLID)
         black = wxPen(wxBLACK,1,wxSOLID)
         w,h = self.GetSizeTuple()
         w -= 1
@@ -603,13 +601,13 @@ class MultiCreator(wxWindow):
 
         # Draw outline
         dc.SetPen(highlight)
-        dc.DrawLine(0,0,0,h)
-        dc.DrawLine(0,0,w,0)
+        dc.DrawLine((0,0), (0,h))
+        dc.DrawLine((0,0), (w,0))
         dc.SetPen(black)
-        dc.DrawLine(0,h,w+1,h)
-        dc.DrawLine(w,0,w,h)
+        dc.DrawLine((0,h), (w+1,h))
+        dc.DrawLine((w,0), (w,h))
         dc.SetPen(shadow)
-        dc.DrawLine(w-1,2,w-1,h)
+        dc.DrawLine((w-1,2), (w-1,h))
 
 #----------------------------------------------------------------------
 
@@ -685,11 +683,11 @@ def DrawSash(win,x,y,direction):
     bmp = wxEmptyBitmap(8,8)
     bdc = wxMemoryDC()
     bdc.SelectObject(bmp)
-    bdc.DrawRectangle(-1,-1,10,10)
+    bdc.DrawRectangle((-1,-1), (10,10))
     for i in range(8):
         for j in range(8):
             if ((i + j) & 1):
-                bdc.DrawPoint(i,j)
+                bdc.DrawPoint((i,j))
 
     brush = wxBrush(wxColour(0,0,0))
     brush.SetStipple(bmp)
@@ -719,8 +717,8 @@ def DrawSash(win,x,y,direction):
     h = body_h
 
     if direction == MV_HOR:
-        dc.DrawRectangle(x,y-2,w,4)
+        dc.DrawRectangle((x,y-2), (w,4))
     else:
-        dc.DrawRectangle(x-2,y,4,h)
+        dc.DrawRectangle((x-2,y), (4,h))
 
     dc.EndDrawingOnTop()
index 76dfc6de1920725dd05c63596d24d112b7f80956..065379ccabc9941cbb63717f84cbc1a03225955c 100644 (file)
@@ -29,12 +29,12 @@ class PopButton(wxPyControl):
         EVT_PAINT(self,                 self.OnPaint)
 
     def InitColours(self):
-        faceClr      = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNFACE)
+        faceClr      = wxSystemSettings_GetColour(wxSYS_COLOUR_BTNFACE)
         self.faceDnClr = faceClr
         self.SetBackgroundColour(faceClr)
 
-        shadowClr    = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNSHADOW)
-        highlightClr = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNHIGHLIGHT)
+        shadowClr    = wxSystemSettings_GetColour(wxSYS_COLOUR_BTNSHADOW)
+        highlightClr = wxSystemSettings_GetColour(wxSYS_COLOUR_BTNHIGHLIGHT)
         self.shadowPen    = wxPen(shadowClr, 1, wxSOLID)
         self.highlightPen = wxPen(highlightClr, 1, wxSOLID)
         self.blackPen     = wxPen(wxBLACK, 1, wxSOLID)
@@ -95,8 +95,8 @@ class PopButton(wxPyControl):
         else:
             dc.SetPen(self.shadowPen)
         for i in range(2):
-            dc.DrawLine(x1+i, y1, x1+i, y2-i)
-            dc.DrawLine(x1, y1+i, x2-i, y1+i)
+            dc.DrawLine((x1+i, y1), (x1+i, y2-i))
+            dc.DrawLine((x1, y1+i), (x2-i, y1+i))
 
         # draw the lower right sides
         if self.up:
@@ -104,20 +104,20 @@ class PopButton(wxPyControl):
         else:
             dc.SetPen(self.highlightPen)
         for i in range(2):
-            dc.DrawLine(x1+i, y2-i, x2+1, y2-i)
-            dc.DrawLine(x2-i, y1+i, x2-i, y2)
+            dc.DrawLine((x1+i, y2-i), (x2+1, y2-i))
+            dc.DrawLine((x2-i, y1+i), (x2-i, y2))
 
     def DrawArrow(self,dc):
         size = self.GetSize()
-        mx = size.x / 2
-        my = size.y / 2
+        mx = size.width / 2
+        my = size.height / 2
         dc.SetPen(self.highlightPen)
-        dc.DrawLine(mx-5,my-5,mx+5,my-5)
-        dc.DrawLine(mx-5,my-5,mx,my+5)
+        dc.DrawLine((mx-5,my-5), (mx+5,my-5))
+        dc.DrawLine((mx-5,my-5), (mx,my+5))
         dc.SetPen(self.shadowPen)
-        dc.DrawLine(mx+4,my-5,mx,my+5)
+        dc.DrawLine((mx+4,my-5), (mx,my+5))
         dc.SetPen(self.blackPen)
-        dc.DrawLine(mx+5,my-5,mx,my+5)
+        dc.DrawLine((mx+5,my-5), (mx,my+5))
 
     def OnPaint(self, event):
         width, height = self.GetClientSizeTuple()
@@ -161,15 +161,15 @@ class wxPopupDialog(wxDialog):
         selfSize = self.GetSize()
         tcSize = self.ctrl.GetSize()
 
-        pos.x -= (selfSize.x - tcSize.x) / 2
-        if pos.x + selfSize.x > dSize.x:
-            pos.x = dSize.x - selfSize.x
+        pos.x -= (selfSize.width - tcSize.width) / 2
+        if pos.x + selfSize.width > dSize.width:
+            pos.x = dSize.width - selfSize.width
         if pos.x < 0:
             pos.x = 0
 
         pos.y += tcSize.height
-        if pos.y + selfSize.y > dSize.y:
-            pos.y = dSize.y - selfSize.y
+        if pos.y + selfSize.height > dSize.height:
+            pos.y = dSize.height - selfSize.height
         if pos.y < 0:
             pos.y = 0
 
index 2fbcf9dc0026cec5599207cbf6e42ded69d7296a..e41c80d716e595a873be509c7135a573544647cb 100644 (file)
@@ -48,3 +48,11 @@ wxPreCalendarCtrl = wx.calendar.PreCalendarCtrl
 wxCalendarCtrl = wx.calendar.CalendarCtrl
 
 
+d = globals()
+for k, v in wx.calendar.__dict__.iteritems():
+    if k.startswith('EVT'):
+        d[k] = v
+del d, k, v
+
+
+
index 792d6005489ebee62cde02066f19c5521e620451..904462b2aaf0275a0033d7fecabe279163a15fa7 100644 (file)
@@ -1 +1,28 @@
-#
+"""
+wxPyColourChooser
+Copyright (C) 2002 Michael Gilfix <mgilfix@eecs.tufts.edu>
+
+This file is part of wxPyColourChooser.
+
+This version of wxPyColourChooser is open source; you can redistribute it
+and/or modify it under the licensed terms.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+"""
+
+from pycolourchooser import *
+
+# For the American in you
+wxPyColorChooser = wxPyColourChooser
+
+__all__ = [
+    'canvas',
+    'pycolourbox',
+    'pycolourchooser',
+    'pycolourslider',
+    'pypalette',
+]
+
+
index 792d6005489ebee62cde02066f19c5521e620451..a5dab2cdd6153eea6acf3af5f615e640ae7d84d1 100644 (file)
@@ -1 +1,2 @@
-#
+from editor    import wxEditor
+