1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Vadim Zeitlin
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 #pragma implementation "control.h"
18 #include "wx/control.h"
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
26 IMPLEMENT_DYNAMIC_CLASS(wxControl
, wxWindow
)
28 wxControl::wxControl()
33 bool wxControl::Create( wxWindow
*parent
,
38 const wxValidator
& validator
,
39 const wxString
&name
)
41 bool ret
= wxWindow::Create(parent
, id
, pos
, size
, style
, name
);
44 SetValidator(validator
);
50 void wxControl::SetLabel( const wxString
&label
)
53 for ( const wxChar
*pc
= label
; *pc
!= wxT('\0'); pc
++ )
55 if ( *pc
== wxT('&') )
58 #if 0 // it would be unused anyhow for now - kbd interface not done yet
59 if ( *pc
!= wxT('&') ) m_chAccel
= *pc
;
66 wxString
wxControl::GetLabel() const
72 wxSize
wxControl::DoGetBestSize() const
74 // Do not return any arbitrary default value...
75 wxASSERT_MSG( m_widget
, wxT("DoGetBestSize called before creation") );
80 (* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(m_widget
) )->size_request
)
83 return wxSize(req
.width
, req
.height
);
86 #endif // wxUSE_CONTROLS