]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/bmpbuttn.cpp
implement editing_started and _done events for GTK+ >= 2.6
[wxWidgets.git] / src / motif / bmpbuttn.cpp
index e47b8c2b1b1772a7425637bcc4a1d000bac20e1d..5e94188ba4b5ce900e57de42b680b846515bce80 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
-// Name:        bmpbuttn.cpp
+// Name:        src/motif/bmpbuttn.cpp
 // Purpose:     wxBitmapButton
 // Author:      Julian Smart
 // Modified by:
 // Purpose:     wxBitmapButton
 // Author:      Julian Smart
 // Modified by:
@@ -16,8 +16,6 @@
 #define XtScreen XTSCREEN
 #endif
 
 #define XtScreen XTSCREEN
 #endif
 
-#include "wx/defs.h"
-
 #include "wx/bmpbuttn.h"
 
 #ifdef __VMS__
 #include "wx/bmpbuttn.h"
 
 #ifdef __VMS__
@@ -53,6 +51,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id,
 {
     if( !CreateControl( parent, id, pos, size, style, validator, name ) )
         return false;
 {
     if( !CreateControl( parent, id, pos, size, style, validator, name ) )
         return false;
+    PreCreation();
 
     m_bmpNormal = m_bmpNormalOriginal = bitmap;
     m_bmpSelected = m_bmpSelectedOriginal = bitmap;
 
     m_bmpNormal = m_bmpNormalOriginal = bitmap;
     m_bmpSelected = m_bmpSelectedOriginal = bitmap;
@@ -77,18 +76,12 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id,
         xmPushButtonWidgetClass, parentWidget,
 #endif
         // See comment for wxButton::SetDefault
         xmPushButtonWidgetClass, parentWidget,
 #endif
         // See comment for wxButton::SetDefault
-        // XmNdefaultButtonShadowThickness, 1, 
+        // XmNdefaultButtonShadowThickness, 1,
         XmNrecomputeSize, False,
         NULL);
 
     m_mainWidget = (WXWidget) buttonWidget;
 
         XmNrecomputeSize, False,
         NULL);
 
     m_mainWidget = (WXWidget) buttonWidget;
 
-    ChangeFont(false);
-
-    ChangeBackgroundColour ();
-
-    DoSetBitmap();
-
     XtAddCallback (buttonWidget,
                    XmNactivateCallback, (XtCallbackProc) wxButtonCallback,
                    (XtPointer) this);
     XtAddCallback (buttonWidget,
                    XmNactivateCallback, (XtCallbackProc) wxButtonCallback,
                    (XtPointer) this);
@@ -97,6 +90,9 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id,
     if( size.x != -1 ) best.x = size.x;
     if( size.y != -1 ) best.y = size.y;
 
     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);
 
     AttachWidget (parent, m_mainWidget, (WXWidget) NULL,
                   pos.x, pos.y, best.x, best.y);
 
@@ -154,7 +150,7 @@ void wxBitmapButton::DoSetBitmap()
         // in the current widget background colour.
         if (m_bmpNormalOriginal.GetMask())
         {
         // in the current widget background colour.
         if (m_bmpNormalOriginal.GetMask())
         {
-            int backgroundPixel;
+            WXPixel backgroundPixel;
             XtVaGetValues((Widget) m_mainWidget,
                           XmNbackground, &backgroundPixel,
                           NULL);
             XtVaGetValues((Widget) m_mainWidget,
                           XmNbackground, &backgroundPixel,
                           NULL);
@@ -179,7 +175,7 @@ void wxBitmapButton::DoSetBitmap()
         {
             if (m_bmpDisabledOriginal.GetMask())
             {
         {
             if (m_bmpDisabledOriginal.GetMask())
             {
-                int backgroundPixel;
+                WXPixel backgroundPixel;
                 XtVaGetValues((Widget) m_mainWidget,
                               XmNbackground, &backgroundPixel,
                               NULL);
                 XtVaGetValues((Widget) m_mainWidget,
                               XmNbackground, &backgroundPixel,
                               NULL);
@@ -204,7 +200,7 @@ void wxBitmapButton::DoSetBitmap()
         {
             if (m_bmpSelectedOriginal.GetMask())
             {
         {
             if (m_bmpSelectedOriginal.GetMask())
             {
-                int backgroundPixel;
+                WXPixel backgroundPixel;
                 XtVaGetValues((Widget) m_mainWidget,
                               XmNarmColor, &backgroundPixel,
                               NULL);
                 XtVaGetValues((Widget) m_mainWidget,
                               XmNarmColor, &backgroundPixel,
                               NULL);
@@ -265,4 +261,3 @@ wxSize wxBitmapButton::DoGetBestSize() const
 
     return ret;
 }
 
     return ret;
 }
-