]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/gizmos/statpict.cpp
added support for colour cursors in wxGTK (patch 1655576)
[wxWidgets.git] / contrib / src / gizmos / statpict.cpp
index 1886d3c54e93508a1f51eb0e370da559a6517b1a..b8c1cdf99d03fda4244a8c22d857ed7f396eee73 100644 (file)
@@ -9,20 +9,15 @@
 // Licence:       wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // Licence:       wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-  #pragma implementation "statpict.h"
-#endif
-
 #include "wx/wxprec.h"
 #include "wx/defs.h"
 
 #include "wx/gizmos/statpict.h"
 #include "wx/dcclient.h"
 
 #include "wx/wxprec.h"
 #include "wx/defs.h"
 
 #include "wx/gizmos/statpict.h"
 #include "wx/dcclient.h"
 
-#if !USE_SHARED_LIBRARY
 IMPLEMENT_DYNAMIC_CLASS(wxStaticPicture, wxControl)
 IMPLEMENT_DYNAMIC_CLASS(wxStaticPicture, wxControl)
-#endif
-
+WXDLLIMPEXP_GIZMOS const wxChar * wxStaticPictureNameStr = wxT("staticPicture");
+    
 /*
  * wxStaticPicture
  */
 /*
  * wxStaticPicture
  */
@@ -43,9 +38,9 @@ bool wxStaticPicture::Create(wxWindow *parent, wxWindowID id,
     wxSize size = s ;
     if ( bitmap.Ok() )
     {
     wxSize size = s ;
     if ( bitmap.Ok() )
     {
-        if ( size.x == -1 )
+        if ( size.x == wxDefaultCoord )
             size.x = bitmap.GetWidth() ;
             size.x = bitmap.GetWidth() ;
-        if ( size.y == -1 )
+        if ( size.y == wxDefaultCoord )
             size.y = bitmap.GetHeight() ;
     }
 
             size.y = bitmap.GetHeight() ;
     }
 
@@ -63,7 +58,7 @@ bool wxStaticPicture::Create(wxWindow *parent, wxWindowID id,
         OriginalImage = Bitmap.ConvertToImage();
 #endif
 
         OriginalImage = Bitmap.ConvertToImage();
 #endif
 
-    if ( id == -1 )
+    if ( id == wxID_ANY )
         m_windowId = (int)NewControlId();
     else
         m_windowId = id;
         m_windowId = (int)NewControlId();
     else
         m_windowId = id;
@@ -72,7 +67,7 @@ bool wxStaticPicture::Create(wxWindow *parent, wxWindowID id,
 
     bool ret = wxControl::Create( parent, id, pos, size, style, wxDefaultValidator, name );
 
 
     bool ret = wxControl::Create( parent, id, pos, size, style, wxDefaultValidator, name );
 
-    SetBestSize( size ) ;
+    SetInitialSize( size ) ;
 
     return ret;
 }
 
     return ret;
 }
@@ -94,7 +89,6 @@ void wxStaticPicture::OnPaint(wxPaintEvent& WXUNUSED(event))
 
     wxPaintDC dc( this );
     PrepareDC( dc );
 
     wxPaintDC dc( this );
     PrepareDC( dc );
-    dc.BeginDrawing();
 
     wxSize sz = GetSize();
     wxSize bmpsz( Bitmap.GetWidth(), Bitmap.GetHeight() );
 
     wxSize sz = GetSize();
     wxSize bmpsz( Bitmap.GetWidth(), Bitmap.GetHeight() );
@@ -150,9 +144,5 @@ void wxStaticPicture::OnPaint(wxPaintEvent& WXUNUSED(event))
     }
     else
         dc.DrawBitmap( Bitmap, pos.x, pos.y );
     }
     else
         dc.DrawBitmap( Bitmap, pos.x, pos.y );
-
-    dc.EndDrawing();
 }
 
 }
 
-//WXDLLEXPORT_DATA(const wxChar *) wxStaticPictureNameStr = wxT("message");
-const wxChar * wxStaticPictureNameStr = wxT("message");