]> git.saurik.com Git - wxWidgets.git/commitdiff
reSWIGged
authorRobin Dunn <robin@alldunn.com>
Sat, 19 Jun 2004 15:23:25 +0000 (15:23 +0000)
committerRobin Dunn <robin@alldunn.com>
Sat, 19 Jun 2004 15:23:25 +0000 (15:23 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27897 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/src/gtk/_core.py
wxPython/src/gtk/_core_wrap.cpp
wxPython/src/gtk/grid_wrap.cpp
wxPython/src/mac/_core.py
wxPython/src/mac/_core_wrap.cpp
wxPython/src/mac/grid_wrap.cpp
wxPython/src/msw/_core.py
wxPython/src/msw/_core_wrap.cpp
wxPython/src/msw/grid_wrap.cpp

index e19c4d08065c18defb477cb9c86a17eb4d48ae0f..3e816ee7bb99aa62f0b01b4cc59be8be7f7ab9f1 100644 (file)
@@ -5671,6 +5671,15 @@ class Window(EvtHandler):
         """
         return _core_.Window_MoveXY(*args, **kwargs)
 
+    def SetBestFittingSize(*args, **kwargs):
+        """
+        SetBestFittingSize(self, Size size=DefaultSize)
+
+        A 'Smart' SetSize that will fill in default size components with the
+        window's *best size* values.  Also set's the minsize for use with sizers.
+        """
+        return _core_.Window_SetBestFittingSize(*args, **kwargs)
+
     def Raise(*args, **kwargs):
         """
         Raise(self)
@@ -6772,16 +6781,17 @@ class Window(EvtHandler):
         Sets the background colour of the window.  Returns True if the colour
         was changed.  The background colour is usually painted by the default
         EVT_ERASE_BACKGROUND event handler function under Windows and
-        automatically under GTK.
+        automatically under GTK.  Using `wx.NullColour` will reset the window
+        to the default background colour.
 
         Note that setting the background colour may not cause an immediate
-        refresh, so you may wish to call ClearBackground or Refresh after
+        refresh, so you may wish to call `ClearBackground` or `Refresh` after
         calling this function.
 
-        Use this function with care under GTK+ as the new appearance of the
-        window might not look equally well when used with themes, i.e GTK+'s
-        ability to change its look as the user wishes with run-time loadable
-        modules.
+        Using this function will disable attempts to use themes for this
+        window, if the system supports them.  Use with care since usually the
+        themes represent the appearance chosen by the user to be used for all
+        applications on the system.
         """
         return _core_.Window_SetBackgroundColour(*args, **kwargs)
 
@@ -8171,6 +8181,25 @@ class Control(Window):
         """
         return _core_.Control_SetLabel(*args, **kwargs)
 
+    def GetAdjustMinSizeFlag(*args, **kwargs):
+        """
+        GetAdjustMinSizeFlag(self) -> bool
+
+        Returns whether the minsize should be adjusted for this control when
+        `SetLabel` or `SetFont` are called.
+        """
+        return _core_.Control_GetAdjustMinSizeFlag(*args, **kwargs)
+
+    def SetAdjustMinSizeFlag(*args, **kwargs):
+        """
+        SetAdjustMinSizeFlag(self, bool adjust)
+
+        By default controls will readjust their size and minsize when
+        `SetLabel` or `SetFont` are called.  This flag will allow you to
+        control this behavior.
+        """
+        return _core_.Control_SetAdjustMinSizeFlag(*args, **kwargs)
+
     def GetClassDefaultAttributes(*args, **kwargs):
         """
         GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
index aa830ba40d89e33b10d2f07626e6d129c3bce5d5..bfb0c459f800e79771b87d22feb2aeb05bdeec8a 100644 (file)
@@ -22337,6 +22337,41 @@ static PyObject *_wrap_Window_MoveXY(PyObject *self, PyObject *args, PyObject *k
 }
 
 
+static PyObject *_wrap_Window_SetBestFittingSize(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxWindow *arg1 = (wxWindow *) 0 ;
+    wxSize const &arg2_defvalue = wxDefaultSize ;
+    wxSize *arg2 = (wxSize *) &arg2_defvalue ;
+    wxSize temp2 ;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "size", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:Window_SetBestFittingSize",kwnames,&obj0,&obj1)) goto fail;
+    if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxWindow,
+    SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
+    if (obj1) {
+        {
+            arg2 = &temp2;
+            if ( ! wxSize_helper(obj1, &arg2)) SWIG_fail;
+        }
+    }
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        (arg1)->SetBestFittingSize((wxSize const &)*arg2);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    Py_INCREF(Py_None); resultobj = Py_None;
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_Window_Raise(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxWindow *arg1 = (wxWindow *) 0 ;
@@ -33060,6 +33095,63 @@ static PyObject *_wrap_Control_SetLabel(PyObject *self, PyObject *args, PyObject
 }
 
 
+static PyObject *_wrap_Control_GetAdjustMinSizeFlag(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxControl *arg1 = (wxControl *) 0 ;
+    bool result;
+    PyObject * obj0 = 0 ;
+    char *kwnames[] = {
+        (char *) "self", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Control_GetAdjustMinSizeFlag",kwnames,&obj0)) goto fail;
+    if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxControl,
+    SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        result = (bool)(arg1)->GetAdjustMinSizeFlag();
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    {
+        resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
+    }
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
+static PyObject *_wrap_Control_SetAdjustMinSizeFlag(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxControl *arg1 = (wxControl *) 0 ;
+    bool arg2 ;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "adjust", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Control_SetAdjustMinSizeFlag",kwnames,&obj0,&obj1)) goto fail;
+    if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxControl,
+    SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
+    arg2 = (bool) SWIG_AsBool(obj1); 
+    if (PyErr_Occurred()) SWIG_fail;
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        (arg1)->SetAdjustMinSizeFlag(arg2);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    Py_INCREF(Py_None); resultobj = Py_None;
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_Control_GetClassDefaultAttributes(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     int arg1 = (int) wxWINDOW_VARIANT_NORMAL ;
@@ -40586,6 +40678,7 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"Window_SetSizeWH", (PyCFunction) _wrap_Window_SetSizeWH, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Window_Move", (PyCFunction) _wrap_Window_Move, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Window_MoveXY", (PyCFunction) _wrap_Window_MoveXY, METH_VARARGS | METH_KEYWORDS },
+        { (char *)"Window_SetBestFittingSize", (PyCFunction) _wrap_Window_SetBestFittingSize, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Window_Raise", (PyCFunction) _wrap_Window_Raise, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Window_Lower", (PyCFunction) _wrap_Window_Lower, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Window_SetClientSize", (PyCFunction) _wrap_Window_SetClientSize, METH_VARARGS | METH_KEYWORDS },
@@ -40893,6 +40986,8 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"Control_Command", (PyCFunction) _wrap_Control_Command, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Control_GetLabel", (PyCFunction) _wrap_Control_GetLabel, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Control_SetLabel", (PyCFunction) _wrap_Control_SetLabel, METH_VARARGS | METH_KEYWORDS },
+        { (char *)"Control_GetAdjustMinSizeFlag", (PyCFunction) _wrap_Control_GetAdjustMinSizeFlag, METH_VARARGS | METH_KEYWORDS },
+        { (char *)"Control_SetAdjustMinSizeFlag", (PyCFunction) _wrap_Control_SetAdjustMinSizeFlag, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Control_GetClassDefaultAttributes", (PyCFunction) _wrap_Control_GetClassDefaultAttributes, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Control_swigregister", Control_swigregister, METH_VARARGS },
         { (char *)"ItemContainer_Append", (PyCFunction) _wrap_ItemContainer_Append, METH_VARARGS | METH_KEYWORDS },
index 1ee05fc6a8f44e244b960ef0a1339d45629f6c78..d9dda4c5b77d27bd43c8d63b3d57da776e675c2d 100644 (file)
@@ -1252,6 +1252,11 @@ public:
             PyObject* ro;
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",row,col));
             if (ro) {
+                if (!PyString_Check(ro) && !PyUnicode_Check(ro)) {
+                    PyObject* old = ro;
+                    ro = PyObject_Str(ro);
+                    Py_DECREF(old);
+                }
                 rval = Py2wxString(ro);
                 Py_DECREF(ro);
             }
@@ -1381,7 +1386,7 @@ bool wxGridCellCoords_helper(PyObject* source, wxGridCellCoords** obj) {
 
 bool wxGridCellCoords_typecheck(PyObject* source) {
     void* ptr;
-    
+
     if (wxPySwigInstance_Check(source) &&
         wxPyConvertSwigPtr(source, (void **)&ptr, wxT("wxGridCellCoords")))
         return True;
@@ -1389,7 +1394,7 @@ bool wxGridCellCoords_typecheck(PyObject* source) {
     PyErr_Clear();
     if (PySequence_Check(source) && PySequence_Length(source) == 2)
         return True;
-    
+
     return False;
 }
 
index e19c4d08065c18defb477cb9c86a17eb4d48ae0f..3e816ee7bb99aa62f0b01b4cc59be8be7f7ab9f1 100644 (file)
@@ -5671,6 +5671,15 @@ class Window(EvtHandler):
         """
         return _core_.Window_MoveXY(*args, **kwargs)
 
+    def SetBestFittingSize(*args, **kwargs):
+        """
+        SetBestFittingSize(self, Size size=DefaultSize)
+
+        A 'Smart' SetSize that will fill in default size components with the
+        window's *best size* values.  Also set's the minsize for use with sizers.
+        """
+        return _core_.Window_SetBestFittingSize(*args, **kwargs)
+
     def Raise(*args, **kwargs):
         """
         Raise(self)
@@ -6772,16 +6781,17 @@ class Window(EvtHandler):
         Sets the background colour of the window.  Returns True if the colour
         was changed.  The background colour is usually painted by the default
         EVT_ERASE_BACKGROUND event handler function under Windows and
-        automatically under GTK.
+        automatically under GTK.  Using `wx.NullColour` will reset the window
+        to the default background colour.
 
         Note that setting the background colour may not cause an immediate
-        refresh, so you may wish to call ClearBackground or Refresh after
+        refresh, so you may wish to call `ClearBackground` or `Refresh` after
         calling this function.
 
-        Use this function with care under GTK+ as the new appearance of the
-        window might not look equally well when used with themes, i.e GTK+'s
-        ability to change its look as the user wishes with run-time loadable
-        modules.
+        Using this function will disable attempts to use themes for this
+        window, if the system supports them.  Use with care since usually the
+        themes represent the appearance chosen by the user to be used for all
+        applications on the system.
         """
         return _core_.Window_SetBackgroundColour(*args, **kwargs)
 
@@ -8171,6 +8181,25 @@ class Control(Window):
         """
         return _core_.Control_SetLabel(*args, **kwargs)
 
+    def GetAdjustMinSizeFlag(*args, **kwargs):
+        """
+        GetAdjustMinSizeFlag(self) -> bool
+
+        Returns whether the minsize should be adjusted for this control when
+        `SetLabel` or `SetFont` are called.
+        """
+        return _core_.Control_GetAdjustMinSizeFlag(*args, **kwargs)
+
+    def SetAdjustMinSizeFlag(*args, **kwargs):
+        """
+        SetAdjustMinSizeFlag(self, bool adjust)
+
+        By default controls will readjust their size and minsize when
+        `SetLabel` or `SetFont` are called.  This flag will allow you to
+        control this behavior.
+        """
+        return _core_.Control_SetAdjustMinSizeFlag(*args, **kwargs)
+
     def GetClassDefaultAttributes(*args, **kwargs):
         """
         GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
index aa830ba40d89e33b10d2f07626e6d129c3bce5d5..bfb0c459f800e79771b87d22feb2aeb05bdeec8a 100644 (file)
@@ -22337,6 +22337,41 @@ static PyObject *_wrap_Window_MoveXY(PyObject *self, PyObject *args, PyObject *k
 }
 
 
+static PyObject *_wrap_Window_SetBestFittingSize(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxWindow *arg1 = (wxWindow *) 0 ;
+    wxSize const &arg2_defvalue = wxDefaultSize ;
+    wxSize *arg2 = (wxSize *) &arg2_defvalue ;
+    wxSize temp2 ;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "size", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:Window_SetBestFittingSize",kwnames,&obj0,&obj1)) goto fail;
+    if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxWindow,
+    SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
+    if (obj1) {
+        {
+            arg2 = &temp2;
+            if ( ! wxSize_helper(obj1, &arg2)) SWIG_fail;
+        }
+    }
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        (arg1)->SetBestFittingSize((wxSize const &)*arg2);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    Py_INCREF(Py_None); resultobj = Py_None;
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_Window_Raise(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxWindow *arg1 = (wxWindow *) 0 ;
@@ -33060,6 +33095,63 @@ static PyObject *_wrap_Control_SetLabel(PyObject *self, PyObject *args, PyObject
 }
 
 
+static PyObject *_wrap_Control_GetAdjustMinSizeFlag(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxControl *arg1 = (wxControl *) 0 ;
+    bool result;
+    PyObject * obj0 = 0 ;
+    char *kwnames[] = {
+        (char *) "self", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Control_GetAdjustMinSizeFlag",kwnames,&obj0)) goto fail;
+    if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxControl,
+    SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        result = (bool)(arg1)->GetAdjustMinSizeFlag();
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    {
+        resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
+    }
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
+static PyObject *_wrap_Control_SetAdjustMinSizeFlag(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxControl *arg1 = (wxControl *) 0 ;
+    bool arg2 ;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "adjust", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Control_SetAdjustMinSizeFlag",kwnames,&obj0,&obj1)) goto fail;
+    if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxControl,
+    SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
+    arg2 = (bool) SWIG_AsBool(obj1); 
+    if (PyErr_Occurred()) SWIG_fail;
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        (arg1)->SetAdjustMinSizeFlag(arg2);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    Py_INCREF(Py_None); resultobj = Py_None;
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_Control_GetClassDefaultAttributes(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     int arg1 = (int) wxWINDOW_VARIANT_NORMAL ;
@@ -40586,6 +40678,7 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"Window_SetSizeWH", (PyCFunction) _wrap_Window_SetSizeWH, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Window_Move", (PyCFunction) _wrap_Window_Move, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Window_MoveXY", (PyCFunction) _wrap_Window_MoveXY, METH_VARARGS | METH_KEYWORDS },
+        { (char *)"Window_SetBestFittingSize", (PyCFunction) _wrap_Window_SetBestFittingSize, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Window_Raise", (PyCFunction) _wrap_Window_Raise, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Window_Lower", (PyCFunction) _wrap_Window_Lower, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Window_SetClientSize", (PyCFunction) _wrap_Window_SetClientSize, METH_VARARGS | METH_KEYWORDS },
@@ -40893,6 +40986,8 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"Control_Command", (PyCFunction) _wrap_Control_Command, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Control_GetLabel", (PyCFunction) _wrap_Control_GetLabel, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Control_SetLabel", (PyCFunction) _wrap_Control_SetLabel, METH_VARARGS | METH_KEYWORDS },
+        { (char *)"Control_GetAdjustMinSizeFlag", (PyCFunction) _wrap_Control_GetAdjustMinSizeFlag, METH_VARARGS | METH_KEYWORDS },
+        { (char *)"Control_SetAdjustMinSizeFlag", (PyCFunction) _wrap_Control_SetAdjustMinSizeFlag, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Control_GetClassDefaultAttributes", (PyCFunction) _wrap_Control_GetClassDefaultAttributes, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Control_swigregister", Control_swigregister, METH_VARARGS },
         { (char *)"ItemContainer_Append", (PyCFunction) _wrap_ItemContainer_Append, METH_VARARGS | METH_KEYWORDS },
index 9708c52a8697600ccb8bef968aca2c3e47b6f98f..7ef8d0c3cdc978803deec587d28790eda95b0147 100644 (file)
@@ -1252,6 +1252,11 @@ public:
             PyObject* ro;
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",row,col));
             if (ro) {
+                if (!PyString_Check(ro) && !PyUnicode_Check(ro)) {
+                    PyObject* old = ro;
+                    ro = PyObject_Str(ro);
+                    Py_DECREF(old);
+                }
                 rval = Py2wxString(ro);
                 Py_DECREF(ro);
             }
@@ -1381,7 +1386,7 @@ bool wxGridCellCoords_helper(PyObject* source, wxGridCellCoords** obj) {
 
 bool wxGridCellCoords_typecheck(PyObject* source) {
     void* ptr;
-    
+
     if (wxPySwigInstance_Check(source) &&
         wxPyConvertSwigPtr(source, (void **)&ptr, wxT("wxGridCellCoords")))
         return True;
@@ -1389,7 +1394,7 @@ bool wxGridCellCoords_typecheck(PyObject* source) {
     PyErr_Clear();
     if (PySequence_Check(source) && PySequence_Length(source) == 2)
         return True;
-    
+
     return False;
 }
 
index 90b1f7df19094aee086b72ea0ef113f0f7f6538c..0ba42d94c4a5f01f10b7d93a9d5a824b6940ceb3 100644 (file)
@@ -5671,6 +5671,15 @@ class Window(EvtHandler):
         """
         return _core_.Window_MoveXY(*args, **kwargs)
 
+    def SetBestFittingSize(*args, **kwargs):
+        """
+        SetBestFittingSize(self, Size size=DefaultSize)
+
+        A 'Smart' SetSize that will fill in default size components with the
+        window's *best size* values.  Also set's the minsize for use with sizers.
+        """
+        return _core_.Window_SetBestFittingSize(*args, **kwargs)
+
     def Raise(*args, **kwargs):
         """
         Raise(self)
@@ -6772,16 +6781,17 @@ class Window(EvtHandler):
         Sets the background colour of the window.  Returns True if the colour
         was changed.  The background colour is usually painted by the default
         EVT_ERASE_BACKGROUND event handler function under Windows and
-        automatically under GTK.
+        automatically under GTK.  Using `wx.NullColour` will reset the window
+        to the default background colour.
 
         Note that setting the background colour may not cause an immediate
-        refresh, so you may wish to call ClearBackground or Refresh after
+        refresh, so you may wish to call `ClearBackground` or `Refresh` after
         calling this function.
 
-        Use this function with care under GTK+ as the new appearance of the
-        window might not look equally well when used with themes, i.e GTK+'s
-        ability to change its look as the user wishes with run-time loadable
-        modules.
+        Using this function will disable attempts to use themes for this
+        window, if the system supports them.  Use with care since usually the
+        themes represent the appearance chosen by the user to be used for all
+        applications on the system.
         """
         return _core_.Window_SetBackgroundColour(*args, **kwargs)
 
@@ -8240,6 +8250,25 @@ class Control(Window):
         """
         return _core_.Control_SetLabel(*args, **kwargs)
 
+    def GetAdjustMinSizeFlag(*args, **kwargs):
+        """
+        GetAdjustMinSizeFlag(self) -> bool
+
+        Returns whether the minsize should be adjusted for this control when
+        `SetLabel` or `SetFont` are called.
+        """
+        return _core_.Control_GetAdjustMinSizeFlag(*args, **kwargs)
+
+    def SetAdjustMinSizeFlag(*args, **kwargs):
+        """
+        SetAdjustMinSizeFlag(self, bool adjust)
+
+        By default controls will readjust their size and minsize when
+        `SetLabel` or `SetFont` are called.  This flag will allow you to
+        control this behavior.
+        """
+        return _core_.Control_SetAdjustMinSizeFlag(*args, **kwargs)
+
     def GetClassDefaultAttributes(*args, **kwargs):
         """GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes"""
         return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
index b2a33b085c768aba3e6835e068bc16fb15624a89..c59c1f4d5c2dfe7a8a69da563997f3d8b6844621 100644 (file)
@@ -22335,6 +22335,41 @@ static PyObject *_wrap_Window_MoveXY(PyObject *self, PyObject *args, PyObject *k
 }
 
 
+static PyObject *_wrap_Window_SetBestFittingSize(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxWindow *arg1 = (wxWindow *) 0 ;
+    wxSize const &arg2_defvalue = wxDefaultSize ;
+    wxSize *arg2 = (wxSize *) &arg2_defvalue ;
+    wxSize temp2 ;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "size", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:Window_SetBestFittingSize",kwnames,&obj0,&obj1)) goto fail;
+    if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxWindow,
+    SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
+    if (obj1) {
+        {
+            arg2 = &temp2;
+            if ( ! wxSize_helper(obj1, &arg2)) SWIG_fail;
+        }
+    }
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        (arg1)->SetBestFittingSize((wxSize const &)*arg2);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    Py_INCREF(Py_None); resultobj = Py_None;
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_Window_Raise(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxWindow *arg1 = (wxWindow *) 0 ;
@@ -33560,6 +33595,63 @@ static PyObject *_wrap_Control_SetLabel(PyObject *self, PyObject *args, PyObject
 }
 
 
+static PyObject *_wrap_Control_GetAdjustMinSizeFlag(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxControl *arg1 = (wxControl *) 0 ;
+    bool result;
+    PyObject * obj0 = 0 ;
+    char *kwnames[] = {
+        (char *) "self", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Control_GetAdjustMinSizeFlag",kwnames,&obj0)) goto fail;
+    if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxControl,
+    SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        result = (bool)(arg1)->GetAdjustMinSizeFlag();
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    {
+        resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
+    }
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
+static PyObject *_wrap_Control_SetAdjustMinSizeFlag(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxControl *arg1 = (wxControl *) 0 ;
+    bool arg2 ;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "adjust", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Control_SetAdjustMinSizeFlag",kwnames,&obj0,&obj1)) goto fail;
+    if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxControl,
+    SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
+    arg2 = (bool) SWIG_AsBool(obj1); 
+    if (PyErr_Occurred()) SWIG_fail;
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        (arg1)->SetAdjustMinSizeFlag(arg2);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    Py_INCREF(Py_None); resultobj = Py_None;
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_Control_GetClassDefaultAttributes(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     int arg1 = (int) wxWINDOW_VARIANT_NORMAL ;
@@ -41085,6 +41177,7 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"Window_SetSizeWH", (PyCFunction) _wrap_Window_SetSizeWH, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Window_Move", (PyCFunction) _wrap_Window_Move, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Window_MoveXY", (PyCFunction) _wrap_Window_MoveXY, METH_VARARGS | METH_KEYWORDS },
+        { (char *)"Window_SetBestFittingSize", (PyCFunction) _wrap_Window_SetBestFittingSize, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Window_Raise", (PyCFunction) _wrap_Window_Raise, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Window_Lower", (PyCFunction) _wrap_Window_Lower, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Window_SetClientSize", (PyCFunction) _wrap_Window_SetClientSize, METH_VARARGS | METH_KEYWORDS },
@@ -41408,6 +41501,8 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"Control_Command", (PyCFunction) _wrap_Control_Command, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Control_GetLabel", (PyCFunction) _wrap_Control_GetLabel, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Control_SetLabel", (PyCFunction) _wrap_Control_SetLabel, METH_VARARGS | METH_KEYWORDS },
+        { (char *)"Control_GetAdjustMinSizeFlag", (PyCFunction) _wrap_Control_GetAdjustMinSizeFlag, METH_VARARGS | METH_KEYWORDS },
+        { (char *)"Control_SetAdjustMinSizeFlag", (PyCFunction) _wrap_Control_SetAdjustMinSizeFlag, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Control_GetClassDefaultAttributes", (PyCFunction) _wrap_Control_GetClassDefaultAttributes, METH_VARARGS | METH_KEYWORDS },
         { (char *)"Control_swigregister", Control_swigregister, METH_VARARGS },
         { (char *)"ItemContainer_Append", (PyCFunction) _wrap_ItemContainer_Append, METH_VARARGS | METH_KEYWORDS },
index 1ee05fc6a8f44e244b960ef0a1339d45629f6c78..d9dda4c5b77d27bd43c8d63b3d57da776e675c2d 100644 (file)
@@ -1252,6 +1252,11 @@ public:
             PyObject* ro;
             ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",row,col));
             if (ro) {
+                if (!PyString_Check(ro) && !PyUnicode_Check(ro)) {
+                    PyObject* old = ro;
+                    ro = PyObject_Str(ro);
+                    Py_DECREF(old);
+                }
                 rval = Py2wxString(ro);
                 Py_DECREF(ro);
             }
@@ -1381,7 +1386,7 @@ bool wxGridCellCoords_helper(PyObject* source, wxGridCellCoords** obj) {
 
 bool wxGridCellCoords_typecheck(PyObject* source) {
     void* ptr;
-    
+
     if (wxPySwigInstance_Check(source) &&
         wxPyConvertSwigPtr(source, (void **)&ptr, wxT("wxGridCellCoords")))
         return True;
@@ -1389,7 +1394,7 @@ bool wxGridCellCoords_typecheck(PyObject* source) {
     PyErr_Clear();
     if (PySequence_Check(source) && PySequence_Length(source) == 2)
         return True;
-    
+
     return False;
 }