projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
switching to safe yields, because we got into loops when handling print document...
[wxWidgets.git]
/
src
/
mac
/
carbon
/
statbmp.cpp
diff --git
a/src/mac/carbon/statbmp.cpp
b/src/mac/carbon/statbmp.cpp
index 742f1f5f841b4cb58701f04727b44de87bbee6dd..d04e549b0e80dc7990bce4596cabe0c669a99b8e 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()
@@
-37,11
+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_
messageB
itmap = bitmap;
+ m_
b
itmap = bitmap;
if ( id == -1 )
m_windowId = (int)NewControlId();
else
if ( id == -1 )
m_windowId = (int)NewControlId();
else
@@
-50,20
+59,16
@@
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 &event )
@@
-71,14
+76,11
@@
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_messageBitmap.Ok() )
- return wxSize(m_messageBitmap.GetWidth(), m_messageBitmap.GetHeight());
- else
- return wxSize(16, 16); // completely arbitrary
+ return wxWindow::DoGetBestSize() ;
}
}