m_radioHeight = new int[n];
WXHFONT hfont = 0;
- wxFont& font = GetFont();
+ wxFont font = GetFont();
if ( font.Ok() )
{
hfont = font.GetResourceHandle();
0, 0, 0, 0, hwndParent,
(HMENU)NewControlId(), wxGetInstance(), NULL);
- SetSelection(0);
+#ifdef __WXWINCE__
+ // Set the z-order correctly
+ SetWindowPos(GetHwnd(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
+#endif
+ SetSelection(0);
SetSize(pos.x, pos.y, size.x, size.y);
+ // Now that we have items determine what is the best size and set it.
+ SetBestSize(size);
+
return TRUE;
}
+bool wxRadioBox::Create(wxWindow *parent,
+ wxWindowID id,
+ const wxString& title,
+ const wxPoint& pos,
+ const wxSize& size,
+ const wxArrayString& choices,
+ int majorDim,
+ long style,
+ const wxValidator& val,
+ const wxString& name)
+{
+ wxCArrayString chs(choices);
+ return Create(parent, id, title, pos, size, chs.GetCount(),
+ chs.GetStrings(), majorDim, style, val, name);
+}
+
wxRadioBox::~wxRadioBox()
{
m_isBeingDeleted = TRUE;
{
// the radiobox should be big enough for its buttons
int cx1, cy1;
- wxGetCharSize(m_hWnd, &cx1, &cy1, &GetFont());
+ wxGetCharSize(m_hWnd, &cx1, &cy1, GetFont());
int extraHeight = cy1;
#endif
int cx1, cy1;
- wxGetCharSize(m_hWnd, &cx1, &cy1, & GetFont());
+ wxGetCharSize(m_hWnd, &cx1, &cy1, GetFont());
// Attempt to have a look coherent with other platforms: We compute the
// biggest toggle dim, then we align all items according this value.
HWND hwndBtn = (HWND)hWndBtn;
if ( !s_wndprocRadioBtn )
- s_wndprocRadioBtn = (WXFARPROC)::GetWindowLong(hwndBtn, GWL_WNDPROC);
+ s_wndprocRadioBtn = (WXFARPROC)wxGetWindowProc(hwndBtn);
- ::SetWindowLong(hwndBtn, GWL_WNDPROC, (long)wxRadioBtnWndProc);
- ::SetWindowLong(hwndBtn, GWL_USERDATA, (long)this);
+ wxSetWindowProc(hwndBtn, wxRadioBtnWndProc);
+ wxSetWindowUserData(hwndBtn, this);
}
void wxRadioBox::SendNotificationEvent()
// our window proc
// ----------------------------------------------------------------------------
-long wxRadioBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
+WXLRESULT wxRadioBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
switch ( nMsg )
{
wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBack, wxSOLID);
- return (WXHBRUSH)brush->GetResourceHandle();
+ return (WXLRESULT)brush->GetResourceHandle();
}
#endif // Win32
HDC hdc = (HDC)pDC;
wxColour colBack = GetBackgroundColour();
- if (!IsEnabled())
- colBack = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
-
::SetBkColor(hdc, wxColourToRGB(colBack));
::SetTextColor(hdc, wxColourToRGB(GetForegroundColour()));
NMHDR* hdr = (NMHDR *)lParam;
if ( hdr->code == TTN_NEEDTEXT )
{
- wxRadioBox *radiobox = (wxRadioBox *)
- ::GetWindowLong(hwnd, GWL_USERDATA);
+ wxRadioBox *
+ radiobox = (wxRadioBox *)wxGetWindowUserData(hwnd);
wxCHECK_MSG( radiobox, 0,
wxT("radio button without radio box?") );
case WM_KEYDOWN:
{
- wxRadioBox *radiobox = (wxRadioBox *)
- ::GetWindowLong(hwnd, GWL_USERDATA);
+ wxRadioBox *radiobox = (wxRadioBox *)wxGetWindowUserData(hwnd);
wxCHECK_MSG( radiobox, 0, wxT("radio button without radio box?") );
case WM_SETFOCUS:
case WM_KILLFOCUS:
{
- wxRadioBox *radiobox = (wxRadioBox *)
- ::GetWindowLong(hwnd, GWL_USERDATA);
+ wxRadioBox *radiobox = (wxRadioBox *)wxGetWindowUserData(hwnd);
wxCHECK_MSG( radiobox, 0, wxT("radio button without radio box?") );
#ifdef __WIN32__
case WM_HELP:
{
- wxRadioBox *radiobox = (wxRadioBox *)
- ::GetWindowLong(hwnd, GWL_USERDATA);
+ wxRadioBox *radiobox = (wxRadioBox *)wxGetWindowUserData(hwnd);
wxCHECK_MSG( radiobox, 0, wxT("radio button without radio box?") );
- bool processed = TRUE;
+ bool processed wxDUMMY_INITIALIZE(true);
// HELPINFO doesn't seem to be supported on WinCE.
#ifndef __WXWINCE__
processed = radiobox->GetEventHandler()->ProcessEvent(helpEvent);
}
else
- processed = FALSE;
+ processed = false;
#endif
if (processed)
return 0;