]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk1/statbox.cpp
0d4f598a2ae6457ad6288c9daef50af5a7a6fcbe
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 #pragma implementation "statbox.h"
14 #include "wx/statbox.h"
21 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
25 IMPLEMENT_DYNAMIC_CLASS(wxStaticBox
,wxControl
)
27 wxStaticBox::wxStaticBox(void)
31 wxStaticBox::wxStaticBox( wxWindow
*parent
, wxWindowID id
, const wxString
&label
,
32 const wxPoint
&pos
, const wxSize
&size
,
33 long style
, const wxString
&name
)
35 Create( parent
, id
, label
, pos
, size
, style
, name
);
38 bool wxStaticBox::Create( wxWindow
*parent
, wxWindowID id
, const wxString
&label
,
39 const wxPoint
&pos
, const wxSize
&size
,
40 long style
, const wxString
&name
)
44 if (!PreCreation( parent
, pos
, size
) ||
45 !CreateBase( parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
))
47 wxFAIL_MSG( T("wxStaticBox creation failed") );
53 m_widget
= gtk_frame_new(m_label
.mbc_str());
55 m_parent
->DoAddChild( this );
61 SetBackgroundColour( parent
->GetBackgroundColour() );
62 SetForegroundColour( parent
->GetForegroundColour() );
63 SetFont( parent
->GetFont() );
70 void wxStaticBox::SetLabel( const wxString
&label
)
72 wxControl::SetLabel( label
);
73 GtkFrame
*frame
= GTK_FRAME( m_widget
);
74 gtk_frame_set_label( frame
, GetLabel().mbc_str() );
77 void wxStaticBox::ApplyWidgetStyle()
80 gtk_widget_set_style( m_widget
, m_widgetStyle
);