mirror of https://github.com/PCSX2/pcsx2.git
pcsx2: remove template and pointer on overload function from wxGuiTools
Fixed clang build. Note from Gregory: C++ requests that at least 1 parameters is a class, an enumeration, or a reference to those objects. Probably to avoid to screw basic type operation. For example: *p += 4; The realy buggy code was this one because T could be an int! template T f(*ptr, T) To avoid any issue in the future the Team decide to drop all overload that use pointers.
This commit is contained in:
parent
da93a960af
commit
81458912f9
|
@ -68,9 +68,7 @@ protected:
|
|||
void OnSubtextClicked( wxCommandEvent& evt );
|
||||
};
|
||||
|
||||
extern void operator+=( wxSizer& target, pxCheckBox* src );
|
||||
extern void operator+=( wxSizer& target, pxCheckBox& src );
|
||||
extern void operator+=( wxSizer* target, pxCheckBox& src );
|
||||
|
||||
template<>
|
||||
inline void operator+=( wxSizer& target, const pxWindowAndFlags<pxCheckBox>& src )
|
||||
|
@ -78,8 +76,3 @@ inline void operator+=( wxSizer& target, const pxWindowAndFlags<pxCheckBox>& src
|
|||
target.Add( src.window, src.flags );
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void operator+=( wxSizer* target, const pxWindowAndFlags<pxCheckBox>& src )
|
||||
{
|
||||
target->Add( src.window, src.flags );
|
||||
}
|
||||
|
|
|
@ -115,9 +115,7 @@ protected:
|
|||
void SetPaddingDefaults();
|
||||
};
|
||||
|
||||
extern void operator+=( wxSizer& target, pxStaticText* src );
|
||||
extern void operator+=( wxSizer& target, pxStaticText& src );
|
||||
extern void operator+=( wxSizer* target, pxStaticText& src );
|
||||
|
||||
template<>
|
||||
inline void operator+=( wxSizer& target, const pxWindowAndFlags<pxStaticText>& src )
|
||||
|
@ -125,8 +123,3 @@ inline void operator+=( wxSizer& target, const pxWindowAndFlags<pxStaticText>& s
|
|||
target.Add( src.window, src.flags );
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void operator+=( wxSizer* target, const pxWindowAndFlags<pxStaticText>& src )
|
||||
{
|
||||
target->Add( src.window, src.flags );
|
||||
}
|
||||
|
|
|
@ -270,32 +270,6 @@ void operator+=( wxSizer& target, const pxWindowAndFlags<WinType>& src )
|
|||
target.Add( src.window, src.flags );
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Pointer Versions! (note that C++ requires one of the two operator params be a
|
||||
// "proper" object type (non-pointer), so that's why some of these are missing.
|
||||
|
||||
template< typename WinType >
|
||||
void operator+=( wxWindow* target, WinType& src )
|
||||
{
|
||||
if( !pxAssert( target != NULL ) ) return;
|
||||
if( !pxAssert( target->GetSizer() != NULL ) ) return;
|
||||
*target->GetSizer() += src;
|
||||
}
|
||||
|
||||
template< typename WinType >
|
||||
void operator+=( wxWindow* target, const pxWindowAndFlags<WinType>& src )
|
||||
{
|
||||
if( !pxAssert( target != NULL ) ) return;
|
||||
if( !pxAssert( target->GetSizer() != NULL ) ) return;
|
||||
*target->GetSizer() += src;
|
||||
}
|
||||
|
||||
template< typename WinType >
|
||||
void operator+=( wxSizer* target, const pxWindowAndFlags<WinType>& src )
|
||||
{
|
||||
if( !pxAssert( target != NULL ) ) return;
|
||||
target->Add( src.window, src.flags );
|
||||
}
|
||||
|
||||
|
||||
BEGIN_DECLARE_EVENT_TYPES()
|
||||
|
|
|
@ -21,8 +21,8 @@ CheckedStaticBox::CheckedStaticBox( wxWindow* parent, int orientation, const wxS
|
|||
, ThisSizer( *new wxStaticBoxSizer( orientation, this ) )
|
||||
, ThisToggle( *new wxCheckBox( this, wxID_ANY, title, wxPoint( 8, 0 ) ) )
|
||||
{
|
||||
this += ThisToggle;
|
||||
this += ThisSizer | pxExpand;
|
||||
*this += ThisToggle;
|
||||
*this += ThisSizer | pxExpand;
|
||||
|
||||
// Ensure that the right-side of the static group box isn't too cozy:
|
||||
SetMinWidth( ThisToggle.GetSize().GetWidth() + 32 );
|
||||
|
|
|
@ -173,7 +173,7 @@ Dialogs::BaseConfigurationDialog::BaseConfigurationDialog( wxWindow* parent, con
|
|||
void Dialogs::BaseConfigurationDialog::AddListbook( wxSizer* sizer )
|
||||
{
|
||||
if( !sizer ) sizer = GetSizer();
|
||||
sizer += m_listbook | pxExpand.Border( wxLEFT | wxRIGHT, 2 );
|
||||
*sizer += m_listbook | pxExpand.Border( wxLEFT | wxRIGHT, 2 );
|
||||
}
|
||||
|
||||
void Dialogs::BaseConfigurationDialog::CreateListbook( wxImageList& bookicons )
|
||||
|
|
Loading…
Reference in New Issue