/////////////////////////////////////////////////////////////////////////////
-// Name: radiobox.cpp
+// Name: src/os2/radiobox.cpp
// Purpose: wxRadioBox
// Author: David Webster
// Modified by:
delete[] m_pnRadioHeight;
} // end of wxRadioBox::~wxRadioBox
-void wxRadioBox::AdjustButtons(
- int nX
-, int nY
-, int nWidth
-, int nHeight
-, int nSizeFlags
-)
+void wxRadioBox::AdjustButtons( int nX,
+ int nY,
+ int nWidth,
+ int nHeight,
+ int WXUNUSED(nSizeFlags) )
{
- wxSize vMaxSize;
- int nXOffset = nX;
- int nYOffset = nY + nHeight;
- int nCx1;
- int nCy1;
- int nStartX;
- int nStartY;
- int nMaxWidth;
- int nMaxHeight;
- wxFont vFont = GetFont();
+ wxSize vMaxSize;
+ int nXOffset = nX;
+ int nYOffset = nY + nHeight;
+ int nCx1;
+ int nCy1;
+ int nStartX;
+ int nStartY;
+ int nMaxWidth;
+ int nMaxHeight;
+ wxFont vFont = GetFont();
wxGetCharSize( m_hWnd
,&nCx1
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") );
if (nHeightMax < nHeight )
nHeightMax = nHeight;
}
- return(wxSize( nWidthMax
- ,nHeightMax
- )
- );
+ wxSize maxsize( nWidthMax, nHeightMax);
+ return maxsize;
} // end of wxRadioBox::GetMaxButtonSize
int wxRadioBox::GetNumHor() const
}
} // end of wxRadioBox::GetNumVer
-void wxRadioBox::GetPosition(
- int* pnX
-, int* pnY
-) const
+void wxRadioBox::GetPosition( int* pnX,
+ int* WXUNUSED(pnY) ) const
{
wxWindowOS2* pParent = GetParent();
- RECT vRect = { -1, -1, -1, -1 };;
+ RECT vRect = { -1, -1, -1, -1 };
POINTL vPoint;
int i;
return sResult;
} // end of wxRadioBox::GetStringSelection
-wxSize wxRadioBox::GetTotalButtonSize(
- const wxSize& rSizeBtn
-) const
+wxSize wxRadioBox::GetTotalButtonSize( const wxSize& rSizeBtn ) const
{
- int nCx1;
- int nCy1;
- int nExtraHeight;
- int nHeight;
- int nWidth;
- int nWidthLabel;
- wxFont vFont = GetFont();
-
- wxGetCharSize( m_hWnd
- ,&nCx1
- ,&nCy1
- ,&vFont
- );
+ int nCx1;
+ int nCy1;
+ int nExtraHeight;
+ int nHeight;
+ int nWidth;
+ int nWidthLabel;
+ wxFont vFont = GetFont();
+
+ wxGetCharSize( m_hWnd, &nCx1, &nCy1, &vFont );
nExtraHeight = nCy1;
nHeight = GetNumVer() * rSizeBtn.y + (2 * nCy1);
if (nWidthLabel > nWidth)
nWidth = nWidthLabel;
- return(wxSize( nWidth
- ,nHeight
- )
- );
+ wxSize total( nWidth, nHeight );
+ return total;
} // end of wxRadioBox::GetTotalButtonSize
-WXHBRUSH wxRadioBox::OnCtlColor(
- WXHDC hwinDC
-, WXHWND hWnd
-, WXUINT uCtlColor
-, WXUINT uMessage
-, WXWPARAM wParam
-, WXLPARAM lParam
-)
+WXHBRUSH wxRadioBox::OnCtlColor( WXHDC hwinDC,
+ WXHWND WXUNUSED(hWnd),
+ WXUINT WXUNUSED(uCtlColor),
+ WXUINT WXUNUSED(uMessage),
+ WXWPARAM WXUNUSED(wParam),
+ WXLPARAM WXUNUSED(lParam) )
{
- HPS hPS = (HPS)hwinDC; // pass in a PS handle in OS/2
+ HPS hPS = (HPS)hwinDC; // pass in a PS handle in OS/2
if (GetParent()->GetTransparentBackground())
::GpiSetBackMix(hPS, BM_LEAVEALONE);
else
::GpiSetBackMix(hPS, BM_OVERPAINT);
- wxColour vColBack = GetBackgroundColour();
+ wxColour vColBack = GetBackgroundColour();
::GpiSetBackColor(hPS, vColBack.GetPixel());
::GpiSetColor(hPS, vColBack.GetPixel());
-
- wxBrush* pBrush = wxTheBrushList->FindOrCreateBrush( vColBack
- ,wxSOLID
- );
+ wxBrush* pBrush = wxTheBrushList->FindOrCreateBrush( vColBack, wxSOLID );
return ((WXHBRUSH)pBrush->GetResourceHandle());
} // end of wxRadioBox::OnCtlColor
-bool wxRadioBox::OS2Command(
- WXUINT uCmd
-, WXWORD wId
-)
+bool wxRadioBox::OS2Command( WXUINT uCmd,
+ WXWORD wId)
{
- int nSelectedButton = -1;
+ int nSelectedButton = -1;
if (uCmd == BN_CLICKED)
{
::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 wxRadioBoxWndProc
-