X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/21e0a4d5f15ea1df40d29359fc1e84085936ef3f..3c31306c74e878e6888b6c73a44a337516717d73:/src/motif/radiobox.cpp diff --git a/src/motif/radiobox.cpp b/src/motif/radiobox.cpp index 90e3cdd123..b529840be5 100644 --- a/src/motif/radiobox.cpp +++ b/src/motif/radiobox.cpp @@ -12,12 +12,12 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_RADIOBOX + #ifdef __VMS #define XtDisplay XTDISPLAY #endif -#include "wx/defs.h" - #include "wx/radiobox.h" #include "wx/utils.h" #include "wx/arrstr.h" @@ -59,7 +59,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title, if( !CreateControl( parent, id, pos, size, style, val, name ) ) return false; - m_noItems = n; + m_noItems = (size_t)n; m_noRowsOrCols = majorDim; SetMajorDim(majorDim == 0 ? n : majorDim, style); @@ -197,9 +197,8 @@ void wxRadioBox::SetSelection(int n) XmToggleButtonSetState ((Widget) m_radioButtons[n], True, False); - int i; - for (i = 0; i < m_noItems; i++) - if (i != n) + for (size_t i = 0; i < m_noItems; i++) + if (i != (size_t)n) XmToggleButtonSetState ((Widget) m_radioButtons[i], False, False); m_inSetValue = false; @@ -259,8 +258,7 @@ bool wxRadioBox::Enable(bool enable) if ( !wxControl::Enable(enable) ) return false; - int i; - for (i = 0; i < m_noItems; i++) + for (size_t i = 0; i < m_noItems; i++) XtSetSensitive ((Widget) m_radioButtons[i], (Boolean) enable); return true; @@ -335,8 +333,7 @@ void wxRadioBox::ChangeFont(bool keepOriginalSize) { wxWindow::ChangeFont(keepOriginalSize); - int i; - for (i = 0; i < m_noItems; i++) + for (size_t i = 0; i < m_noItems; i++) { WXWidget radioButton = m_radioButtons[i]; @@ -352,8 +349,7 @@ void wxRadioBox::ChangeBackgroundColour() int selectPixel = wxBLACK->AllocColour(XtDisplay((Widget)m_mainWidget)); - int i; - for (i = 0; i < m_noItems; i++) + for (size_t i = 0; i < m_noItems; i++) { WXWidget radioButton = m_radioButtons[i]; @@ -369,8 +365,7 @@ void wxRadioBox::ChangeForegroundColour() { wxWindow::ChangeForegroundColour(); - int i; - for (i = 0; i < m_noItems; i++) + for (size_t i = 0; i < m_noItems; i++) { WXWidget radioButton = m_radioButtons[i]; @@ -386,11 +381,11 @@ void wxRadioBoxCallback (Widget w, XtPointer clientData, wxRadioBox *item = (wxRadioBox *) clientData; int sel = -1; - int i; + size_t i; const wxWidgetArray& buttons = item->GetRadioButtons(); for (i = 0; i < item->GetCount(); i++) if (((Widget)buttons[i]) == w) - sel = i; + sel = (int)i; item->SetSel(sel); if (item->InSetValue()) @@ -402,3 +397,5 @@ void wxRadioBoxCallback (Widget w, XtPointer clientData, event.SetEventObject(item); item->ProcessCommand (event); } + +#endif // wxUSE_RADIOBOX