X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6cb0bfdf9d1180b7c7fcb280d18ad71864312694..b16de7461ac6d97b0b04a5ce4e73447925e93416:/src/mac/carbon/radiobox.cpp diff --git a/src/mac/carbon/radiobox.cpp b/src/mac/carbon/radiobox.cpp index 07210463af..685ce0a654 100644 --- a/src/mac/carbon/radiobox.cpp +++ b/src/mac/carbon/radiobox.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: radiobox.cpp +// Name: src/mac/carbon/radiobox.cpp // Purpose: wxRadioBox // Author: Stefan Csomor // Modified by: JS Lair (99/11/15) first implementation @@ -9,11 +9,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "radioboxbase.h" -#pragma implementation "radiobox.h" -#endif - //------------------------------------------------------------------------------------- // headers //------------------------------------------------------------------------------------- @@ -28,9 +23,7 @@ #include "wx/radiobut.h" #include "wx/mac/uma.h" -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl) -#endif //------------------------------------------------------------------------------------- // ¥ wxRadioBox() @@ -57,7 +50,6 @@ wxRadioBox::wxRadioBox() { m_noItems = 0; m_noRowsOrCols = 0; - m_majorDim = 0 ; m_radioButtonCycle = NULL; } @@ -126,11 +118,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); m_label = label ; @@ -485,7 +473,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_SPECIFY_ROWS) { @@ -542,45 +530,12 @@ wxSize wxRadioBox::DoGetBestSize() const totHeight = sz.y ; // 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; - } -} #endif