]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_sizers.i
Better conversion functions for integral and floating point types,
[wxWidgets.git] / wxPython / src / _sizers.i
index 9b4db7b3f9362e3198b45af645ffbf3065a1fcef..f6c73d0b76921913a91a5ec5a73be0e5e642d89b 100644 (file)
@@ -51,6 +51,8 @@ public:
 
     void SetProportion( int proportion );
     int GetProportion();
+    %pythoncode { SetOption = SetProportion}
+    %pythoncode { GetOption = GetProportion}
     
     void SetFlag( int flag );
     int GetFlag();
@@ -174,11 +176,11 @@ public:
                   PyObject* userData=NULL) {
             
             wxPyUserData* data = NULL;
-            wxPyBeginBlockThreads();
+            bool blocked = wxPyBeginBlockThreads();
             wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, True, False);
             if ( userData && (info.window || info.sizer || info.gotSize) )
                 data = new wxPyUserData(userData);
-            wxPyEndBlockThreads();
+            wxPyEndBlockThreads(blocked);
             
             // Now call the real Add method if a valid item type was found
             if ( info.window )
@@ -195,11 +197,11 @@ public:
                      int border=0, PyObject* userData=NULL) {
 
             wxPyUserData* data = NULL;
-            wxPyBeginBlockThreads();
+            bool blocked = wxPyBeginBlockThreads();
             wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, True, False);
             if ( userData && (info.window || info.sizer || info.gotSize) )
                 data = new wxPyUserData(userData);
-            wxPyEndBlockThreads();
+            wxPyEndBlockThreads(blocked);
             
             // Now call the real Insert method if a valid item type was found
             if ( info.window )
@@ -217,11 +219,11 @@ public:
                      PyObject* userData=NULL) {
 
             wxPyUserData* data = NULL;
-            wxPyBeginBlockThreads();
+            bool blocked = wxPyBeginBlockThreads();
             wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, True, False);
             if ( userData && (info.window || info.sizer || info.gotSize) )
                 data = new wxPyUserData(userData);
-            wxPyEndBlockThreads();
+            wxPyEndBlockThreads(blocked);
             
             // Now call the real Prepend method if a valid item type was found
             if ( info.window )
@@ -235,9 +237,9 @@ public:
 
         
         bool Remove(PyObject* item) {
-            wxPyBeginBlockThreads();
+            bool blocked = wxPyBeginBlockThreads();
             wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, True);
-            wxPyEndBlockThreads();
+            wxPyEndBlockThreads(blocked);
             if ( info.window )
                 return self->Remove(info.window);
             else if ( info.sizer )
@@ -250,9 +252,9 @@ public:
 
         
         void _SetItemMinSize(PyObject* item, const wxSize& size) {
-            wxPyBeginBlockThreads();
+            bool blocked = wxPyBeginBlockThreads();
             wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, True);
-            wxPyEndBlockThreads();
+            wxPyEndBlockThreads(blocked);
             if ( info.window )
                 self->SetItemMinSize(info.window, size);
             else if ( info.sizer )
@@ -274,7 +276,7 @@ public:
                 childinfo = (childinfo, )
             self.Add(*childinfo)
 
-    # for backwards compatibility only, do not use in new code
+    %# for backwards compatibility only, please do not use in new code
     AddWindow = AddSizer = AddSpacer = Add
     PrependWindow = PrependSizer = PrependSpacer = Prepend
     InsertWindow = InsertSizer = InsertSpacer = Insert
@@ -382,7 +384,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPySizer, wxSizer);
 
 class wxPySizer : public wxSizer {
 public:
-    %addtofunc wxPySizer "self._setCallbackInfo(self, PySizer);self._setOORInfo(self)"
+    %pythonAppend wxPySizer "self._setCallbackInfo(self, PySizer);self._setOORInfo(self)"
 
     wxPySizer();
     void _setCallbackInfo(PyObject* self, PyObject* _class);
@@ -394,7 +396,7 @@ public:
 
 class  wxBoxSizer : public wxSizer {
 public:
-    %addtofunc wxBoxSizer "self._setOORInfo(self)"
+    %pythonAppend wxBoxSizer "self._setOORInfo(self)"
 
     wxBoxSizer(int orient = wxHORIZONTAL);
 
@@ -409,7 +411,7 @@ public:
 
 class  wxStaticBoxSizer : public wxBoxSizer {
 public:
-    %addtofunc wxStaticBoxSizer "self._setOORInfo(self)"
+    %pythonAppend wxStaticBoxSizer "self._setOORInfo(self)"
 
     wxStaticBoxSizer(wxStaticBox *box, int orient = wxHORIZONTAL);
     
@@ -424,7 +426,7 @@ public:
 class wxGridSizer: public wxSizer
 {
 public:
-    %addtofunc wxGridSizer "self._setOORInfo(self)"
+    %pythonAppend wxGridSizer "self._setOORInfo(self)"
 
     wxGridSizer( int rows=1, int cols=0, int vgap=0, int hgap=0 );
 
@@ -460,7 +462,7 @@ enum wxFlexSizerGrowMode
 class wxFlexGridSizer: public wxGridSizer
 {
 public:
-    %addtofunc wxFlexGridSizer "self._setOORInfo(self)"
+    %pythonAppend wxFlexGridSizer "self._setOORInfo(self)"
 
     wxFlexGridSizer( int rows=1, int cols=0, int vgap=0, int hgap=0 );