]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: statbox.cpp | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
5 | // Id: $Id$ | |
6 | // Copyright: (c) 1998 Robert Roebling | |
7 | // Licence: wxWindows licence | |
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 | { | |
24 | } | |
25 | ||
26 | wxStaticBox::wxStaticBox( wxWindow *parent, wxWindowID id, const wxString &label, | |
27 | const wxPoint &pos, const wxSize &size, | |
28 | long style, const wxString &name ) | |
29 | { | |
30 | Create( parent, id, label, pos, size, style, name ); | |
31 | } | |
32 | ||
33 | bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label, | |
34 | const wxPoint &pos, const wxSize &size, | |
35 | long style, const wxString &name ) | |
36 | { | |
37 | m_needParent = TRUE; | |
38 | ||
39 | PreCreation( parent, id, pos, size, style, name ); | |
40 | ||
41 | m_widget = gtk_frame_new(m_label); | |
42 | ||
43 | m_parent->AddChild( this ); | |
44 | ||
45 | (m_parent->m_insertCallback)( m_parent, this ); | |
46 | ||
47 | PostCreation(); | |
48 | ||
49 | SetLabel(label); | |
50 | ||
51 | SetBackgroundColour( parent->GetBackgroundColour() ); | |
52 | SetForegroundColour( parent->GetForegroundColour() ); | |
53 | ||
54 | Show( TRUE ); | |
55 | ||
56 | return TRUE; | |
57 | } | |
58 | ||
59 | void wxStaticBox::SetLabel( const wxString &label ) | |
60 | { | |
61 | wxControl::SetLabel( label ); | |
62 | GtkFrame *frame = GTK_FRAME( m_widget ); | |
63 | gtk_frame_set_label( frame, GetLabel() ); | |
64 | } | |
65 | ||
66 | void wxStaticBox::ApplyWidgetStyle() | |
67 | { | |
68 | SetWidgetStyle(); | |
69 | gtk_widget_set_style( m_widget, m_widgetStyle ); | |
70 | } | |
71 |