/////////////////////////////////////////////////////////////////////////////
-// Name: bmpbuttn.cpp
+// Name: src/msw/bmpbuttn.cpp
// Purpose: wxBitmapButton
// Author: Julian Smart
// Modified by:
// Created: 04/01/98
// RCS-ID: $Id$
-// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Copyright: (c) Julian Smart
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#include "wx/wxprec.h"
#ifdef __BORLANDC__
-#pragma hdrstop
+ #pragma hdrstop
#endif
+#if wxUSE_BMPBUTTON
+
#ifndef WX_PRECOMP
#include "wx/bmpbuttn.h"
#include "wx/log.h"
const wxValidator& validator,
const wxString& name)
{
- m_buttonBitmap = bitmap;
+ m_bmpNormal = bitmap;
SetName(name);
#if wxUSE_VALIDATORS
m_backgroundColour = parent->GetBackgroundColour();
m_foregroundColour = parent->GetForegroundColour();
m_windowStyle = style;
- m_marginX = 0;
- m_marginY = 0;
if ( style & wxBU_AUTODRAW )
{
long msStyle = WS_VISIBLE | WS_TABSTOP | WS_CHILD | BS_OWNERDRAW ;
+ if ( m_windowStyle & wxCLIP_SIBLINGS )
+ msStyle |= WS_CLIPSIBLINGS;
+
#ifdef __WIN32__
if(m_windowStyle & wxBU_LEFT)
msStyle |= BS_LEFT;
return TRUE;
}
-void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap)
-{
- m_buttonBitmap = bitmap;
-}
-
// VZ: should be at the very least less than wxDEFAULT_BUTTON_MARGIN
#define FOCUS_MARGIN 3
// choose the bitmap to use depending on the button state
wxBitmap* bitmap;
- if ( isSelected && m_buttonBitmapSelected.Ok() )
- bitmap = &m_buttonBitmapSelected;
- else if ((state & ODS_FOCUS) && m_buttonBitmapFocus.Ok())
- bitmap = &m_buttonBitmapFocus;
- else if ((state & ODS_DISABLED) && m_buttonBitmapDisabled.Ok())
- bitmap = &m_buttonBitmapDisabled;
+ if ( isSelected && m_bmpSelected.Ok() )
+ bitmap = &m_bmpSelected;
+ else if ((state & ODS_FOCUS) && m_bmpFocus.Ok())
+ bitmap = &m_bmpFocus;
+ else if ((state & ODS_DISABLED) && m_bmpDisabled.Ok())
+ bitmap = &m_bmpDisabled;
else
- bitmap = &m_buttonBitmap;
+ bitmap = &m_bmpNormal;
if ( !bitmap->Ok() )
return FALSE;
penLight = CreatePen(PS_SOLID, 0, GetSysColor(COLOR_3DLIGHT));
penShadow = CreatePen(PS_SOLID, 0, GetSysColor(COLOR_3DSHADOW));
penDkShadow = CreatePen(PS_SOLID, 0, GetSysColor(COLOR_3DDKSHADOW));
- brushFace = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
+ // brushFace = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
+ // Taking the background colour fits in better with
+ // Windows XP themes.
+ brushFace = CreateSolidBrush(m_backgroundColour.m_pixel);
// draw the rectangle
RECT rect;
{
wxButton::SetDefault();
}
+
+#endif // wxUSE_BMPBUTTON