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;
int width = size.x;
int height = size.y;
- if (id == -1)
- m_windowId = NewControlId();
- else
- m_windowId = id;
-
if ( width == -1 && bitmap.Ok())
- width = bitmap.GetWidth() + 2*m_marginX;
+ width = bitmap.GetWidth() + 2*m_marginX;
if ( height == -1 && bitmap.Ok())
- height = bitmap.GetHeight() + 2*m_marginY;
+ height = bitmap.GetHeight() + 2*m_marginY;
Rect bounds ;
Str255 title ;
const wxValidator& validator,
const wxString& name)
{
+ if ( !wxButtonBase::Create(parent, id, pos, size, style, validator, name) )
+ return false;
+
Rect bounds ;
Str255 title ;
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;
int width = size.x;
int height = size.y;
- if (id == -1)
- m_windowId = NewControlId();
- else
- m_windowId = id;
-
if ( width == -1 && bitmap.Ok())
- width = bitmap.GetWidth() + 2*m_marginX;
+ width = bitmap.GetWidth() + 2*m_marginX;
if ( height == -1 && bitmap.Ok())
- height = bitmap.GetHeight() + 2*m_marginY;
+ height = bitmap.GetHeight() + 2*m_marginY;
Rect bounds ;
Str255 title ;
const wxValidator& validator,
const wxString& name)
{
+ if ( !wxButtonBase::Create(parent, id, pos, size, style, validator, name) )
+ return false;
+
Rect bounds ;
Str255 title ;
const wxValidator& validator,
const wxString& name)
{
+ if ( !wxCheckBoxBase::Create(parent, id, pos, size, style, validator, name) )
+ return false;
+
Rect bounds ;
Str255 title ;
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;
const wxValidator& validator,
const wxString& name)
{
+ if ( !wxChoiceBase::Create(parent, id, pos, size, style, validator, name) )
+ return false;
+
Rect bounds ;
Str255 title ;
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 ;
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 ;
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;
long style,
const wxString& name)
{
+ if ( !wxNotebookBase::Create(parent, id, pos, size, style, name) )
+ return false;
+
Rect bounds ;
Str255 title ;
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;
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);
const wxValidator& validator,
const wxString& name)
{
+ if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
+ return false;
+
Rect bounds ;
Str255 title ;
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 ;
-
+
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() ;
- return TRUE;
+ return TRUE;
}
wxScrollBar::~wxScrollBar()
const wxValidator& validator,
const wxString& name)
{
+ if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
+ return false;
+
Rect bounds ;
Str255 title ;
SInt16 procID;
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;
long style,
const wxString& name)
{
+ if ( !wxControl::Create(parent, id, pos, size,
+ style, wxDefaultValidator, name) )
+ return false;
+
Rect bounds ;
Str255 title ;
long style,
const wxString &name)
{
+ if ( !wxStaticLineBase::Create(parent, id, pos, size,
+ style, wxDefaultValidator, name) )
+ return false;
+
Rect bounds ;
Str255 title ;
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) ;
- 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 ) ;
- return ret;
+ return true;
}
const wxString punct = wxT(" ,.-;:!?");
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 ;
const wxValidator& validator,
const wxString& name)
{
+ if ( !wxCheckBoxBase::Create(parent, id, pos, size, style, validator, name) )
+ return false;
+
Rect bounds ;
Str255 title ;
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;
const wxValidator& validator,
const wxString& name)
{
+ if ( !wxChoiceBase::Create(parent, id, pos, size, style, validator, name) )
+ return false;
+
Rect bounds ;
Str255 title ;
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 ;
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 ;
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;
long style,
const wxString& name)
{
+ if ( !wxNotebookBase::Create(parent, id, pos, size, style, name) )
+ return false;
+
Rect bounds ;
Str255 title ;
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;
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);
const wxValidator& validator,
const wxString& name)
{
+ if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
+ return false;
+
Rect bounds ;
Str255 title ;
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 ;
-
+
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() ;
- return TRUE;
+ return TRUE;
}
wxScrollBar::~wxScrollBar()
const wxValidator& validator,
const wxString& name)
{
+ if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
+ return false;
+
Rect bounds ;
Str255 title ;
SInt16 procID;
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;
long style,
const wxString& name)
{
+ if ( !wxControl::Create(parent, id, pos, size,
+ style, wxDefaultValidator, name) )
+ return false;
+
Rect bounds ;
Str255 title ;
long style,
const wxString &name)
{
+ if ( !wxStaticLineBase::Create(parent, id, pos, size,
+ style, wxDefaultValidator, name) )
+ return false;
+
Rect bounds ;
Str255 title ;
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) ;
- 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 ) ;
- return ret;
+ return true;
}
const wxString punct = wxT(" ,.-;:!?");
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 ;