]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk/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") );
64 m_widget
= gtk_frame_new( (char*) NULL
);
66 m_widget
= gtk_frame_new( m_label
.mbc_str() );
68 m_parent
->DoAddChild( this );
76 // need to set non default alignment?
78 if ( style
& wxALIGN_CENTER
)
80 else if ( style
& wxALIGN_RIGHT
)
86 gtk_frame_set_label_align(GTK_FRAME( m_widget
), xalign
, 0.0);
93 void wxStaticBox::SetLabel( const wxString
&label
)
95 wxControl::SetLabel( label
);
97 gtk_frame_set_label( GTK_FRAME( m_widget
), GetLabel().mbc_str() );
100 void wxStaticBox::ApplyWidgetStyle()
103 gtk_widget_set_style( m_widget
, m_widgetStyle
);
106 #endif // wxUSE_STATBOX