]> git.saurik.com Git - wxWidgets.git/commitdiff
Linup API of wxRadioBox::Show on all ports. Move wxRadioBox::IsValid from wxUniversal...
authorWłodzimierz Skiba <abx@abx.art.pl>
Wed, 23 Feb 2005 16:52:31 +0000 (16:52 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Wed, 23 Feb 2005 16:52:31 +0000 (16:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32329 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/os2/radiobox.h
include/wx/palmos/radiobox.h
include/wx/univ/radiobox.h
src/os2/radiobox.cpp
src/palmos/radiobox.cpp
src/univ/radiobox.cpp

index f1309b5bf33dc5d4a7e2494b8d37dd74378fc400..955dc12e4236f425f1a54ad32cf2c40a441e9da9 100644 (file)
@@ -116,10 +116,8 @@ public:
                                 ,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
index c69f7a951f0eae272f562c411ccdbaacb7faccc1..f98c57b851138f73f4ca7ab0dc4f8d70be40fcb6 100644 (file)
@@ -100,7 +100,7 @@ public:
     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();
index 59a06918b314c8bb2eb52ec1e0c6979b141f3c3e..67cf04bc1ee871f73b71a3db87d8120d1253e40b 100644 (file)
@@ -96,7 +96,7 @@ public:
     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);
@@ -132,9 +132,6 @@ protected:
     // 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);
 
index 3e52e2a3a2cabeac60baa62587c71a860cc629c4..1f789a294ff9bf3f903f7253ebb0d288afcdb079 100644 (file)
@@ -474,9 +474,9 @@ void wxRadioBox::DoSetSize(
             ,&nHeightOld
            );
 
-    if (nX == -1 && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
+    if (nX == wxDefaultCoord && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
         nXx = nCurrentX;
-    if (nY == -1 && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
+    if (nY == wxDefaultCoord && !(nSizeFlags & wxSIZE_ALLOW_MINUS_ONE))
         nYy = nCurrentY;
     if (nYy < 0)
         nYy = 0;
@@ -671,7 +671,7 @@ void wxRadioBox::DoSetSize(
 
 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);
@@ -715,7 +715,7 @@ wxString wxRadioBox::GetLabel(
   int                               nItem
 ) const
 {
-    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
@@ -1052,9 +1052,9 @@ void wxRadioBox::SetSelection(
   int                               nNum
 )
 {
-    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);
@@ -1067,7 +1067,7 @@ void wxRadioBox::SetString(
 , 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());
@@ -1103,15 +1103,17 @@ bool wxRadioBox::Show(
 } // end of wxRadioBox::Show
 
 // Show a specific button
-void wxRadioBox::Show(
+bool wxRadioBox::Show(
   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);
+
+    return true;
 } // end of wxRadioBox::Show
 
 void wxRadioBox::SubclassRadioButton(
index 1031b08ccb82b30f82e76c6e5e3fbffd6a4341c6..91febb54859f37335a654ed43f649adb0ff95685 100644 (file)
@@ -354,12 +354,15 @@ bool wxRadioBox::Enable(int item, bool enable)
 
 bool wxRadioBox::Show(bool show)
 {
+    // TODO
     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()
index a9e5d1a34c147386088b265d1e925e1766c21d1f..bb6aa6eda12af41d954e51e2b39cacf99f81c21a 100644 (file)
@@ -329,11 +329,11 @@ bool wxRadioBox::Enable(int n, bool 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);
 }
 
 // ----------------------------------------------------------------------------