]> git.saurik.com Git - wxWidgets.git/blame - src/gtk1/control.cpp
wxPostScriptDC::DrawText now uses descent to determine baseline (instead of rough...
[wxWidgets.git] / src / gtk1 / control.cpp
CommitLineData
c801d85f
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: control.cpp
3// Purpose:
4// Author: Robert Roebling
dbf858b5 5// Id: $Id$
01111366 6// Copyright: (c) 1998 Robert Roebling, Julian Smart and Vadim Zeitlin
32c77a71 7// Licence: wxWindows licence
c801d85f
KB
8/////////////////////////////////////////////////////////////////////////////
9
10#ifdef __GNUG__
11#pragma implementation "control.h"
12#endif
13
14#include "wx/control.h"
15
071a2d78 16#include <gtk/gtk.h>
034be888 17
c801d85f
KB
18//-----------------------------------------------------------------------------
19// wxControl
20//-----------------------------------------------------------------------------
21
9abe166a 22IMPLEMENT_DYNAMIC_CLASS(wxControl, wxWindow)
c801d85f 23
31528cd3 24wxControl::wxControl()
c801d85f 25{
b292e2f5 26 m_needParent = TRUE;
6de97a3b 27}
c801d85f 28
31528cd3
VZ
29wxControl::wxControl( wxWindow *parent,
30 wxWindowID id,
31 const wxPoint &pos,
32 const wxSize &size,
33 long style,
34 const wxString &name )
c801d85f 35{
9abe166a 36 (void)Create(parent, id, pos, size, style, name);
6de97a3b 37}
c801d85f 38
c801d85f
KB
39void wxControl::SetLabel( const wxString &label )
40{
d9ea011f 41 m_label.Empty();
223d09f6 42 for ( const wxChar *pc = label; *pc != wxT('\0'); pc++ )
b292e2f5 43 {
223d09f6 44 if ( *pc == wxT('&') )
31528cd3 45 {
b292e2f5 46 pc++; // skip it
32c77a71 47#if 0 // it would be unused anyhow for now - kbd interface not done yet
223d09f6 48 if ( *pc != wxT('&') ) m_chAccel = *pc;
32c77a71 49#endif
b292e2f5
RR
50 }
51 m_label << *pc;
32c77a71 52 }
6de97a3b 53}
c801d85f 54
9abe166a 55wxString wxControl::GetLabel() const
c801d85f 56{
b292e2f5 57 return m_label;
6de97a3b 58}
c801d85f
KB
59
60
f68586e5
VZ
61wxSize wxControl::DoGetBestSize() const
62{
63 GtkRequisition req;
64 (* GTK_WIDGET_CLASS( GTK_OBJECT(m_widget)->klass )->size_request )
65 (m_widget, &req );
66
67 return wxSize(req.width, req.height);
68}
69