/////////////////////////////////////////////////////////////////////////////
-// Name: bmpbuttn.cpp
+// Name: src/motif/bmpbuttn.cpp
// Purpose: wxBitmapButton
// Author: Julian Smart
// Modified by:
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "bmpbuttn.h"
-#endif
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
#ifdef __VMS
#define XtScreen XTSCREEN
#endif
-#include "wx/defs.h"
-
#include "wx/bmpbuttn.h"
#ifdef __VMS__
IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton)
-wxBitmapButtonBase::wxBitmapButtonBase()
- : m_bmpNormal(),
- m_bmpSelected(),
- m_bmpFocus(),
- m_bmpDisabled(),
- m_marginX(0),
- m_marginY(0)
-{
-}
-
wxBitmapButton::wxBitmapButton()
{
m_marginX = m_marginY = wxDEFAULT_BUTTON_MARGIN;
{
if( !CreateControl( parent, id, pos, size, style, validator, name ) )
return false;
+ PreCreation();
m_bmpNormal = m_bmpNormalOriginal = bitmap;
m_bmpSelected = m_bmpSelectedOriginal = bitmap;
xmPushButtonWidgetClass, parentWidget,
#endif
// See comment for wxButton::SetDefault
- // XmNdefaultButtonShadowThickness, 1,
+ // XmNdefaultButtonShadowThickness, 1,
XmNrecomputeSize, False,
NULL);
m_mainWidget = (WXWidget) buttonWidget;
- ChangeFont(FALSE);
-
- ChangeBackgroundColour ();
-
- DoSetBitmap();
-
XtAddCallback (buttonWidget,
XmNactivateCallback, (XtCallbackProc) wxButtonCallback,
(XtPointer) this);
if( size.x != -1 ) best.x = size.x;
if( size.y != -1 ) best.y = size.y;
+ PostCreation();
+ DoSetBitmap();
+
AttachWidget (parent, m_mainWidget, (WXWidget) NULL,
pos.x, pos.y, best.x, best.y);
- return TRUE;
+ return true;
}
wxBitmapButton::~wxBitmapButton()
m_bmpSelectedOriginal = sel;
DoSetBitmap();
-};
+}
void wxBitmapButton::SetBitmapFocus(const wxBitmap& focus)
{
m_bmpFocus = focus;
// Not used in Motif
-};
+}
void wxBitmapButton::SetBitmapDisabled(const wxBitmap& disabled)
{
m_bmpDisabledOriginal = disabled;
DoSetBitmap();
-};
+}
void wxBitmapButton::DoSetBitmap()
{
// in the current widget background colour.
if (m_bmpNormalOriginal.GetMask())
{
- int backgroundPixel;
+ WXPixel backgroundPixel;
XtVaGetValues((Widget) m_mainWidget,
XmNbackground, &backgroundPixel,
NULL);
{
if (m_bmpDisabledOriginal.GetMask())
{
- int backgroundPixel;
+ WXPixel backgroundPixel;
XtVaGetValues((Widget) m_mainWidget,
XmNbackground, &backgroundPixel,
NULL);
{
if (m_bmpSelectedOriginal.GetMask())
{
- int backgroundPixel;
+ WXPixel backgroundPixel;
XtVaGetValues((Widget) m_mainWidget,
XmNarmColor, &backgroundPixel,
NULL);
void wxBitmapButton::ChangeBackgroundColour()
{
- wxDoChangeBackgroundColour(m_mainWidget, m_backgroundColour, TRUE);
+ wxDoChangeBackgroundColour(m_mainWidget, m_backgroundColour, true);
// Must reset the bitmaps since the colours have changed.
DoSetBitmap();
return ret;
}
-