X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dac5a9c997a9495fbad0e7663a67858ac6562413..222702b112dcc7bebe018d6f4d66fe469fefd02c:/src/motif/checkbox.cpp diff --git a/src/motif/checkbox.cpp b/src/motif/checkbox.cpp index bac4609472..c2a317b645 100644 --- a/src/motif/checkbox.cpp +++ b/src/motif/checkbox.cpp @@ -18,12 +18,6 @@ #ifdef __VMS #define XtDisplay XTDISPLAY -#define XmNtoggleMode 0 -#define XmTOGGLE_INDETERMINATE 1 -#define XmTOGGLE_BOOLEAN 2 -#define XmUNSET 3 -#define XmSET 4 -#define XmINDETERMINATE 5 #endif #include "wx/defs.h" @@ -43,6 +37,17 @@ #pragma message enable nosimpint #endif +// define symbols that are missing in old versions of Motif. +#if (XmVersion < 2000) +#define XmNtoggleMode 0 +#define XmTOGGLE_INDETERMINATE 1 +#define XmTOGGLE_BOOLEAN 2 +#define XmUNSET 3 +#define XmSET 4 +#define XmINDETERMINATE 5 +#endif + + #include "wx/motif/private.h" void wxCheckBoxCallback (Widget w, XtPointer clientData, @@ -59,7 +64,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, { if( !wxControl::CreateControl( parent, id, pos, size, style, validator, name ) ) - return FALSE; + return false; wxString label1(wxStripMenuCodes(label)); wxXmString text( label1 ); @@ -80,13 +85,13 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, XmNvalueChangedCallback, (XtCallbackProc)wxCheckBoxCallback, (XtPointer)this ); - XmToggleButtonSetState ((Widget) m_mainWidget, FALSE, TRUE); + XmToggleButtonSetState ((Widget) m_mainWidget, False, True); AttachWidget( parent, m_mainWidget, (WXWidget)NULL, pos.x, pos.y, size.x, size.y ); ChangeBackgroundColour(); - return TRUE; + return true; } void wxCheckBox::SetValue(bool val) @@ -171,6 +176,7 @@ void wxCheckBox::DoSet3StateValue(wxCheckBoxState state) case wxCHK_UNCHECKED: value = XmUNSET; break; case wxCHK_CHECKED: value = XmSET; break; case wxCHK_UNDETERMINED: value = XmINDETERMINATE; break; + default: wxASSERT(0); return; } XtVaSetValues( (Widget) m_mainWidget,