git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32329
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
,WXWORD wId
);
void SendNotificationEvent(void);
,WXWORD wId
);
void SendNotificationEvent(void);
- virtual void Show( int nItem
- ,bool bShow = true
- ) ;
- bool Show(bool bShow);
+ virtual bool Show(int nItem, bool bShow = true);
+ virtual bool Show(bool bShow = true);
MRESULT WindowProc( WXUINT uMsg
,WXWPARAM wParam
,WXLPARAM lParam
MRESULT WindowProc( WXUINT uMsg
,WXWPARAM wParam
,WXLPARAM lParam
virtual bool Enable(int n, bool enable = true);
virtual bool Show(bool show = true);
virtual bool Enable(int n, bool enable = true);
virtual bool Show(bool show = true);
- virtual void Show(int n, bool show = true);
+ virtual bool Show(int n, bool show = true);
virtual void SetLabel(const wxString& label);
virtual wxString GetLabel();
virtual void SetLabel(const wxString& label);
virtual wxString GetLabel();
virtual void SetString(int n, const wxString& label);
virtual bool Enable(int n, bool enable = true);
virtual void SetString(int n, const wxString& label);
virtual bool Enable(int n, bool enable = true);
- virtual void Show(int n, bool show = true);
+ virtual bool Show(int n, bool show = true);
// we also override the wxControl methods to avoid virtual function hiding
virtual bool Enable(bool enable = true);
// we also override the wxControl methods to avoid virtual function hiding
virtual bool Enable(bool enable = true);
// common part of all ctors
void Init();
// common part of all ctors
void Init();
- // check that the index is valid
- bool IsValid(int n) const { return n >= 0 && n < GetCount(); }
-
// sets m_majorDim and calculate m_numCols and m_numRows
void SetMajorDim(int majorDim);
// sets m_majorDim and calculate m_numCols and m_numRows
void SetMajorDim(int majorDim);
- if (nX == -1 && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
+ if (nX == wxDefaultCoord && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
- if (nY == -1 && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
+ if (nY == wxDefaultCoord && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
nYy = nCurrentY;
if (nYy < 0)
nYy = 0;
nYy = nCurrentY;
if (nYy < 0)
nYy = 0;
bool wxRadioBox::Enable(int nItem, bool bEnable)
{
bool wxRadioBox::Enable(int nItem, bool bEnable)
{
- wxCHECK_MSG( nItem >= 0 && nItem < m_nNoItems, false,
+ wxCHECK_MSG( IsValid(nItem), false,
wxT("invalid item in wxRadioBox::Enable()") );
::WinEnableWindow((HWND) m_ahRadioButtons[nItem], bEnable);
wxT("invalid item in wxRadioBox::Enable()") );
::WinEnableWindow((HWND) m_ahRadioButtons[nItem], bEnable);
- wxCHECK_MSG(nItem >= 0 && nItem < m_nNoItems, wxEmptyString, wxT("invalid radiobox index") );
+ wxCHECK_MSG( IsValid(nItem), wxEmptyString, wxT("invalid radiobox index") );
return wxGetWindowText(m_ahRadioButtons[nItem]);
} // end of wxRadioBox::GetLabel
return wxGetWindowText(m_ahRadioButtons[nItem]);
} // end of wxRadioBox::GetLabel
- wxCHECK_RET( (nNum >= 0) && (nNum < m_nNoItems), wxT("invalid radiobox index") );
+ wxCHECK_RET( IsValid(nNum), wxT("invalid radiobox index") );
- if (m_nSelectedButton >= 0 && m_nSelectedButton < m_nNoItems)
+ if ( IsValid(m_nSelectedButton) )
::WinSendMsg((HWND)m_ahRadioButtons[m_nSelectedButton], BM_SETCHECK, (MPARAM)0, (MPARAM)0);
::WinSendMsg((HWND)m_ahRadioButtons[nNum], BM_SETCHECK, (MPARAM)1, (MPARAM)0);
::WinSendMsg((HWND)m_ahRadioButtons[m_nSelectedButton], BM_SETCHECK, (MPARAM)0, (MPARAM)0);
::WinSendMsg((HWND)m_ahRadioButtons[nNum], BM_SETCHECK, (MPARAM)1, (MPARAM)0);
, const wxString& rsLabel
)
{
, const wxString& rsLabel
)
{
- wxCHECK_RET( nItem >= 0 && nItem < m_nNoItems, wxT("invalid radiobox index") );
+ wxCHECK_RET( IsValid(nItem), wxT("invalid radiobox index") );
m_pnRadioWidth[nItem] = m_pnRadioHeight[nItem] = -1;
::WinSetWindowText((HWND)m_ahRadioButtons[nItem], rsLabel.c_str());
m_pnRadioWidth[nItem] = m_pnRadioHeight[nItem] = -1;
::WinSetWindowText((HWND)m_ahRadioButtons[nItem], rsLabel.c_str());
} // end of wxRadioBox::Show
// Show a specific button
} // end of wxRadioBox::Show
// Show a specific button
int nItem
, bool bShow
)
{
int nItem
, bool bShow
)
{
- wxCHECK_RET( nItem >= 0 && nItem < m_nNoItems,
+ wxCHECK_MSG( IsValid(nItem), false,
wxT("invalid item in wxRadioBox::Show()") );
::WinShowWindow((HWND)m_ahRadioButtons[nItem], bShow);
wxT("invalid item in wxRadioBox::Show()") );
::WinShowWindow((HWND)m_ahRadioButtons[nItem], bShow);
} // end of wxRadioBox::Show
void wxRadioBox::SubclassRadioButton(
} // end of wxRadioBox::Show
void wxRadioBox::SubclassRadioButton(
bool wxRadioBox::Show(bool show)
{
bool wxRadioBox::Show(bool show)
{
return false;
}
// Show a specific button
return false;
}
// Show a specific button
-void wxRadioBox::Show(int item, bool show)
+bool wxRadioBox::Show(int item, bool show)
+ // TODO
+ return false;
}
wxString wxRadioBox::GetLabel()
}
wxString wxRadioBox::GetLabel()
return m_buttons[n]->Enable(enable);
}
return m_buttons[n]->Enable(enable);
}
-void wxRadioBox::Show(int n, bool show)
+bool wxRadioBox::Show(int n, bool show)
- wxCHECK_RET( IsValid(n), _T("invalid index in wxRadioBox::Show") );
+ wxCHECK_MSG( IsValid(n), false, _T("invalid index in wxRadioBox::Show") );
- m_buttons[n]->Show(show);
+ return m_buttons[n]->Show(show);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------