]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/statline.cpp
Applied #15375 to stop event-sending in generic wxSpinCtrl ctor (eco)
[wxWidgets.git] / src / gtk1 / statline.cpp
index 98bb5f04b5c3225cea85e54f7e69f5273ddc5a4a..335102c6c4383744107f8973810036995ab22bd2 100644 (file)
@@ -1,15 +1,13 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-// Name:        statline.cpp
+// Name:        src/gtk1/statline.cpp
 // Purpose:
 // Author:      Robert Roebling
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#pragma implementation "statline.h"
-#endif
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #include "wx/statline.h"
 
 
 #include "wx/statline.h"
 
@@ -22,8 +20,6 @@
 // wxStaticLine
 //-----------------------------------------------------------------------------
 
 // wxStaticLine
 //-----------------------------------------------------------------------------
 
-IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl)
-
 wxStaticLine::wxStaticLine()
 {
 }
 wxStaticLine::wxStaticLine()
 {
 }
@@ -41,20 +37,46 @@ bool wxStaticLine::Create( wxWindow *parent, wxWindowID id,
 {
     m_needParent = TRUE;
 
 {
     m_needParent = TRUE;
 
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( wxT("wxStaticLine creation failed") );
+        return FALSE;
+    }
 
     if ( IsVertical() )
 
     if ( IsVertical() )
+    {
         m_widget = gtk_vseparator_new();
         m_widget = gtk_vseparator_new();
+        if (size.x == -1)
+        {
+            wxSize new_size( size );
+            new_size.x = 4;
+            SetSize( new_size );
+        }
+    }
     else
     else
+    {
         m_widget = gtk_hseparator_new();
         m_widget = gtk_hseparator_new();
+        if (size.y == -1)
+        {
+            wxSize new_size( size );
+            new_size.y = 4;
+            SetSize( new_size );
+        }
+    }
 
     m_parent->DoAddChild( this );
 
 
     m_parent->DoAddChild( this );
 
-    PostCreation();
-
-    Show( TRUE );
+    PostCreation(size);
 
     return TRUE;
 }
 
 
     return TRUE;
 }
 
+// static
+wxVisualAttributes
+wxStaticLine::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
+{
+    return GetDefaultAttributesFromGTKWidget(gtk_vseparator_new);
+}
+
 #endif
 #endif