]> git.saurik.com Git - wxWidgets.git/blame - src/gtk/statline.cpp
Sorted and added StaticBox, StaticLine
[wxWidgets.git] / src / gtk / statline.cpp
CommitLineData
b0351fc9
RR
1/////////////////////////////////////////////////////////////////////////////
2// Name: statline.cpp
3// Purpose:
4// Author: Robert Roebling
5// Id: $Id$
6// Copyright: (c) 1998 Robert Roebling
c50f1fb9 7// Licence: wxWindows licence
b0351fc9
RR
8/////////////////////////////////////////////////////////////////////////////
9
14f355c2 10#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
b0351fc9
RR
11#pragma implementation "statline.h"
12#endif
13
14f355c2
VS
14// For compilers that support precompilation, includes "wx.h".
15#include "wx/wxprec.h"
16
b0351fc9
RR
17#include "wx/statline.h"
18
dcf924a3
RR
19#if wxUSE_STATLINE
20
b0351fc9
RR
21#include "gdk/gdk.h"
22#include "gtk/gtk.h"
23
24//-----------------------------------------------------------------------------
25// wxStaticLine
26//-----------------------------------------------------------------------------
27
c50f1fb9 28IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl)
b0351fc9 29
c50f1fb9 30wxStaticLine::wxStaticLine()
b0351fc9
RR
31{
32}
33
34wxStaticLine::wxStaticLine( wxWindow *parent, wxWindowID id,
c50f1fb9
VZ
35 const wxPoint &pos, const wxSize &size,
36 long style, const wxString &name )
b0351fc9
RR
37{
38 Create( parent, id, pos, size, style, name );
39}
40
c50f1fb9
VZ
41bool wxStaticLine::Create( wxWindow *parent, wxWindowID id,
42 const wxPoint &pos, const wxSize &size,
43 long style, const wxString &name )
b0351fc9
RR
44{
45 m_needParent = TRUE;
c50f1fb9 46
4dcaf11a
RR
47 if (!PreCreation( parent, pos, size ) ||
48 !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
49 {
223d09f6 50 wxFAIL_MSG( wxT("wxStaticLine creation failed") );
3ca6a5f0 51 return FALSE;
4dcaf11a 52 }
b0351fc9 53
c50f1fb9 54 if ( IsVertical() )
073478b3 55 {
b0351fc9 56 m_widget = gtk_vseparator_new();
3ca6a5f0
BP
57 if (size.x == -1)
58 {
59 wxSize new_size( size );
60 new_size.x = 4;
61 SetSize( new_size );
62 }
073478b3 63 }
b0351fc9 64 else
073478b3 65 {
b0351fc9 66 m_widget = gtk_hseparator_new();
3ca6a5f0
BP
67 if (size.y == -1)
68 {
69 wxSize new_size( size );
70 new_size.y = 4;
71 SetSize( new_size );
72 }
073478b3 73 }
c50f1fb9 74
f03fc89f 75 m_parent->DoAddChild( this );
c50f1fb9 76
b0351fc9 77 PostCreation();
c50f1fb9 78
b0351fc9 79 Show( TRUE );
c50f1fb9 80
b0351fc9
RR
81 return TRUE;
82}
83
c50f1fb9 84#endif