]> git.saurik.com Git - wxWidgets.git/commitdiff
use wxWindowBase::Create() instead of duplicating its code in MacPreControlCreate()
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 18 Aug 2003 23:57:34 +0000 (23:57 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 18 Aug 2003 23:57:34 +0000 (23:57 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23005 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

36 files changed:
src/mac/bmpbuttn.cpp
src/mac/button.cpp
src/mac/carbon/bmpbuttn.cpp
src/mac/carbon/button.cpp
src/mac/carbon/checkbox.cpp
src/mac/carbon/checklst.cpp
src/mac/carbon/choice.cpp
src/mac/carbon/control.cpp
src/mac/carbon/gauge.cpp
src/mac/carbon/listbox.cpp
src/mac/carbon/notebmac.cpp
src/mac/carbon/radiobox.cpp
src/mac/carbon/radiobut.cpp
src/mac/carbon/scrolbar.cpp
src/mac/carbon/slider.cpp
src/mac/carbon/spinbutt.cpp
src/mac/carbon/statbox.cpp
src/mac/carbon/statlmac.cpp
src/mac/carbon/stattext.cpp
src/mac/carbon/tabctrl.cpp
src/mac/checkbox.cpp
src/mac/checklst.cpp
src/mac/choice.cpp
src/mac/control.cpp
src/mac/gauge.cpp
src/mac/listbox.cpp
src/mac/notebmac.cpp
src/mac/radiobox.cpp
src/mac/radiobut.cpp
src/mac/scrolbar.cpp
src/mac/slider.cpp
src/mac/spinbutt.cpp
src/mac/statbox.cpp
src/mac/statlmac.cpp
src/mac/stattext.cpp
src/mac/tabctrl.cpp

index 046d54805851a0229afb0de44c4d63586a6c54e0..f29677665210d7a71aecda0a6ec3210ca45dcf44 100644 (file)
@@ -29,6 +29,10 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
            const wxValidator& validator,
            const wxString& name)
 {
            const wxValidator& validator,
            const wxString& name)
 {
+    if ( !wxBitmapButtonBase::Create(parent, id, _T(""), pos, size,
+                                     style, validator, name) )
+        return false;
+
     m_bmpNormal = bitmap;
  
     m_marginX = 0;
     m_bmpNormal = bitmap;
  
     m_marginX = 0;
@@ -39,16 +43,11 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
     int width = size.x;
     int height = size.y;
 
     int width = size.x;
     int height = size.y;
 
-    if (id == -1)
-        m_windowId = NewControlId();
-    else
-        m_windowId = id;
-
     if ( width == -1 && bitmap.Ok())
     if ( width == -1 && bitmap.Ok())
-    width = bitmap.GetWidth() + 2*m_marginX;
+        width = bitmap.GetWidth() + 2*m_marginX;
 
     if ( height == -1 && bitmap.Ok())
 
     if ( height == -1 && bitmap.Ok())
-    height = bitmap.GetHeight() + 2*m_marginY;
+        height = bitmap.GetHeight() + 2*m_marginY;
 
     Rect bounds ;
     Str255 title ;
 
     Rect bounds ;
     Str255 title ;
index aaf91f644e701b99b9ed2075f72b261e9d39aab8..253671b6fecd2ffdcab542a648ec84a63f5effb6 100644 (file)
@@ -34,6 +34,9 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
            const wxValidator& validator,
            const wxString& name)
 {
            const wxValidator& validator,
            const wxString& name)
 {
+    if ( !wxButtonBase::Create(parent, id, pos, size, style, validator, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
 
     Rect bounds ;
     Str255 title ;
 
index 046d54805851a0229afb0de44c4d63586a6c54e0..f29677665210d7a71aecda0a6ec3210ca45dcf44 100644 (file)
@@ -29,6 +29,10 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
            const wxValidator& validator,
            const wxString& name)
 {
            const wxValidator& validator,
            const wxString& name)
 {
+    if ( !wxBitmapButtonBase::Create(parent, id, _T(""), pos, size,
+                                     style, validator, name) )
+        return false;
+
     m_bmpNormal = bitmap;
  
     m_marginX = 0;
     m_bmpNormal = bitmap;
  
     m_marginX = 0;
@@ -39,16 +43,11 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
     int width = size.x;
     int height = size.y;
 
     int width = size.x;
     int height = size.y;
 
-    if (id == -1)
-        m_windowId = NewControlId();
-    else
-        m_windowId = id;
-
     if ( width == -1 && bitmap.Ok())
     if ( width == -1 && bitmap.Ok())
-    width = bitmap.GetWidth() + 2*m_marginX;
+        width = bitmap.GetWidth() + 2*m_marginX;
 
     if ( height == -1 && bitmap.Ok())
 
     if ( height == -1 && bitmap.Ok())
-    height = bitmap.GetHeight() + 2*m_marginY;
+        height = bitmap.GetHeight() + 2*m_marginY;
 
     Rect bounds ;
     Str255 title ;
 
     Rect bounds ;
     Str255 title ;
index aaf91f644e701b99b9ed2075f72b261e9d39aab8..253671b6fecd2ffdcab542a648ec84a63f5effb6 100644 (file)
@@ -34,6 +34,9 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
            const wxValidator& validator,
            const wxString& name)
 {
            const wxValidator& validator,
            const wxString& name)
 {
+    if ( !wxButtonBase::Create(parent, id, pos, size, style, validator, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
 
     Rect bounds ;
     Str255 title ;
 
index cb43f117af17dbcd87106c4d951267b402719da2..3df5c00d9e1b795b8a47cb0b8357bae54b8dde9c 100644 (file)
@@ -31,6 +31,9 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
            const wxValidator& validator,
            const wxString& name)
 {
            const wxValidator& validator,
            const wxString& name)
 {
+    if ( !wxCheckBoxBase::Create(parent, id, pos, size, style, validator, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
     
     Rect bounds ;
     Str255 title ;
     
index d987d94994c68a38b96df15ea58f9b51a5924acc..ee04357b8ff4d84b422cec76dd06e492cce412db 100644 (file)
@@ -183,6 +183,10 @@ bool wxCheckListBox::Create(wxWindow *parent,
                             const wxValidator& validator,
                             const wxString &name)
 {
                             const wxValidator& validator,
                             const wxString &name)
 {
+    if ( !wxCheckListBoxBase::Create(parent, id, pos, size,
+                                     n, choices, style, validator, name) )
+        return false;
+
     m_noItems = 0 ; // this will be increased by our append command
     m_selected = 0;
     
     m_noItems = 0 ; // this will be increased by our append command
     m_selected = 0;
     
index c187d9ecc75ef2f05485fc205c175616a5ef0bed..2275ce10c07d3b6a3b0c12013453260ff3d053e6 100644 (file)
@@ -46,6 +46,9 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
            const wxValidator& validator,
            const wxString& name)
 {
            const wxValidator& validator,
            const wxString& name)
 {
+    if ( !wxChoiceBase::Create(parent, id, pos, size, style, validator, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
 
     Rect bounds ;
     Str255 title ;
 
index b4cd648a48d2dfb4b955cea07619835e42e00d78..84e0822c5478bc7fedaac4008ef2eb0a1b51e020 100644 (file)
@@ -300,23 +300,8 @@ void wxControl::MacPreControlCreate( wxWindow *parent, wxWindowID id, wxString l
              const wxString& name , WXRECTPTR outBounds , unsigned char* maclabel ) 
 {
     m_label = label ;
              const wxString& name , WXRECTPTR outBounds , unsigned char* maclabel ) 
 {
     m_label = label ;
-  SetName(name);
-  if ( &validator )
-    SetValidator(validator);
-
-  m_windowStyle = style;
-  parent->AddChild(this);
-
-  m_backgroundColour = parent->GetBackgroundColour() ;
-  m_foregroundColour = parent->GetForegroundColour() ;
-
-  if (id == -1)
-      m_windowId = NewControlId();
-  else
-      m_windowId = id;
-
-   // These sizes will be adjusted in MacPostControlCreate
 
 
+    // These sizes will be adjusted in MacPostControlCreate
     m_width = size.x ;
     m_height = size.y ;
     m_x = pos.x ;
     m_width = size.x ;
     m_height = size.y ;
     m_x = pos.x ;
index de7dd8c90c9b14a848fe061486751cde114fb10a..01a557e17cc671672067b0ae1cb54ecf6771c735 100644 (file)
@@ -29,6 +29,9 @@ bool wxGauge::Create(wxWindow *parent, wxWindowID id,
            const wxValidator& validator,
            const wxString& name)
 {
            const wxValidator& validator,
            const wxString& name)
 {
+    if ( !wxGaugeBase::Create(parent, id, range, pos, s, style, validator, name) )
+        return false;
+
     wxSize size = s ;
     Rect bounds ;
     Str255 title ;
     wxSize size = s ;
     Rect bounds ;
     Str255 title ;
index 9daaf275e82b77581269dbbd28b1698d24d3a1b7..5240ef76be94d96be09909d790a70ed8258a2712 100644 (file)
@@ -202,6 +202,9 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
                        const wxValidator& validator,
                        const wxString& name)
 {
                        const wxValidator& validator,
                        const wxString& name)
 {
+    if ( !wxListBoxBase::Create(parent, id, pos, size, style, validator, name) )
+        return false;
+
     m_noItems = 0 ; // this will be increased by our append command
     m_selected = 0;
 
     m_noItems = 0 ; // this will be increased by our append command
     m_selected = 0;
 
index 4e8a87a9b451e9ed9f10b30790346a052667f954..5ed215b7aba37d211f628a4081170f29f9145c27 100644 (file)
@@ -175,6 +175,9 @@ bool wxNotebook::Create(wxWindow *parent,
                         long style,
                         const wxString& name)
 {
                         long style,
                         const wxString& name)
 {
+    if ( !wxNotebookBase::Create(parent, id, pos, size, style, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
 
     Rect bounds ;
     Str255 title ;
 
index f7874dd09985593b6b517b1440cfe88df157fc76..bfc9b87637f4f078c4cbf824a18fe70dc97ba679 100644 (file)
@@ -102,6 +102,9 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
                         int majorDim, long style,
                         const wxValidator& val, const wxString& name)
 {
                         int majorDim, long style,
                         const wxValidator& val, const wxString& name)
 {
+    if ( !wxControl::Create(parent, id, pos, size, style, val, name) )
+        return false;
+
     int i;
     
     m_noItems = n;
     int i;
     
     m_noItems = n;
@@ -124,8 +127,15 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
     
     for (i = 0; i < n; i++)
     {
     
     for (i = 0; i < n; i++)
     {
-        wxRadioButton *radBtn = new wxRadioButton(this, NewControlId(), wxStripMenuCodes(choices[i]),wxPoint(5,20*i+10),
-            wxDefaultSize , i == 0 ? wxRB_GROUP : 0 ) ;
+        wxRadioButton *radBtn = new wxRadioButton
+                                    (
+                                        this,
+                                        wxID_ANY,
+                                        wxStripMenuCodes(choices[i]),
+                                        wxPoint(5,20*i+10),
+                                        wxDefaultSize,
+                                        i == 0 ? wxRB_GROUP : 0
+                                    );
         if ( i == 0 )
             m_radioButtonCycle = radBtn ;
         //        m_radioButtonCycle=radBtn->AddInCycle(m_radioButtonCycle);
         if ( i == 0 )
             m_radioButtonCycle = radBtn ;
         //        m_radioButtonCycle=radBtn->AddInCycle(m_radioButtonCycle);
index 45c734c58bba56613eec24593fcde2815c84a058..991c8be68f7d0ea0db3d04e12889f50b016be9c3 100644 (file)
@@ -30,6 +30,9 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
            const wxValidator& validator,
            const wxString& name)
 {
            const wxValidator& validator,
            const wxString& name)
 {
+    if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
     
     Rect bounds ;
     Str255 title ;
     
index eef2a84c54ba8d7c7e22defdbbce4e5dbe0d16af..5ddda761a063cf7966d281704f4068a9162971e3 100644 (file)
@@ -40,24 +40,25 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
            const wxValidator& validator,
            const wxString& name)
 {
            const wxValidator& validator,
            const wxString& name)
 {
-  if (!parent)
-      return FALSE;
-    
+    if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
+        return FALSE;
+
     Rect bounds ;
     Str255 title ;
     Rect bounds ;
     Str255 title ;
-    
+
     MacPreControlCreate( parent , id ,  wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ;
 
     MacPreControlCreate( parent , id ,  wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ;
 
-    m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , true , 0 , 0 , 100, 
-        kControlScrollBarLiveProc , (long) this ) ;
-    
+    m_macControl = ::NewControl(MAC_WXHWND(parent->MacGetRootWindow()) ,
+                                &bounds , title , true , 0 , 0 , 100, 
+                                kControlScrollBarLiveProc , (long) this) ;
+
     wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
 
     ::SetControlAction( (ControlHandle) m_macControl , wxMacLiveScrollbarActionUPP ) ;
 
     MacPostControlCreate() ;
 
     wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
 
     ::SetControlAction( (ControlHandle) m_macControl , wxMacLiveScrollbarActionUPP ) ;
 
     MacPostControlCreate() ;
 
-  return TRUE;
+    return TRUE;
 }
 
 wxScrollBar::~wxScrollBar()
 }
 
 wxScrollBar::~wxScrollBar()
index 96fdf5102cdce3f4faef2455c58f9f2f05809f17..4bd4bab5325fa0f31f5847b5ff6e3bcc0ad4e429 100644 (file)
@@ -57,6 +57,9 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
                       const wxValidator& validator,
                       const wxString& name)
 {
                       const wxValidator& validator,
                       const wxString& name)
 {
+    if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
     SInt16 procID;
     Rect bounds ;
     Str255 title ;
     SInt16 procID;
index 57a2a4a0d7ac3ada445b31773d88030803a888ea..f8dcca8bd9ad8ab8c3e5a42cb6df012b01bbdd30 100644 (file)
@@ -38,6 +38,10 @@ wxSpinButton::wxSpinButton()
 bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
         long style, const wxString& name)
 {
 bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
         long style, const wxString& name)
 {
+    if ( !wxSpinButtonBase::Create(parent, id, pos, size,
+                                   style, wxDefaultValidator, name) )
+        return false;
+
     m_min = 0;
     m_max = 100;
     
     m_min = 0;
     m_max = 100;
     
index e494e9e709d3bfec985ac4488bdd6ca7c03c880a..13c7daf6696a6d4b7d0132fdc283538f92e5e504 100644 (file)
@@ -38,6 +38,10 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID id,
            long style,
            const wxString& name)
 {
            long style,
            const wxString& name)
 {
+    if ( !wxControl::Create(parent, id, pos, size,
+                            style, wxDefaultValidator, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
     
     Rect bounds ;
     Str255 title ;
     
index 30305cc1cf7d1855524b4c849acf4c13ad218bb1..a7a116ba571cc17d391ba59d5f5edf3b2f0bb31e 100644 (file)
@@ -49,6 +49,10 @@ bool wxStaticLine::Create( wxWindow *parent,
                            long style,
                            const wxString &name)
 {
                            long style,
                            const wxString &name)
 {
+    if ( !wxStaticLineBase::Create(parent, id, pos, size,
+                                   style, wxDefaultValidator, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
     
     Rect bounds ;
     Str255 title ;
     
index b2a7d103da4694cb0a3837cf72c7a4d009193e86..2d81d33b16655270647a48e9d3640f7784e72291 100644 (file)
@@ -41,22 +41,17 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
            long style,
            const wxString& name)
 {
            long style,
            const wxString& name)
 {
-    SetName(name);
-    m_backgroundColour = parent->GetBackgroundColour() ;
-    m_foregroundColour = parent->GetForegroundColour() ;
-
-    if ( id == -1 )
-        m_windowId = (int)NewControlId();
-    else
-        m_windowId = id;
-
-    m_windowStyle = style;
     m_label = wxStripMenuCodes(label) ;
 
     m_label = wxStripMenuCodes(label) ;
 
-    bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name );
+    if ( !wxControl::Create( parent, id, pos, size, style,
+                             wxDefaultValidator , name ) )
+    {
+        return false;
+    }
+
     SetBestSize( size ) ;
 
     SetBestSize( size ) ;
 
-    return ret;
+    return true;
 }
 
 const wxString punct = wxT(" ,.-;:!?");
 }
 
 const wxString punct = wxT(" ,.-;:!?");
index 4fcf069286d65a65df2d67c365ceec20acd27eee..f879b78447ee48b39f29593830cdf32cd40949b2 100644 (file)
@@ -34,6 +34,10 @@ wxTabCtrl::wxTabCtrl()
 bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
             long style, const wxString& name)
 {
 bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
             long style, const wxString& name)
 {
+    if ( !wxControl::Create(parent, id, pos, size,
+                            style, wxDefaultValidator, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
     
     Rect bounds ;
     Str255 title ;
     
index cb43f117af17dbcd87106c4d951267b402719da2..3df5c00d9e1b795b8a47cb0b8357bae54b8dde9c 100644 (file)
@@ -31,6 +31,9 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
            const wxValidator& validator,
            const wxString& name)
 {
            const wxValidator& validator,
            const wxString& name)
 {
+    if ( !wxCheckBoxBase::Create(parent, id, pos, size, style, validator, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
     
     Rect bounds ;
     Str255 title ;
     
index d987d94994c68a38b96df15ea58f9b51a5924acc..ee04357b8ff4d84b422cec76dd06e492cce412db 100644 (file)
@@ -183,6 +183,10 @@ bool wxCheckListBox::Create(wxWindow *parent,
                             const wxValidator& validator,
                             const wxString &name)
 {
                             const wxValidator& validator,
                             const wxString &name)
 {
+    if ( !wxCheckListBoxBase::Create(parent, id, pos, size,
+                                     n, choices, style, validator, name) )
+        return false;
+
     m_noItems = 0 ; // this will be increased by our append command
     m_selected = 0;
     
     m_noItems = 0 ; // this will be increased by our append command
     m_selected = 0;
     
index c187d9ecc75ef2f05485fc205c175616a5ef0bed..2275ce10c07d3b6a3b0c12013453260ff3d053e6 100644 (file)
@@ -46,6 +46,9 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
            const wxValidator& validator,
            const wxString& name)
 {
            const wxValidator& validator,
            const wxString& name)
 {
+    if ( !wxChoiceBase::Create(parent, id, pos, size, style, validator, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
 
     Rect bounds ;
     Str255 title ;
 
index b4cd648a48d2dfb4b955cea07619835e42e00d78..84e0822c5478bc7fedaac4008ef2eb0a1b51e020 100644 (file)
@@ -300,23 +300,8 @@ void wxControl::MacPreControlCreate( wxWindow *parent, wxWindowID id, wxString l
              const wxString& name , WXRECTPTR outBounds , unsigned char* maclabel ) 
 {
     m_label = label ;
              const wxString& name , WXRECTPTR outBounds , unsigned char* maclabel ) 
 {
     m_label = label ;
-  SetName(name);
-  if ( &validator )
-    SetValidator(validator);
-
-  m_windowStyle = style;
-  parent->AddChild(this);
-
-  m_backgroundColour = parent->GetBackgroundColour() ;
-  m_foregroundColour = parent->GetForegroundColour() ;
-
-  if (id == -1)
-      m_windowId = NewControlId();
-  else
-      m_windowId = id;
-
-   // These sizes will be adjusted in MacPostControlCreate
 
 
+    // These sizes will be adjusted in MacPostControlCreate
     m_width = size.x ;
     m_height = size.y ;
     m_x = pos.x ;
     m_width = size.x ;
     m_height = size.y ;
     m_x = pos.x ;
index de7dd8c90c9b14a848fe061486751cde114fb10a..01a557e17cc671672067b0ae1cb54ecf6771c735 100644 (file)
@@ -29,6 +29,9 @@ bool wxGauge::Create(wxWindow *parent, wxWindowID id,
            const wxValidator& validator,
            const wxString& name)
 {
            const wxValidator& validator,
            const wxString& name)
 {
+    if ( !wxGaugeBase::Create(parent, id, range, pos, s, style, validator, name) )
+        return false;
+
     wxSize size = s ;
     Rect bounds ;
     Str255 title ;
     wxSize size = s ;
     Rect bounds ;
     Str255 title ;
index 9daaf275e82b77581269dbbd28b1698d24d3a1b7..5240ef76be94d96be09909d790a70ed8258a2712 100644 (file)
@@ -202,6 +202,9 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
                        const wxValidator& validator,
                        const wxString& name)
 {
                        const wxValidator& validator,
                        const wxString& name)
 {
+    if ( !wxListBoxBase::Create(parent, id, pos, size, style, validator, name) )
+        return false;
+
     m_noItems = 0 ; // this will be increased by our append command
     m_selected = 0;
 
     m_noItems = 0 ; // this will be increased by our append command
     m_selected = 0;
 
index 4e8a87a9b451e9ed9f10b30790346a052667f954..5ed215b7aba37d211f628a4081170f29f9145c27 100644 (file)
@@ -175,6 +175,9 @@ bool wxNotebook::Create(wxWindow *parent,
                         long style,
                         const wxString& name)
 {
                         long style,
                         const wxString& name)
 {
+    if ( !wxNotebookBase::Create(parent, id, pos, size, style, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
 
     Rect bounds ;
     Str255 title ;
 
index f7874dd09985593b6b517b1440cfe88df157fc76..bfc9b87637f4f078c4cbf824a18fe70dc97ba679 100644 (file)
@@ -102,6 +102,9 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
                         int majorDim, long style,
                         const wxValidator& val, const wxString& name)
 {
                         int majorDim, long style,
                         const wxValidator& val, const wxString& name)
 {
+    if ( !wxControl::Create(parent, id, pos, size, style, val, name) )
+        return false;
+
     int i;
     
     m_noItems = n;
     int i;
     
     m_noItems = n;
@@ -124,8 +127,15 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
     
     for (i = 0; i < n; i++)
     {
     
     for (i = 0; i < n; i++)
     {
-        wxRadioButton *radBtn = new wxRadioButton(this, NewControlId(), wxStripMenuCodes(choices[i]),wxPoint(5,20*i+10),
-            wxDefaultSize , i == 0 ? wxRB_GROUP : 0 ) ;
+        wxRadioButton *radBtn = new wxRadioButton
+                                    (
+                                        this,
+                                        wxID_ANY,
+                                        wxStripMenuCodes(choices[i]),
+                                        wxPoint(5,20*i+10),
+                                        wxDefaultSize,
+                                        i == 0 ? wxRB_GROUP : 0
+                                    );
         if ( i == 0 )
             m_radioButtonCycle = radBtn ;
         //        m_radioButtonCycle=radBtn->AddInCycle(m_radioButtonCycle);
         if ( i == 0 )
             m_radioButtonCycle = radBtn ;
         //        m_radioButtonCycle=radBtn->AddInCycle(m_radioButtonCycle);
index 45c734c58bba56613eec24593fcde2815c84a058..991c8be68f7d0ea0db3d04e12889f50b016be9c3 100644 (file)
@@ -30,6 +30,9 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
            const wxValidator& validator,
            const wxString& name)
 {
            const wxValidator& validator,
            const wxString& name)
 {
+    if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
     
     Rect bounds ;
     Str255 title ;
     
index eef2a84c54ba8d7c7e22defdbbce4e5dbe0d16af..5ddda761a063cf7966d281704f4068a9162971e3 100644 (file)
@@ -40,24 +40,25 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
            const wxValidator& validator,
            const wxString& name)
 {
            const wxValidator& validator,
            const wxString& name)
 {
-  if (!parent)
-      return FALSE;
-    
+    if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
+        return FALSE;
+
     Rect bounds ;
     Str255 title ;
     Rect bounds ;
     Str255 title ;
-    
+
     MacPreControlCreate( parent , id ,  wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ;
 
     MacPreControlCreate( parent , id ,  wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ;
 
-    m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , true , 0 , 0 , 100, 
-        kControlScrollBarLiveProc , (long) this ) ;
-    
+    m_macControl = ::NewControl(MAC_WXHWND(parent->MacGetRootWindow()) ,
+                                &bounds , title , true , 0 , 0 , 100, 
+                                kControlScrollBarLiveProc , (long) this) ;
+
     wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
 
     ::SetControlAction( (ControlHandle) m_macControl , wxMacLiveScrollbarActionUPP ) ;
 
     MacPostControlCreate() ;
 
     wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
 
     ::SetControlAction( (ControlHandle) m_macControl , wxMacLiveScrollbarActionUPP ) ;
 
     MacPostControlCreate() ;
 
-  return TRUE;
+    return TRUE;
 }
 
 wxScrollBar::~wxScrollBar()
 }
 
 wxScrollBar::~wxScrollBar()
index 96fdf5102cdce3f4faef2455c58f9f2f05809f17..4bd4bab5325fa0f31f5847b5ff6e3bcc0ad4e429 100644 (file)
@@ -57,6 +57,9 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
                       const wxValidator& validator,
                       const wxString& name)
 {
                       const wxValidator& validator,
                       const wxString& name)
 {
+    if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
     SInt16 procID;
     Rect bounds ;
     Str255 title ;
     SInt16 procID;
index 57a2a4a0d7ac3ada445b31773d88030803a888ea..f8dcca8bd9ad8ab8c3e5a42cb6df012b01bbdd30 100644 (file)
@@ -38,6 +38,10 @@ wxSpinButton::wxSpinButton()
 bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
         long style, const wxString& name)
 {
 bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
         long style, const wxString& name)
 {
+    if ( !wxSpinButtonBase::Create(parent, id, pos, size,
+                                   style, wxDefaultValidator, name) )
+        return false;
+
     m_min = 0;
     m_max = 100;
     
     m_min = 0;
     m_max = 100;
     
index e494e9e709d3bfec985ac4488bdd6ca7c03c880a..13c7daf6696a6d4b7d0132fdc283538f92e5e504 100644 (file)
@@ -38,6 +38,10 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID id,
            long style,
            const wxString& name)
 {
            long style,
            const wxString& name)
 {
+    if ( !wxControl::Create(parent, id, pos, size,
+                            style, wxDefaultValidator, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
     
     Rect bounds ;
     Str255 title ;
     
index 30305cc1cf7d1855524b4c849acf4c13ad218bb1..a7a116ba571cc17d391ba59d5f5edf3b2f0bb31e 100644 (file)
@@ -49,6 +49,10 @@ bool wxStaticLine::Create( wxWindow *parent,
                            long style,
                            const wxString &name)
 {
                            long style,
                            const wxString &name)
 {
+    if ( !wxStaticLineBase::Create(parent, id, pos, size,
+                                   style, wxDefaultValidator, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
     
     Rect bounds ;
     Str255 title ;
     
index b2a7d103da4694cb0a3837cf72c7a4d009193e86..2d81d33b16655270647a48e9d3640f7784e72291 100644 (file)
@@ -41,22 +41,17 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
            long style,
            const wxString& name)
 {
            long style,
            const wxString& name)
 {
-    SetName(name);
-    m_backgroundColour = parent->GetBackgroundColour() ;
-    m_foregroundColour = parent->GetForegroundColour() ;
-
-    if ( id == -1 )
-        m_windowId = (int)NewControlId();
-    else
-        m_windowId = id;
-
-    m_windowStyle = style;
     m_label = wxStripMenuCodes(label) ;
 
     m_label = wxStripMenuCodes(label) ;
 
-    bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name );
+    if ( !wxControl::Create( parent, id, pos, size, style,
+                             wxDefaultValidator , name ) )
+    {
+        return false;
+    }
+
     SetBestSize( size ) ;
 
     SetBestSize( size ) ;
 
-    return ret;
+    return true;
 }
 
 const wxString punct = wxT(" ,.-;:!?");
 }
 
 const wxString punct = wxT(" ,.-;:!?");
index 4fcf069286d65a65df2d67c365ceec20acd27eee..f879b78447ee48b39f29593830cdf32cd40949b2 100644 (file)
@@ -34,6 +34,10 @@ wxTabCtrl::wxTabCtrl()
 bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
             long style, const wxString& name)
 {
 bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
             long style, const wxString& name)
 {
+    if ( !wxControl::Create(parent, id, pos, size,
+                            style, wxDefaultValidator, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
     
     Rect bounds ;
     Str255 title ;