]> git.saurik.com Git - wxWidgets.git/blob - src/gtk/statline.cpp
use GTK-specific method to delete selection
[wxWidgets.git] / src / gtk / statline.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/gtk/statline.cpp
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
12
13 #include "wx/statline.h"
14
15 #if wxUSE_STATLINE
16
17 #include <gtk/gtk.h>
18 #include "wx/gtk/private/gtk2-compat.h"
19
20 //-----------------------------------------------------------------------------
21 // wxStaticLine
22 //-----------------------------------------------------------------------------
23
24 wxStaticLine::wxStaticLine()
25 {
26 }
27
28 wxStaticLine::wxStaticLine( wxWindow *parent, wxWindowID id,
29 const wxPoint &pos, const wxSize &size,
30 long style, const wxString &name )
31 {
32 Create( parent, id, pos, size, style, name );
33 }
34
35 bool wxStaticLine::Create( wxWindow *parent, wxWindowID id,
36 const wxPoint &pos, const wxSize &size,
37 long style, const wxString &name )
38 {
39 if (!PreCreation( parent, pos, size ) ||
40 !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
41 {
42 wxFAIL_MSG( wxT("wxStaticLine creation failed") );
43 return FALSE;
44 }
45
46 const bool isVertical = IsVertical();
47 m_widget = gtk_separator_new(GtkOrientation(isVertical));
48 g_object_ref(m_widget);
49 if (isVertical)
50 {
51 if (size.x == -1)
52 {
53 wxSize new_size( size );
54 new_size.x = 4;
55 SetSize( new_size );
56 }
57 }
58 else
59 {
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_separator_new(GTK_ORIENTATION_VERTICAL));
80 }
81
82 #endif