X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cdf1e7142564c55f5299f1f2d0909090534eb97c..72c71d39724af116d419295b684dd2946efb3da3:/src/os2/radiobox.cpp diff --git a/src/os2/radiobox.cpp b/src/os2/radiobox.cpp index 9e48ac41d8..0392b1c87f 100644 --- a/src/os2/radiobox.cpp +++ b/src/os2/radiobox.cpp @@ -15,6 +15,8 @@ #ifndef WX_PRECOMP #include #include "wx/setup.h" + #include "wx/wxchar.h" + #include "wx/string.h" #include "wx/bitmap.h" #include "wx/brush.h" #include "wx/radiobox.h" @@ -22,19 +24,17 @@ #include "wx/os2/private.h" -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl) -#endif // --------------------------------------------------------------------------- // private functions // --------------------------------------------------------------------------- // wnd proc for radio buttons -MRESULT _EXPORT wxRadioBtnWndProc(HWND hWnd, - UINT message, - MPARAM wParam, - MPARAM lParam); +MRESULT wxRadioBtnWndProc(HWND hWnd, + UINT message, + MPARAM wParam, + MPARAM lParam); // --------------------------------------------------------------------------- // global vars @@ -143,14 +143,17 @@ 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(); @@ -173,7 +176,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title, m_majorDim = majorDim; m_noRowsOrCols = majorDim; - long msStyle = GROUP_FLAGS; + long msStyle = 0; // TODO: GROUP_FLAGS; bool want3D; WXDWORD exStyle = Determine3DEffects(0, &want3D); @@ -245,9 +248,9 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title, } // Create a dummy radio control to end the group. - (void)CreateWindowEx(0, RADIO_CLASS, wxT(""), WS_GROUP | RADIO_FLAGS, - 0, 0, 0, 0, hwndParent, - (HMENU)NewControlId(), wxGetInstance(), NULL); +// (void)CreateWindowEx(0, RADIO_CLASS, wxT(""), WS_GROUP | RADIO_FLAGS, +// 0, 0, 0, 0, hwndParent, +// (HMENU)NewControlId(), wxGetInstance(), NULL); SetSelection(0); @@ -427,11 +430,11 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags) { if ( sizeFlags & wxSIZE_AUTO_HEIGHT ) height = totHeight + extraHeight; - else + else height = heightOld; } - MoveWindow(GetHwnd(), x_offset, y_offset, width, height, TRUE); +// TODO: MoveWindow(GetHwnd(), x_offset, y_offset, width, height, TRUE); x_offset += cx1; y_offset += cy1; @@ -497,7 +500,7 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags) void wxRadioBox::GetSize(int *width, int *height) const { RECT rect; - rect.left = -1; rect.right = -1; rect.top = -1; rect.bottom = -1; + rect.xLeft = -1; rect.xRight = -1; rect.yTop = -1; rect.yBottom = -1; if (m_hWnd) wxFindMaxSize(m_hWnd, &rect); @@ -506,15 +509,15 @@ void wxRadioBox::GetSize(int *width, int *height) const for (i = 0; i < m_noItems; i++) wxFindMaxSize(m_radioButtons[i], &rect); - *width = rect.right - rect.left; - *height = rect.bottom - rect.top; + *width = rect.xRight - rect.xLeft; + *height = rect.yBottom - rect.yTop; } void wxRadioBox::GetPosition(int *x, int *y) const { wxWindow *parent = GetParent(); RECT rect; - rect.left = -1; rect.right = -1; rect.top = -1; rect.bottom = -1; + rect.xLeft = -1; rect.xRight = -1; rect.yTop = -1; rect.yBottom = -1; int i; for (i = 0; i < m_noItems; i++) @@ -525,9 +528,9 @@ void wxRadioBox::GetPosition(int *x, int *y) const // Since we now have the absolute screen coords, // if there's a parent we must subtract its top left corner - POINT point; - point.x = rect.left; - point.y = rect.top; + POINTL point; + point.x = rect.xLeft; + point.y = rect.yTop; // TODO: /* if (parent) @@ -568,7 +571,7 @@ bool wxRadioBox::Show(bool show) if ( !wxControl::Show(show) ) return FALSE; - int nCmdShow = show ? SW_SHOW : SW_HIDE; + int nCmdShow = 0; // TODO: show ? SW_SHOW : SW_HIDE; for ( int i = 0; i < m_noItems; i++ ) { // TODO: ::ShowWindow((HWND)m_radioButtons[i], nCmdShow); @@ -696,18 +699,18 @@ void wxRadioBox::SendNotificationEvent() // window proc for radio buttons // --------------------------------------------------------------------------- -MRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd, - UINT msg, - MPARAM wParam, - MPARAM lParam) +MRESULT wxRadioBtnWndProc(HWND hwnd, + UINT msg, + MPARAM wParam, + MPARAM lParam) { bool processed = TRUE; - if ( msg != WM_KEYDOWN ) - processed = FALSE; +// if ( msg != WM_KEYDOWN ) +// processed = FALSE; if ( processed ) { - wxRadioBox *radiobox = (wxRadioBox *)::GetWindowLong(hwnd, GWL_USERDATA); + wxRadioBox *radiobox = NULL; // TODO: (wxRadioBox *)::GetWindowLong(hwnd, GWL_USERDATA); wxCHECK_MSG( radiobox, 0, wxT("radio button without radio box?") ); @@ -746,7 +749,7 @@ MRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd, // fall through default: - processed = FALSE; + processed = FALSE; } */ if ( processed )