projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
removing the IsWindow() test in ~wxWindow
[wxWidgets.git]
/
src
/
msw
/
bmpbuttn.cpp
diff --git
a/src/msw/bmpbuttn.cpp
b/src/msw/bmpbuttn.cpp
index c7d8dd076fbceb5fc0f8b8ad6b90a28a13424504..4eb6795442050f5075905861c0f7980117cb4fd7 100644
(file)
--- a/
src/msw/bmpbuttn.cpp
+++ b/
src/msw/bmpbuttn.cpp
@@
-39,7
+39,10
@@
bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
{
m_buttonBitmap = bitmap;
SetName(name);
{
m_buttonBitmap = bitmap;
SetName(name);
+
+#if wxUSE_VALIDATORS
SetValidator(validator);
SetValidator(validator);
+#endif // wxUSE_VALIDATORS
parent->AddChild(this);
parent->AddChild(this);
@@
-172,6
+175,9
@@
bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item)
}
BOOL ok;
}
BOOL ok;
+
+ // no MaskBlt() under Win16
+#ifdef __WIN32__
wxMask *mask = bitmap->GetMask();
if ( mask )
{
wxMask *mask = bitmap->GetMask();
if ( mask )
{
@@
-179,9
+185,8
@@
bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item)
// (for a wxMask this means that this is a non transparent pixel), the
// bg ROP is applied for all the others
// (for a wxMask this means that this is a non transparent pixel), the
// bg ROP is applied for all the others
- wxColour colBg = GetBackgroundColour();
HBRUSH hbrBackground =
HBRUSH hbrBackground =
- ::CreateSolidBrush(
RGB(colBg.Red(), colBg.Green(), colBg.Blue
()));
+ ::CreateSolidBrush(
wxColourToRGB(GetBackgroundColour
()));
HBRUSH hbrOld = (HBRUSH)::SelectObject(hDC, hbrBackground);
ok = ::MaskBlt(
HBRUSH hbrOld = (HBRUSH)::SelectObject(hDC, hbrBackground);
ok = ::MaskBlt(
@@
-196,6
+201,14
@@
bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item)
::DeleteObject(hbrBackground);
}
else
::DeleteObject(hbrBackground);
}
else
+ {
+ // this will make the check below fail and BitBlt() will be used if
+ // MaskBlt() is not supported (for example, under Win95)
+ ok = FALSE;
+ }
+
+ if ( !ok )
+#endif // Win32
{
ok = ::BitBlt(hDC, x1, y1, wBmp, hBmp, // dst
memDC, 0, 0, // src
{
ok = ::BitBlt(hDC, x1, y1, wBmp, hBmp, // dst
memDC, 0, 0, // src