/////////////////////////////////////////////////////////////////////////////
-// Name: radiobox.cpp
+// Name: src/os2/radiobox.cpp
// Purpose: wxRadioBox
// Author: David Webster
// Modified by:
//
// Create a dummy radio control to end the group.
//
- (void)::WinCreateWindow ( GetHwndOf(pParent)
- ,WC_BUTTON
- ,""
- ,WS_GROUP | BS_AUTORADIOBUTTON
- ,0, 0, 0, 0
- ,GetWinHwnd(pParent)
- ,HWND_TOP
- ,(HMENU)NewControlId()
- ,NULL
- ,NULL
+ (void)::WinCreateWindow ( GetHwndOf(pParent),
+ WC_BUTTON,
+ "",
+ WS_GROUP | BS_AUTORADIOBUTTON,
+ 0, 0, 0, 0,
+ GetWinHwnd(pParent),
+ HWND_TOP,
+ (HMENU)NewControlId(),
+ NULL,
+ NULL
);
SetFont(*wxSMALL_FONT);
fnWndProcRadioBox = (WXFARPROC)::WinSubclassWindow( GetHwnd()
return true;
} // end of wxRadioBox::Enable
-int wxRadioBox::FindString(
- const wxString& rsStr
-) const
-{
- for (int i = 0; i < m_nNoItems; i++)
- {
- if (rsStr == wxGetWindowText(m_ahRadioButtons[i]) )
- return i;
- }
- return wxNOT_FOUND;
-} // end of wxRadioBox::FindString
-
int wxRadioBox::GetColumnCount() const
{
return GetNumHor();
return m_nNoItems;
} // end of wxRadioBox::GetCount
-wxString wxRadioBox::GetLabel(
- int nItem
-) const
+wxString wxRadioBox::GetLabel(int nItem) const
{
wxCHECK_MSG( IsValid(nItem), wxEmptyString, wxT("invalid radiobox index") );
return m_nSelectedButton;
} // end of wxRadioBox::GetSelection
-void wxRadioBox::GetSize(
- int* pnWidth
-, int* pnHeight
-) const
+void wxRadioBox::GetSize( int* pnWidth, int* pnHeight ) const
{
RECT vRect;
int i;
//
// And also wide enough for its label
//
- GetTextExtent( GetTitle()
- ,&nWidthLabel
- ,NULL
- );
+ GetTextExtent( GetLabel(), &nWidthLabel, NULL );
nWidthLabel += RADIO_SIZE;
if (nWidthLabel > nWidth)
nWidth = nWidthLabel;
::WinSetWindowText((HWND)m_ahRadioButtons[nItem], (PSZ)rsLabel.c_str());
} // end of wxRadioBox::SetString
-bool wxRadioBox::SetStringSelection(
- const wxString& rsStr
-)
+bool wxRadioBox::SetStringSelection(const wxString& rsStr)
{
- int nSel = FindString(rsStr);
+ int nSel = FindString(rsStr);
if (nSel > -1)
{
);
} // end of wxRadioBtnWndProc
-MRESULT EXPENTRY wxRadioBoxWndProc(
- HWND hWnd
-, UINT uMessage
-, MPARAM wParam
-, MPARAM lParam
-)
+MRESULT EXPENTRY wxRadioBoxWndProc( HWND hWnd,
+ UINT uMessage,
+ MPARAM wParam,
+ MPARAM lParam )
{
- return (fnWndProcRadioBox( hWnd
- ,(ULONG)uMessage
- ,(MPARAM)wParam
- ,(MPARAM)lParam
- )
+ return (fnWndProcRadioBox( hWnd,
+ (ULONG)uMessage,
+ (MPARAM)wParam,
+ (MPARAM)lParam )
);
} // end of wxRadioBoxWndProc