- //else: don't generate events when the selection doesn't change
-
- return TRUE;
- }
- else
- return FALSE;
-*/
- return FALSE;
-}
-
-#if WXWIN_COMPATIBILITY
-wxRadioBox::wxRadioBox(wxWindow *parent, wxFunction func, const char *title,
- int x, int y, int width, int height,
- int n, char **choices,
- int majorDim, long style, const char *name)
-{
- wxString *choices2 = new wxString[n];
- for ( int i = 0; i < n; i ++) choices2[i] = choices[i];
- Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), n, choices2, majorDim, style,
- wxDefaultValidator, name);
- Callback(func);
- delete choices2;
-}
-
-#endif
-
-// Radio box item
-wxRadioBox::wxRadioBox()
-{
- m_selectedButton = -1;
- m_noItems = 0;
- m_noRowsOrCols = 0;
- m_radioButtons = NULL;
- m_majorDim = 0;
- m_radioWidth = NULL;
- m_radioHeight = NULL;
-}
-
-bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
- const wxPoint& pos, const wxSize& size,
- int n, const wxString choices[],
- int majorDim, long style,
-#if wxUSE_VALIDATORS
- const wxValidator& val, const wxString& name)
-#endif
-{
- m_selectedButton = -1;
- m_noItems = n;
-
- SetName(name);
-#if wxUSE_VALIDATORS
- SetValidator(val);
-#endif
- parent->AddChild(this);
- m_backgroundColour = parent->GetBackgroundColour();
- m_foregroundColour = parent->GetForegroundColour();
-
- m_windowStyle = (long&)style;
-
- int x = pos.x;
- int y = pos.y;
- int width = size.x;
- int height = size.y;
-
- if (id == -1)
- m_windowId = NewControlId();
- else
- m_windowId = id;
-
- if ( majorDim == 0 )
- m_majorDim = n;
- else
- m_majorDim = majorDim;
- m_noRowsOrCols = majorDim;
-
- long msStyle = 0; // TODO: GROUP_FLAGS;
-
- bool want3D;
- WXDWORD exStyle = Determine3DEffects(0, &want3D);
-
- HWND hwndParent = (HWND)parent->GetHWND();
-/*
- m_hWnd = (WXHWND)::CreateWindowEx
- (
- (DWORD)exStyle,
- GROUP_CLASS,
- title,
- msStyle,
- 0, 0, 0, 0,
- hwndParent,
- (HMENU)m_windowId,
- wxGetInstance(),
- NULL
- );
-
-#if wxUSE_CTL3D
- if (want3D)
- {
- Ctl3dSubclassCtl((HWND)m_hWnd);
- m_useCtl3D = TRUE;
- }
-#endif // wxUSE_CTL3D
-*/
- SetFont(parent->GetFont());
-
- SubclassWin(m_hWnd);
-
- // Some radio boxes test consecutive id.
- (void)NewControlId();
- m_radioButtons = new WXHWND[n];
- m_radioWidth = new int[n];
- m_radioHeight = new int[n];
- int i;
- for (i = 0; i < n; i++)
- {
-// TODO:
-/*
- m_radioWidth[i] = m_radioHeight[i] = -1;
- long groupStyle = 0;
- if ( i == 0 && style == 0 )
- groupStyle = WS_GROUP;
- long newId = NewControlId();
- long msStyle = groupStyle | RADIO_FLAGS;
-
- HWND hwndBtn = CreateWindowEx(exStyle, RADIO_CLASS,
- choices[i], msStyle,
- 0,0,0,0,
- hwndParent,
- (HMENU)newId, wxGetInstance(),
- NULL);
-
- m_radioButtons[i] = (WXHWND)hwndBtn;
-
- SubclassRadioButton((WXHWND)hwndBtn);
-
- wxFont& font = GetFont();
- if ( font.Ok() )