// Modified by:
// Created: 04/01/98
// RCS-ID: $Id$
-// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows license
+// Copyright: (c) Julian Smart
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ===========================================================================
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 // WXWIN_COMPATIBILITY
-
// Radio box item
wxRadioBox::wxRadioBox()
{
int extraHeight = cy1;
+ /* We'll assume the adjustments below are OK for Win 3.1 too
#if defined(CTL3D) && !CTL3D
// Requires a bigger group box in plain Windows
extraHeight *= 3;
extraHeight /= 2;
#endif
-
+ */
+
int height = GetNumVer() * sizeBtn.y + cy1/2 + extraHeight;
int width = GetNumHor() * (sizeBtn.x + cx1) + cx1;
+ // Add extra space under the label, if it exists.
+ if (!wxControl::GetLabel().IsEmpty())
+ height += cy1/2;
+
// and also wide enough for its label
int widthLabel;
GetTextExtent(GetTitle(), &widthLabel, NULL);
x_offset += cx1;
y_offset += cy1;
-#if defined(CTL3D) && (!CTL3D)
- y_offset += (int)(cy1/2); // Fudge factor since buttons overlapped label
- // JACS 2/12/93. CTL3D draws group label quite high.
-#endif
+ // Add extra space under the label, if it exists.
+ if (!wxControl::GetLabel().IsEmpty())
+ y_offset += cy1/2;
int startX = x_offset;
int startY = y_offset;
}
#endif // Win32
+ // VZ: this code breaks radiobox redrawing under Windows XP, don't use
+ // it. If you need to get messages from the static controls,
+ // create them as a child of another (non static) window
+#if 0
// This is required for the radiobox to be sensitive to mouse input,
// e.g. for Dialog Editor.
case WM_NCHITTEST:
return (long)HTCLIENT;
}
break;
+#endif // 0
}
return wxControl::MSWWindowProc(nMsg, wParam, lParam);
case WM_NOTIFY:
{
NMHDR* hdr = (NMHDR *)lParam;
- if ( (int)hdr->code == TTN_NEEDTEXT )
+ if ( hdr->code == TTN_NEEDTEXT )
{
wxRadioBox *radiobox = (wxRadioBox *)
::GetWindowLong(hwnd, GWL_USERDATA);