]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk/statbox.cpp
6610fad49d89a8592efdb917baa04923f00a7502
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: gtk/statbox.cpp
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
11 #pragma implementation "statbox.h"
14 // For compilers that support precompilation, includes "wx.h".
15 #include "wx/wxprec.h"
19 #include "wx/statbox.h"
20 #include "wx/gtk/private.h"
25 //-----------------------------------------------------------------------------
27 //-----------------------------------------------------------------------------
29 IMPLEMENT_DYNAMIC_CLASS(wxStaticBox
, wxControl
)
31 wxStaticBox::wxStaticBox()
35 wxStaticBox::wxStaticBox( wxWindow
*parent
,
37 const wxString
&label
,
41 const wxString
& name
)
43 Create( parent
, id
, label
, pos
, size
, style
, name
);
46 bool wxStaticBox::Create( wxWindow
*parent
,
48 const wxString
& label
,
52 const wxString
& name
)
56 if (!PreCreation( parent
, pos
, size
) ||
57 !CreateBase( parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
))
59 wxFAIL_MSG( wxT("wxStaticBox creation failed") );
63 wxControl::SetLabel(label
);
65 m_widget
= gtk_frame_new(m_label
.empty() ? (char *)NULL
: (const char*) wxGTK_CONV( m_label
) );
67 m_parent
->DoAddChild( this );
73 // need to set non default alignment?
75 if ( style
& wxALIGN_CENTER
)
77 else if ( style
& wxALIGN_RIGHT
)
83 gtk_frame_set_label_align(GTK_FRAME( m_widget
), xalign
, 0.0);
90 void wxStaticBox::SetLabel( const wxString
&label
)
92 wxControl::SetLabel( label
);
94 gtk_frame_set_label( GTK_FRAME( m_widget
),
95 m_label
.empty() ? (char *)NULL
: (const char*) wxGTK_CONV( m_label
) );
98 void wxStaticBox::ApplyWidgetStyle()
101 gtk_widget_set_style( m_widget
, m_widgetStyle
);
104 #endif // wxUSE_STATBOX