]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk/control.cpp
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"
14 #include "wx/control.h"
18 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
22 IMPLEMENT_DYNAMIC_CLASS(wxControl
, wxWindow
)
24 wxControl::wxControl()
29 bool wxControl::Create( wxWindow
*parent
,
35 const wxValidator
& validator
,
37 const wxString
&name
)
39 bool ret
= wxWindow::Create(parent
, id
, pos
, size
, style
, name
);
42 SetValidator(validator
);
48 void wxControl::SetLabel( const wxString
&label
)
51 for ( const wxChar
*pc
= label
; *pc
!= wxT('\0'); pc
++ )
53 if ( *pc
== wxT('&') )
56 #if 0 // it would be unused anyhow for now - kbd interface not done yet
57 if ( *pc
!= wxT('&') ) m_chAccel
= *pc
;
64 wxString
wxControl::GetLabel() const
70 wxSize
wxControl::DoGetBestSize() const
72 // Do not return any arbitrary default value...
73 wxASSERT_MSG( m_widget
, wxT("DoGetBestSize called before creation") );
78 (* GTK_WIDGET_CLASS( GTK_OBJECT(m_widget
)->klass
)->size_request
)
81 return wxSize(req
.width
, req
.height
);