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