diff --git a/include/wx/private/spinctrl.h b/include/wx/private/spinctrl.h index 685e8faf69..7784c0f0da 100644 --- a/include/wx/private/spinctrl.h +++ b/include/wx/private/spinctrl.h @@ -10,18 +10,18 @@ #ifndef _WX_PRIVATE_SPINCTRL_H_ #define _WX_PRIVATE_SPINCTRL_H_ -namespace wxPrivate +namespace wxSpinCtrlImpl { // This is an internal helper function currently used by all ports: return the // string containing hexadecimal representation of the given number. -extern wxString wxSpinCtrlFormatAsHex(long val, long maxVal); +extern wxString FormatAsHex(long val, long maxVal); // The helper function to determine the best size for the given control. // We can't implement this function in the wxSpinCtrlBase because MSW implementation // of wxSpinCtrl is derived from wxSpinButton but uses the same algorithm. -extern wxSize wxSpinCtrlGetBestSize(const wxControl* spin, int minVal, int maxVal, int base); +extern wxSize GetBestSize(const wxControl* spin, int minVal, int maxVal, int base); -} // namespace wxPrivate +} // namespace wxSpinCtrlImpl #endif // _WX_PRIVATE_SPINCTRL_H_ diff --git a/src/common/spinctrlcmn.cpp b/src/common/spinctrlcmn.cpp index 076e68d15d..7d67eec9c2 100644 --- a/src/common/spinctrlcmn.cpp +++ b/src/common/spinctrlcmn.cpp @@ -104,7 +104,9 @@ wxCONSTRUCTOR_6( wxSpinCtrl, wxWindow*, Parent, wxWindowID, Id, \ wxSize, Size, long, WindowStyle ) -wxString wxPrivate::wxSpinCtrlFormatAsHex(long val, long maxVal) +using namespace wxSpinCtrlImpl; + +wxString wxSpinCtrlImpl::FormatAsHex(long val, long maxVal) { // We format the value like this is for compatibility with (native // behaviour of) wxMSW @@ -117,14 +119,14 @@ wxString wxPrivate::wxSpinCtrlFormatAsHex(long val, long maxVal) return text; } -wxSize wxPrivate::wxSpinCtrlGetBestSize(const wxControl* spin, - int minVal, int maxVal, int base) +wxSize wxSpinCtrlImpl::GetBestSize(const wxControl* spin, + int minVal, int maxVal, int base) { const int lenMin = (base == 16 ? - wxSpinCtrlFormatAsHex(minVal, maxVal) : + FormatAsHex(minVal, maxVal) : wxString::Format("%d", minVal)).length(); const int lenMax = (base == 16 ? - wxSpinCtrlFormatAsHex(maxVal, maxVal) : + FormatAsHex(maxVal, maxVal) : wxString::Format("%d", maxVal)).length(); const wxString largestString('8', wxMax(lenMin, lenMax)); return spin->GetSizeFromText(largestString); diff --git a/src/generic/spinctlg.cpp b/src/generic/spinctlg.cpp index 3a53802889..0620948741 100644 --- a/src/generic/spinctlg.cpp +++ b/src/generic/spinctlg.cpp @@ -656,8 +656,7 @@ wxString wxSpinCtrl::DoValueToText(double val) switch ( GetBase() ) { case 16: - return wxPrivate::wxSpinCtrlFormatAsHex(static_cast(val), - GetMax()); + return wxSpinCtrlImpl::FormatAsHex(static_cast(val), GetMax()); default: wxFAIL_MSG( wxS("Unsupported spin control base") ); diff --git a/src/gtk/spinctrl.cpp b/src/gtk/spinctrl.cpp index ec65588bf5..76711360f9 100644 --- a/src/gtk/spinctrl.cpp +++ b/src/gtk/spinctrl.cpp @@ -359,7 +359,7 @@ wxSize wxSpinCtrlGTKBase::DoGetBestSize() const { const int minVal = static_cast(DoGetMin()); const int maxVal = static_cast(DoGetMax()); - return wxPrivate::wxSpinCtrlGetBestSize(this, minVal, maxVal, GetBase()); + return wxSpinCtrlImpl::GetBestSize(this, minVal, maxVal, GetBase()); } wxSize wxSpinCtrlGTKBase::DoGetSizeFromTextSize(int xlen, int ylen) const @@ -433,7 +433,7 @@ wx_gtk_spin_output(GtkSpinButton* spin, wxSpinCtrl* win) gtk_entry_set_text ( GTK_ENTRY(spin), - wxPrivate::wxSpinCtrlFormatAsHex(val, win->GetMax()).utf8_str() + wxSpinCtrlImpl::FormatAsHex(val, win->GetMax()).utf8_str() ); return TRUE; diff --git a/src/gtk1/spinctrl.cpp b/src/gtk1/spinctrl.cpp index 6c416de7b4..98934ec791 100644 --- a/src/gtk1/spinctrl.cpp +++ b/src/gtk1/spinctrl.cpp @@ -71,7 +71,7 @@ wx_gtk_spin_output(GtkSpinButton* spin, wxSpinCtrl* win) gtk_entry_set_text ( GTK_ENTRY(spin), - wxPrivate::wxSpinCtrlFormatAsHex(val, win->GetMax()).utf8_str() + wxSpinCtrlImpl::FormatAsHex(val, win->GetMax()).utf8_str() ); return TRUE; diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 72c8cfbb30..f5f7c442f1 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -476,7 +476,7 @@ void wxSpinCtrl::SetValue(int val) (text[1] != 'x' && text[1] != 'X')) ) { ::SetWindowText(GetBuddyHwnd(), - wxPrivate::wxSpinCtrlFormatAsHex(val, m_max).t_str()); + wxSpinCtrlImpl::FormatAsHex(val, m_max).t_str()); } m_oldValue = GetValue(); @@ -743,7 +743,7 @@ int wxSpinCtrl::GetOverlap() const wxSize wxSpinCtrl::DoGetBestSize() const { - return wxPrivate::wxSpinCtrlGetBestSize(this, GetMin(), GetMax(), GetBase()); + return wxSpinCtrlImpl::GetBestSize(this, GetMin(), GetMax(), GetBase()); } wxSize wxSpinCtrl::DoGetSizeFromTextSize(int xlen, int ylen) const