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