projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixes for Raise() to work correctly with both top level and child windows
[wxWidgets.git]
/
src
/
mac
/
carbon
/
statbmp.cpp
diff --git
a/src/mac/carbon/statbmp.cpp
b/src/mac/carbon/statbmp.cpp
index 742f1f5f841b4cb58701f04727b44de87bbee6dd..35e918d469812fd4e6d9c2b952c7e7e19fd2234d 100644
(file)
--- a/
src/mac/carbon/statbmp.cpp
+++ b/
src/mac/carbon/statbmp.cpp
@@
-10,9
+10,11
@@
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
-#pragma implementation "statbmp.h"
+
#pragma implementation "statbmp.h"
#endif
#endif
+#include "wx/defs.h"
+
#include "wx/statbmp.h"
#include "wx/dcclient.h"
#include "wx/statbmp.h"
#include "wx/dcclient.h"
@@
-24,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()
@@
-41,7
+43,7
@@
bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id,
m_backgroundColour = parent->GetBackgroundColour() ;
m_foregroundColour = parent->GetForegroundColour() ;
m_backgroundColour = parent->GetBackgroundColour() ;
m_foregroundColour = parent->GetForegroundColour() ;
- m_
messageB
itmap = bitmap;
+ m_
b
itmap = bitmap;
if ( id == -1 )
m_windowId = (int)NewControlId();
else
if ( id == -1 )
m_windowId = (int)NewControlId();
else
@@
-50,7
+52,7
@@
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;
}
@@
-62,8
+64,9
@@
void wxStaticBitmap::SetSize(int x, int y, int width, int height, int sizeFlags)
void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
{
void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
{
- m_messageBitmap = bitmap;
- SetSizeOrDefault();
+ m_bitmap = bitmap;
+ Refresh() ;
+ SetBestSize(wxSize(bitmap.GetWidth(), bitmap.GetHeight()));
}
void wxStaticBitmap::OnPaint( wxPaintEvent &event )
}
void wxStaticBitmap::OnPaint( wxPaintEvent &event )
@@
-71,13
+74,13
@@
void wxStaticBitmap::OnPaint( wxPaintEvent &event )
wxPaintDC dc(this);
PrepareDC(dc);
wxPaintDC dc(this);
PrepareDC(dc);
- dc.DrawBitmap( m_
messageB
itmap , 0 , 0 , TRUE ) ;
+ dc.DrawBitmap( m_
b
itmap , 0 , 0 , TRUE ) ;
}
wxSize wxStaticBitmap::DoGetBestSize() const
{
}
wxSize wxStaticBitmap::DoGetBestSize() const
{
- if ( m_
messageB
itmap.Ok() )
- return wxSize(m_
messageBitmap.GetWidth(), m_messageB
itmap.GetHeight());
+ if ( m_
b
itmap.Ok() )
+ return wxSize(m_
bitmap.GetWidth(), m_b
itmap.GetHeight());
else
return wxSize(16, 16); // completely arbitrary
}
else
return wxSize(16, 16); // completely arbitrary
}