projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add default constructor to wxGraphicsGradientStop.
[wxWidgets.git]
/
src
/
univ
/
bmpbuttn.cpp
diff --git
a/src/univ/bmpbuttn.cpp
b/src/univ/bmpbuttn.cpp
index 221f44a26f5ab4e4355b4d22ed0ddbd6d3783832..eb4faa55845dcfa7606382c4f365440506a3d148 100644
(file)
--- a/
src/univ/bmpbuttn.cpp
+++ b/
src/univ/bmpbuttn.cpp
@@
-1,5
+1,5
@@
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
-// Name: univ/bmpbuttn.cpp
+// Name:
src/
univ/bmpbuttn.cpp
// Purpose: wxBitmapButton implementation
// Author: Vadim Zeitlin
// Modified by:
// Purpose: wxBitmapButton implementation
// Author: Vadim Zeitlin
// Modified by:
@@
-25,9
+25,10
@@
#if wxUSE_BMPBUTTON
#if wxUSE_BMPBUTTON
+#include "wx/bmpbuttn.h"
+
#ifndef WX_PRECOMP
#include "wx/dc.h"
#ifndef WX_PRECOMP
#include "wx/dc.h"
- #include "wx/bmpbuttn.h"
#include "wx/validate.h"
#endif
#include "wx/validate.h"
#endif
@@
-64,7
+65,7
@@
bool wxBitmapButton::Create(wxWindow *parent,
pos, size, style | wxBU_EXACTFIT, validator, name) )
return false;
pos, size, style | wxBU_EXACTFIT, validator, name) )
return false;
- m_b
mpNormal
= bitmap;
+ m_b
itmaps[State_Normal]
= bitmap;
return true;
}
return true;
}
@@
-74,35
+75,30
@@
void wxBitmapButton::OnSetBitmap()
wxBitmap bmp;
if ( !IsEnabled() )
{
wxBitmap bmp;
if ( !IsEnabled() )
{
- bmp =
m_bmpDisabled
;
+ bmp =
GetBitmapDisabled()
;
}
else if ( IsPressed() )
{
}
else if ( IsPressed() )
{
- bmp =
m_bmpSelected
;
+ bmp =
GetBitmapPressed()
;
}
else if ( IsFocused() )
{
}
else if ( IsFocused() )
{
- bmp = m_bmpFocus;
- }
- else
- {
- bmp = m_bmpNormal;
+ bmp = GetBitmapFocus();
}
}
+ //else: just leave it invalid, this means "normal" anyhow in ChangeBitmap()
ChangeBitmap(bmp);
}
bool wxBitmapButton::ChangeBitmap(const wxBitmap& bmp)
{
ChangeBitmap(bmp);
}
bool wxBitmapButton::ChangeBitmap(const wxBitmap& bmp)
{
- wxBitmap bitmap = bmp.Ok() ? bmp : m_bmpNormal;
- if ( bitmap != m_bitmap )
- {
- m_bitmap = bitmap;
+ wxBitmap bitmap = bmp.IsOk() ? bmp : GetBitmapLabel();
+ if ( bitmap.IsSameAs(m_bitmap) )
+ return false;
- return true;
- }
+ m_bitmap = bitmap;
- return
fals
e;
+ return
tru
e;
}
bool wxBitmapButton::Enable(bool enable)
}
bool wxBitmapButton::Enable(bool enable)
@@
-110,7
+106,7
@@
bool wxBitmapButton::Enable(bool enable)
if ( !wxButton::Enable(enable) )
return false;
if ( !wxButton::Enable(enable) )
return false;
- if ( !enable && ChangeBitmap(
m_bmpDisabled
) )
+ if ( !enable && ChangeBitmap(
GetBitmapDisabled()
) )
Refresh();
return true;
Refresh();
return true;
@@
-118,14
+114,14
@@
bool wxBitmapButton::Enable(bool enable)
bool wxBitmapButton::SetCurrent(bool doit)
{
bool wxBitmapButton::SetCurrent(bool doit)
{
- ChangeBitmap(doit ?
m_bmpFocus : m_bmpNormal
);
+ ChangeBitmap(doit ?
GetBitmapFocus() : GetBitmapLabel()
);
return wxButton::SetCurrent(doit);
}
void wxBitmapButton::OnSetFocus(wxFocusEvent& event)
{
return wxButton::SetCurrent(doit);
}
void wxBitmapButton::OnSetFocus(wxFocusEvent& event)
{
- if ( ChangeBitmap(
m_bmpFocus
) )
+ if ( ChangeBitmap(
GetBitmapFocus()
) )
Refresh();
event.Skip();
Refresh();
event.Skip();
@@
-133,7
+129,7
@@
void wxBitmapButton::OnSetFocus(wxFocusEvent& event)
void wxBitmapButton::OnKillFocus(wxFocusEvent& event)
{
void wxBitmapButton::OnKillFocus(wxFocusEvent& event)
{
- if ( ChangeBitmap(
m_bmpNormal
) )
+ if ( ChangeBitmap(
GetBitmapLabel()
) )
Refresh();
event.Skip();
Refresh();
event.Skip();
@@
-141,17
+137,16
@@
void wxBitmapButton::OnKillFocus(wxFocusEvent& event)
void wxBitmapButton::Press()
{
void wxBitmapButton::Press()
{
- ChangeBitmap(
m_bmpSelected
);
+ ChangeBitmap(
GetBitmapPressed()
);
wxButton::Press();
}
void wxBitmapButton::Release()
{
wxButton::Press();
}
void wxBitmapButton::Release()
{
- ChangeBitmap(IsFocused() ?
m_bmpFocus : m_bmpNormal
);
+ ChangeBitmap(IsFocused() ?
GetBitmapFocus() : GetBitmapLabel()
);
wxButton::Release();
}
#endif // wxUSE_BMPBUTTON
wxButton::Release();
}
#endif // wxUSE_BMPBUTTON
-