X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aae0472bf3086707216125e4caa8650caeeeaf97..88c139da4639cd25e4ad1298062e1e8b19ee29f1:/src/motif/bmpbuttn.cpp diff --git a/src/motif/bmpbuttn.cpp b/src/motif/bmpbuttn.cpp index aede52c9b0..e47b8c2b1b 100644 --- a/src/motif/bmpbuttn.cpp +++ b/src/motif/bmpbuttn.cpp @@ -9,9 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "bmpbuttn.h" -#endif +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" #ifdef __VMS #define XtScreen XTSCREEN @@ -58,13 +57,6 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, m_bmpNormal = m_bmpNormalOriginal = bitmap; m_bmpSelected = m_bmpSelectedOriginal = bitmap; - /* - int x = pos.x; - int y = pos.y; - int width = size.x; - int height = size.y; - */ - Widget parentWidget = (Widget) parent->GetClientWidget(); /* @@ -91,7 +83,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, m_mainWidget = (WXWidget) buttonWidget; - ChangeFont(FALSE); + ChangeFont(false); ChangeBackgroundColour (); @@ -101,8 +93,6 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, XmNactivateCallback, (XtCallbackProc) wxButtonCallback, (XtPointer) this); - SetCanAddEventHandler(TRUE); - wxSize best = m_bmpNormal.Ok() ? GetBestSize() : wxSize(30, 30); if( size.x != -1 ) best.x = size.x; if( size.y != -1 ) best.y = size.y; @@ -110,7 +100,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, best.x, best.y); - return TRUE; + return true; } wxBitmapButton::~wxBitmapButton() @@ -136,13 +126,13 @@ void wxBitmapButton::SetBitmapSelected(const wxBitmap& sel) m_bmpSelectedOriginal = sel; DoSetBitmap(); -}; +} void wxBitmapButton::SetBitmapFocus(const wxBitmap& focus) { m_bmpFocus = focus; // Not used in Motif -}; +} void wxBitmapButton::SetBitmapDisabled(const wxBitmap& disabled) { @@ -150,7 +140,7 @@ void wxBitmapButton::SetBitmapDisabled(const wxBitmap& disabled) m_bmpDisabledOriginal = disabled; DoSetBitmap(); -}; +} void wxBitmapButton::DoSetBitmap() { @@ -234,16 +224,6 @@ void wxBitmapButton::DoSetBitmap() else armPixmap = (Pixmap) m_bitmapCache.GetArmPixmap(m_mainWidget); -#if 0 - // <- the Get...Pixmap()-functions return the same pixmap! - if (insensPixmap == pixmap) - { - insensPixmap = - XCreateInsensitivePixmap(DisplayOfScreen(XtScreen((Widget) m_mainWidget)), pixmap); - m_insensPixmap = (WXPixmap) insensPixmap; - } -#endif - XtVaSetValues ((Widget) m_mainWidget, XmNlabelPixmap, pixmap, XmNlabelInsensitivePixmap, insensPixmap, @@ -266,7 +246,7 @@ void wxBitmapButton::DoSetBitmap() void wxBitmapButton::ChangeBackgroundColour() { - DoChangeBackgroundColour(m_mainWidget, m_backgroundColour, TRUE); + wxDoChangeBackgroundColour(m_mainWidget, m_backgroundColour, true); // Must reset the bitmaps since the colours have changed. DoSetBitmap();