]>
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"
19 #include "wx/gtk/private.h"
24 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
28 IMPLEMENT_DYNAMIC_CLASS(wxStaticBox
, wxControl
)
30 wxStaticBox::wxStaticBox()
34 wxStaticBox::wxStaticBox( wxWindow
*parent
,
36 const wxString
&label
,
40 const wxString
& name
)
42 Create( parent
, id
, label
, pos
, size
, style
, name
);
45 bool wxStaticBox::Create( wxWindow
*parent
,
47 const wxString
& label
,
51 const wxString
& name
)
55 if (!PreCreation( parent
, pos
, size
) ||
56 !CreateBase( parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
))
58 wxFAIL_MSG( wxT("wxStaticBox creation failed") );
62 wxControl::SetLabel(label
);
64 m_widget
= gtk_frame_new(m_label
.empty() ? (char *)NULL
: (const char*) wxGTK_CONV( m_label
) );
66 m_parent
->DoAddChild( this );
72 // need to set non default alignment?
74 if ( style
& wxALIGN_CENTER
)
76 else if ( style
& wxALIGN_RIGHT
)
82 gtk_frame_set_label_align(GTK_FRAME( m_widget
), xalign
, 0.0);
89 void wxStaticBox::SetLabel( const wxString
&label
)
91 wxControl::SetLabel( label
);
93 gtk_frame_set_label( GTK_FRAME( m_widget
),
94 m_label
.empty() ? (char *)NULL
: (const char*) wxGTK_CONV( m_label
) );
97 void wxStaticBox::ApplyWidgetStyle()
100 gtk_widget_set_style( m_widget
, m_widgetStyle
);
103 #endif // wxUSE_STATBOX