]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/radiobut.cpp
Include missing.h to find O_* flags.
[wxWidgets.git] / src / motif / radiobut.cpp
index 87c20587a9b0fad998c6d30dcdceb77b52ef4d20..629a00791518544986cb3836d2cb46ad57da6837 100644 (file)
@@ -9,10 +9,13 @@
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "radiobut.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #ifdef __VMS
 #define XtDisplay XTDISPLAY
 #endif
 #ifdef __VMS__
 #pragma message disable nosimpint
 #endif
-#include <Xm/Label.h>
-#include <Xm/LabelG.h>
 #include <Xm/ToggleB.h>
 #include <Xm/ToggleBG.h>
-#include <Xm/RowColumn.h>
-#include <Xm/Form.h>
 #ifdef __VMS__
 #pragma message enable nosimpint
 #endif
@@ -53,20 +52,8 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
                            const wxValidator& validator,
                            const wxString& name)
 {
-    SetName(name);
-    SetValidator(validator);
-    m_backgroundColour = parent->GetBackgroundColour();
-    m_foregroundColour = parent->GetForegroundColour();
-    m_font = parent->GetFont();
-
-    if (parent) parent->AddChild(this);
-
-    if ( id == -1 )
-        m_windowId = (int)NewControlId();
-    else
-        m_windowId = id;
-
-    m_windowStyle = style ;
+    if( !CreateControl( parent, id, pos, size, style, validator, name ) )
+        return false;
 
     Widget parentWidget = (Widget) parent->GetClientWidget();
 
@@ -88,14 +75,17 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
         XmNindicatorType, XmONE_OF_MANY, // diamond-shape
         NULL);
 
-    XtAddCallback (radioButtonWidget, XmNvalueChangedCallback, (XtCallbackProc) wxRadioButtonCallback,
-        (XtPointer) this);
+    XtAddCallback (radioButtonWidget,
+                   XmNvalueChangedCallback,
+                   (XtCallbackProc)wxRadioButtonCallback,
+                   (XtPointer)this);
 
     m_mainWidget = (WXWidget) radioButtonWidget;
 
     XtManageChild (radioButtonWidget);
 
-    AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
+    AttachWidget (parent, m_mainWidget, (WXWidget) NULL,
+                  pos.x, pos.y, size.x, size.y);
 
     ChangeBackgroundColour();
 
@@ -110,7 +100,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
     {
         /* search backward for last group start */
         wxRadioButton *chief = (wxRadioButton*) NULL;
-        wxWindowList::Node *node = parent->GetChildren().GetLast();
+        wxWindowList::compatibility_iterator node = parent->GetChildren().GetLast();
         while (node)
         {
             wxWindow *child = node->GetData();
@@ -150,28 +140,18 @@ void wxRadioButton::Command (wxCommandEvent & event)
     ProcessCommand (event);
 }
 
-void wxRadioButton::ChangeFont(bool keepOriginalSize)
-{
-    wxWindow::ChangeFont(keepOriginalSize);
-}
-
 void wxRadioButton::ChangeBackgroundColour()
 {
     wxWindow::ChangeBackgroundColour();
 
     // What colour should this be?
-    int selectPixel = wxBLACK->AllocColour(wxGetDisplay());
+    int selectPixel = wxBLACK->AllocColour(XtDisplay((Widget)m_mainWidget));
 
     XtVaSetValues ((Widget) GetMainWidget(),
           XmNselectColor, selectPixel,
           NULL);
 }
 
-void wxRadioButton::ChangeForegroundColour()
-{
-    wxWindow::ChangeForegroundColour();
-}
-
 void wxRadioButtonCallback (Widget w, XtPointer clientData,
                             XmToggleButtonCallbackStruct * cbs)
 {