]> git.saurik.com Git - wxWidgets.git/blame - src/gtk1/statbox.cpp
Another solaris fix. :-<
[wxWidgets.git] / src / gtk1 / statbox.cpp
CommitLineData
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
83624f79
RR
16#include "gdk/gdk.h"
17#include "gtk/gtk.h"
18
c801d85f
KB
19//-----------------------------------------------------------------------------
20// wxStaticBox
21//-----------------------------------------------------------------------------
22
23IMPLEMENT_DYNAMIC_CLASS(wxStaticBox,wxControl)
24
25wxStaticBox::wxStaticBox(void)
26{
3f659fd6 27}
c801d85f 28
904f68c7
VZ
29wxStaticBox::wxStaticBox( wxWindow *parent, wxWindowID id, const wxString &label,
30 const wxPoint &pos, const wxSize &size,
debe6624 31 long style, const wxString &name )
c801d85f 32{
1ecc4d80 33 Create( parent, id, label, pos, size, style, name );
3f659fd6 34}
c801d85f 35
904f68c7
VZ
36bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label,
37 const wxPoint &pos, const wxSize &size,
debe6624 38 long style, const wxString &name )
c801d85f 39{
1ecc4d80 40 m_needParent = TRUE;
904f68c7 41
1ecc4d80 42 PreCreation( parent, id, pos, size, style, name );
c801d85f 43
1ecc4d80
RR
44 m_isStaticBox = TRUE;
45
46 m_widget = gtk_frame_new(m_label);
904f68c7 47
1ecc4d80 48 m_parent->AddChild( this );
6ca41e57 49
1ecc4d80 50 (m_parent->m_insertCallback)( m_parent, this );
6ca41e57 51
1ecc4d80 52 PostCreation();
904f68c7 53
1ecc4d80 54 SetLabel(label);
b4071e91 55
1ecc4d80
RR
56 SetBackgroundColour( parent->GetBackgroundColour() );
57 SetForegroundColour( parent->GetForegroundColour() );
58614078 58
1ecc4d80 59 Show( TRUE );
904f68c7 60
1ecc4d80 61 return TRUE;
3f659fd6 62}
d3904ceb
RR
63
64void wxStaticBox::SetLabel( const wxString &label )
65{
1ecc4d80
RR
66 wxControl::SetLabel( label );
67 GtkFrame *frame = GTK_FRAME( m_widget );
68 gtk_frame_set_label( frame, GetLabel() );
d3904ceb 69}
58614078
RR
70
71void wxStaticBox::ApplyWidgetStyle()
72{
1ecc4d80
RR
73 SetWidgetStyle();
74 gtk_widget_set_style( m_widget, m_widgetStyle );
58614078
RR
75}
76