]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk1/statbox.cpp
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 #pragma implementation "statbox.h"
18 #include "wx/statbox.h"
23 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
27 IMPLEMENT_DYNAMIC_CLASS(wxStaticBox
,wxControl
)
29 wxStaticBox::wxStaticBox(void)
33 wxStaticBox::wxStaticBox( wxWindow
*parent
, wxWindowID id
, const wxString
&label
,
34 const wxPoint
&pos
, const wxSize
&size
,
35 long style
, const wxString
&name
)
37 Create( parent
, id
, label
, pos
, size
, style
, name
);
40 bool wxStaticBox::Create( wxWindow
*parent
, wxWindowID id
, const wxString
&label
,
41 const wxPoint
&pos
, const wxSize
&size
,
42 long style
, const wxString
&name
)
46 if (!PreCreation( parent
, pos
, size
) ||
47 !CreateBase( parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
))
49 wxFAIL_MSG( wxT("wxStaticBox creation failed") );
56 m_widget
= gtk_frame_new( (char*) NULL
);
58 m_widget
= gtk_frame_new( m_label
.mbc_str() );
60 m_parent
->DoAddChild( this );
66 SetFont( parent
->GetFont() );
68 SetBackgroundColour( parent
->GetBackgroundColour() );
69 SetForegroundColour( parent
->GetForegroundColour() );
76 void wxStaticBox::SetLabel( const wxString
&label
)
78 wxControl::SetLabel( label
);
79 GtkFrame
*frame
= GTK_FRAME( m_widget
);
80 gtk_frame_set_label( frame
, GetLabel().mbc_str() );
83 void wxStaticBox::ApplyWidgetStyle()
86 gtk_widget_set_style( m_widget
, m_widgetStyle
);
89 #endif // wxUSE_STATBOX