]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_button.i
reSWIGged
[wxWidgets.git] / wxPython / src / _button.i
index 2826dd75a864feac79c747d54a25293bf86dad3f..f09a479885652092516d3094185b93d5b6cec50f 100644 (file)
@@ -58,15 +58,19 @@ Events
 :see: `wx.BitmapButton`
 ");
 
+MustHaveApp(wxButton);
+
 class wxButton : public wxControl
 {
 public:
     %pythonAppend wxButton         "self._setOORInfo(self)"
     %pythonAppend wxButton()       ""
+    %typemap(out) wxButton*;    // turn off this typemap
 
 
     DocCtorStr(
-        wxButton(wxWindow* parent, wxWindowID id, const wxString& label,
+        wxButton(wxWindow* parent, wxWindowID id=-1,
+                 const wxString& label=wxPyEmptyString,
                  const wxPoint& pos = wxDefaultPosition,
                  const wxSize& size = wxDefaultSize,
                  long style = 0,
@@ -79,8 +83,13 @@ public:
         "Precreate a Button for 2-phase creation.", "",
         PreButton);
 
+    // Turn it back on again
+    %typemap(out) wxButton* { $result = wxPyMake_wxObject($1, $owner); }
+
+
     DocDeclStr(
-        bool , Create(wxWindow* parent, wxWindowID id, const wxString& label,
+        bool , Create(wxWindow* parent, wxWindowID id=-1,
+                      const wxString& label=wxPyEmptyString,
                       const wxPoint& pos = wxDefaultPosition,
                       const wxSize& size = wxDefaultSize,
                       long style = 0,
@@ -143,14 +152,18 @@ Events
 :see: `wx.Button`, `wx.Bitmap`
 ");
 
+MustHaveApp(wxBitmapButton);
+
 class wxBitmapButton : public wxButton
 {
 public:
     %pythonAppend wxBitmapButton         "self._setOORInfo(self)"
     %pythonAppend wxBitmapButton()       ""
+    %typemap(out) wxBitmapButton*;    // turn off this typemap
 
     DocCtorStr(
-        wxBitmapButton(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
+        wxBitmapButton(wxWindow* parent, wxWindowID id=-1,
+                       const wxBitmap& bitmap = wxNullBitmap,
                        const wxPoint& pos = wxDefaultPosition,
                        const wxSize& size = wxDefaultSize,
                        long style = wxBU_AUTODRAW,
@@ -163,12 +176,17 @@ public:
         "Precreate a BitmapButton for 2-phase creation.", "",
         PreBitmapButton);
 
+    // Turn it back on again
+    %typemap(out) wxBitmapButton* { $result = wxPyMake_wxObject($1, $owner); }
+
+
     DocDeclStr(
-        bool , Create(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
-                const wxPoint& pos = wxDefaultPosition,
-                const wxSize& size = wxDefaultSize,
-                long style = wxBU_AUTODRAW,
-                const wxValidator& validator = wxDefaultValidator,
+        bool , Create(wxWindow* parent, wxWindowID id=-1,
+                      const wxBitmap& bitmap = wxNullBitmap,
+                      const wxPoint& pos = wxDefaultPosition,
+                      const wxSize& size = wxDefaultSize,
+                      long style = wxBU_AUTODRAW,
+                      const wxValidator& validator = wxDefaultValidator,
                       const wxString& name = wxPyButtonNameStr),
         "Acutally create the GUI BitmapButton for 2-phase creation.", "");