projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cleanup, Carbon Events
[wxWidgets.git]
/
src
/
mac
/
carbon
/
statbmp.cpp
diff --git
a/src/mac/carbon/statbmp.cpp
b/src/mac/carbon/statbmp.cpp
index b66b32f07248f99891befa8646b5774d468261e3..522d2ed2302ee306d0859a81644799b0f415984c 100644
(file)
--- a/
src/mac/carbon/statbmp.cpp
+++ b/
src/mac/carbon/statbmp.cpp
@@
-39,6
+39,13
@@
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() ;
@@
-60,11
+67,11
@@
bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id,
void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
{
m_bitmap = bitmap;
void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
{
m_bitmap = bitmap;
+ SetSize(wxSize(bitmap.GetWidth(), bitmap.GetHeight()));
Refresh() ;
Refresh() ;
- SetBestSize(wxSize(bitmap.GetWidth(), bitmap.GetHeight()));
}
}
-void wxStaticBitmap::OnPaint( wxPaintEvent
&event
)
+void wxStaticBitmap::OnPaint( wxPaintEvent
& WXUNUSED(event)
)
{
wxPaintDC dc(this);
PrepareDC(dc);
{
wxPaintDC dc(this);
PrepareDC(dc);
@@
-74,9
+81,6
@@
void wxStaticBitmap::OnPaint( wxPaintEvent &event )
wxSize wxStaticBitmap::DoGetBestSize() const
{
wxSize wxStaticBitmap::DoGetBestSize() const
{
- if ( m_bitmap.Ok() )
- return wxSize(m_bitmap.GetWidth(), m_bitmap.GetHeight());
- else
- return wxSize(16, 16); // completely arbitrary
+ return wxWindow::DoGetBestSize() ;
}
}