]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk1/statbox.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: gtk/statbox.cpp
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()
33 wxStaticBox::wxStaticBox( wxWindow
*parent
,
35 const wxString
&label
,
39 const wxString
& name
)
41 Create( parent
, id
, label
, pos
, size
, style
, name
);
44 bool wxStaticBox::Create( wxWindow
*parent
,
46 const wxString
& label
,
50 const wxString
& name
)
54 if (!PreCreation( parent
, pos
, size
) ||
55 !CreateBase( parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
))
57 wxFAIL_MSG( wxT("wxStaticBox creation failed") );
61 m_widget
= gtk_frame_new(m_label
.empty() ? (char *)NULL
: m_label
.mbc_str());
63 m_parent
->DoAddChild( this );
71 // need to set non default alignment?
73 if ( style
& wxALIGN_CENTER
)
75 else if ( style
& wxALIGN_RIGHT
)
81 gtk_frame_set_label_align(GTK_FRAME( m_widget
), xalign
, 0.0);
88 void wxStaticBox::SetLabel( const wxString
&label
)
90 wxControl::SetLabel( label
);
92 gtk_frame_set_label( GTK_FRAME( m_widget
), GetLabel().mbc_str() );
95 void wxStaticBox::ApplyWidgetStyle()
98 gtk_widget_set_style( m_widget
, m_widgetStyle
);
101 #endif // wxUSE_STATBOX