projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
using SelectWindow for Raise Implementation
[wxWidgets.git]
/
src
/
mac
/
statbmp.cpp
diff --git
a/src/mac/statbmp.cpp
b/src/mac/statbmp.cpp
index fa75e68fd5aff8980aa7deb3085125c9d8a84e53..522d2ed2302ee306d0859a81644799b0f415984c 100644
(file)
--- a/
src/mac/statbmp.cpp
+++ b/
src/mac/statbmp.cpp
@@
-10,10
+10,13
@@
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
-#pragma implementation "statbmp.h"
+
#pragma implementation "statbmp.h"
#endif
#endif
+#include "wx/defs.h"
+
#include "wx/statbmp.h"
#include "wx/statbmp.h"
+#include "wx/dcclient.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
@@
-23,7
+26,7
@@
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
* wxStaticBitmap
*/
* wxStaticBitmap
*/
-BEGIN_EVENT_TABLE(wxStaticBitmap, wx
Control
)
+BEGIN_EVENT_TABLE(wxStaticBitmap, wx
StaticBitmapBase
)
EVT_PAINT(wxStaticBitmap::OnPaint)
END_EVENT_TABLE()
EVT_PAINT(wxStaticBitmap::OnPaint)
END_EVENT_TABLE()
@@
-36,12
+39,18
@@
bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id,
{
SetName(name);
wxSize size = s ;
{
SetName(name);
wxSize size = s ;
+ if ( bitmap.Ok() )
+ {
+ if ( size.x == -1 )
+ size.x = bitmap.GetWidth() ;
+ if ( size.y == -1 )
+ size.y = bitmap.GetHeight() ;
+ }
m_backgroundColour = parent->GetBackgroundColour() ;
m_foregroundColour = parent->GetForegroundColour() ;
m_backgroundColour = parent->GetBackgroundColour() ;
m_foregroundColour = parent->GetForegroundColour() ;
- m_messageBitmap = bitmap;
-
+ m_bitmap = bitmap;
if ( id == -1 )
m_windowId = (int)NewControlId();
else
if ( id == -1 )
m_windowId = (int)NewControlId();
else
@@
-50,34
+59,28
@@
bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id,
m_windowStyle = style;
bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name );
m_windowStyle = style;
bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name );
- Set
SizeOrDefault
( size ) ;
+ Set
BestSize
( size ) ;
return ret;
}
return ret;
}
-void wxStaticBitmap::SetSize(int x, int y, int width, int height, int sizeFlags)
-{
- wxControl::SetSize( x , y , width , height , sizeFlags ) ;
-}
-
void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
{
void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
{
- m_messageBitmap = bitmap;
- SetSizeOrDefault();
+ m_bitmap = bitmap;
+ SetSize(wxSize(bitmap.GetWidth(), bitmap.GetHeight()));
+ Refresh() ;
}
}
-void wxStaticBitmap::OnPaint( wxPaintEvent &event )
+
+void wxStaticBitmap::OnPaint( wxPaintEvent& WXUNUSED(event) )
{
wxPaintDC dc(this);
PrepareDC(dc);
{
wxPaintDC dc(this);
PrepareDC(dc);
- dc.SetPalette( *m_messageBitmap.GetPalette() ) ;
-
dc.DrawBitmap( m_messageBitmap , 0 , 0
) ;
+
+
dc.DrawBitmap( m_bitmap , 0 , 0 , TRUE
) ;
}
wxSize wxStaticBitmap::DoGetBestSize() const
{
}
wxSize wxStaticBitmap::DoGetBestSize() const
{
- if ( m_messageBitmap.Ok() )
- return wxSize(m_messageBitmap.GetWidth(), m_messageBitmap.GetHeight());
- else
- return wxSize(16, 16); // completely arbitrary
+ return wxWindow::DoGetBestSize() ;
}
}