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