]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: statbox.cpp | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
a81258be RR |
5 | // Id: $Id$ |
6 | // Copyright: (c) 1998 Robert Roebling | |
904f68c7 | 7 | // Licence: wxWindows licence |
c801d85f KB |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
10 | #ifdef __GNUG__ | |
11 | #pragma implementation "statbox.h" | |
12 | #endif | |
13 | ||
14 | #include "wx/statbox.h" | |
15 | ||
16 | //----------------------------------------------------------------------------- | |
17 | // wxStaticBox | |
18 | //----------------------------------------------------------------------------- | |
19 | ||
20 | IMPLEMENT_DYNAMIC_CLASS(wxStaticBox,wxControl) | |
21 | ||
22 | wxStaticBox::wxStaticBox(void) | |
23 | { | |
3f659fd6 | 24 | } |
c801d85f | 25 | |
904f68c7 VZ |
26 | wxStaticBox::wxStaticBox( wxWindow *parent, wxWindowID id, const wxString &label, |
27 | const wxPoint &pos, const wxSize &size, | |
debe6624 | 28 | long style, const wxString &name ) |
c801d85f | 29 | { |
1ecc4d80 | 30 | Create( parent, id, label, pos, size, style, name ); |
3f659fd6 | 31 | } |
c801d85f | 32 | |
904f68c7 VZ |
33 | bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label, |
34 | const wxPoint &pos, const wxSize &size, | |
debe6624 | 35 | long style, const wxString &name ) |
c801d85f | 36 | { |
1ecc4d80 | 37 | m_needParent = TRUE; |
904f68c7 | 38 | |
1ecc4d80 | 39 | PreCreation( parent, id, pos, size, style, name ); |
c801d85f | 40 | |
1ecc4d80 RR |
41 | m_isStaticBox = TRUE; |
42 | ||
43 | m_widget = gtk_frame_new(m_label); | |
904f68c7 | 44 | |
1ecc4d80 | 45 | m_parent->AddChild( this ); |
6ca41e57 | 46 | |
1ecc4d80 | 47 | (m_parent->m_insertCallback)( m_parent, this ); |
6ca41e57 | 48 | |
1ecc4d80 | 49 | PostCreation(); |
904f68c7 | 50 | |
1ecc4d80 | 51 | SetLabel(label); |
b4071e91 | 52 | |
1ecc4d80 RR |
53 | SetBackgroundColour( parent->GetBackgroundColour() ); |
54 | SetForegroundColour( parent->GetForegroundColour() ); | |
58614078 | 55 | |
1ecc4d80 | 56 | Show( TRUE ); |
904f68c7 | 57 | |
1ecc4d80 | 58 | return TRUE; |
3f659fd6 | 59 | } |
d3904ceb RR |
60 | |
61 | void wxStaticBox::SetLabel( const wxString &label ) | |
62 | { | |
1ecc4d80 RR |
63 | wxControl::SetLabel( label ); |
64 | GtkFrame *frame = GTK_FRAME( m_widget ); | |
65 | gtk_frame_set_label( frame, GetLabel() ); | |
d3904ceb | 66 | } |
58614078 RR |
67 | |
68 | void wxStaticBox::ApplyWidgetStyle() | |
69 | { | |
1ecc4d80 RR |
70 | SetWidgetStyle(); |
71 | gtk_widget_set_style( m_widget, m_widgetStyle ); | |
58614078 RR |
72 | } |
73 |