X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6cb0bfdf9d1180b7c7fcb280d18ad71864312694..ea8ca011a351c6aaa4009bedbf0cec19a7c57d98:/src/mac/classic/radiobox.cpp diff --git a/src/mac/classic/radiobox.cpp b/src/mac/classic/radiobox.cpp index 134c08c10c..39bd6b2855 100644 --- a/src/mac/classic/radiobox.cpp +++ b/src/mac/classic/radiobox.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: radiobox.cpp +// Name: src/mac/classic/radiobox.cpp // Purpose: wxRadioBox // Author: Stefan Csomor // Modified by: JS Lair (99/11/15) first implementation @@ -9,11 +9,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "radioboxbase.h" -#pragma implementation "radiobox.h" -#endif - //------------------------------------------------------------------------------------- // headers //------------------------------------------------------------------------------------- @@ -25,9 +20,7 @@ #include "wx/radiobut.h" #include "wx/mac/uma.h" -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl) -#endif //------------------------------------------------------------------------------------- // ¥ wxRadioBox() @@ -54,7 +47,6 @@ wxRadioBox::wxRadioBox() { m_noItems = 0; m_noRowsOrCols = 0; - m_majorDim = 0 ; m_radioButtonCycle = NULL; } @@ -121,10 +113,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, m_noRowsOrCols = majorDim; m_radioButtonCycle = NULL; - if (majorDim==0) - m_majorDim = n ; - else - m_majorDim = majorDim ; + SetMajorDim(majorDim == 0 ? n : majorDim, style); Rect bounds ; Str255 title ; @@ -476,7 +465,7 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags) current=m_radioButtonCycle; for ( i = 0 ; i < m_noItems; i++) { - if (i&&((i%m_majorDim)==0)) // not to do for the zero button! + if (i&&((i%GetMajorDim())==0)) // not to do for the zero button! { if (m_windowStyle & wxRA_VERTICAL) { @@ -533,43 +522,10 @@ wxSize wxRadioBox::DoGetBestSize() const totHeight = totHeight + 10; //how many exactly should this be to meet the HIG? } // handle radio box title as well - GetTextExtent(GetTitle(), &eachWidth, NULL); + GetTextExtent(GetLabel(), &eachWidth, NULL); eachWidth = (int)(eachWidth + RADIO_SIZE) + 3 * charWidth ; if (totWidth < eachWidth) totWidth = eachWidth; return wxSize(totWidth, totHeight); } -//------------------------------------------------------------------------------------- -// ¥ GetNumVer -//------------------------------------------------------------------------------------- -// return the number of buttons in the vertical direction - -int wxRadioBox::GetRowCount() const -{ - if ( m_windowStyle & wxRA_SPECIFY_ROWS ) - { - return m_majorDim; - } - else - { - return (m_noItems + m_majorDim - 1)/m_majorDim; - } -} - -//------------------------------------------------------------------------------------- -// ¥ GetNumHor -//------------------------------------------------------------------------------------- -// return the number of buttons in the horizontal direction - -int wxRadioBox::GetColumnCount() const -{ - if ( m_windowStyle & wxRA_SPECIFY_ROWS ) - { - return (m_noItems + m_majorDim - 1)/m_majorDim; - } - else - { - return m_majorDim; - } -}