Apply proper qualifier use for operator+= templates and their specializations.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2225 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-11-19 13:44:44 +00:00
parent b11dab02ef
commit 4aa0ebe892
6 changed files with 57 additions and 60 deletions

View File

@ -56,22 +56,10 @@ protected:
void Init( const wxString& label, const wxString& subtext );
};
static void operator+=( wxSizer& target, pxCheckBox* src )
{
if( !pxAssert( src != NULL ) ) return;
target.Add( src, wxSF.Expand() );
}
extern void operator+=( wxSizer& target, pxCheckBox* src );
#ifdef __LINUX__
template<>
void operator+=( wxSizer& target, const pxWindowAndFlags<pxCheckBox>& src )
{
target.Add( src.window, src.flags );
}
#else
template<>
static void operator+=( wxSizer& target, const pxWindowAndFlags<pxCheckBox>& src )
{
target.Add( src.window, src.flags );
}
#endif

View File

@ -84,25 +84,14 @@ protected:
void _setLabel();
};
static void operator+=( wxSizer& target, pxStaticText* src )
{
if( !pxAssert( src != NULL ) ) return;
src->AddTo( target );
}
extern void operator+=( wxSizer& target, pxStaticText* src );
#ifdef __LINUX__
template<>
void operator+=( wxSizer& target, const pxWindowAndFlags<pxStaticText>& src )
{
target.Add( src.window, src.flags );
}
#else
template<>
static void operator+=( wxSizer& target, const pxWindowAndFlags<pxStaticText>& src )
{
target.Add( src.window, src.flags );
}
#endif
// --------------------------------------------------------------------------------------
// pxStaticHeading
// --------------------------------------------------------------------------------------

View File

@ -88,65 +88,46 @@ static pxWindowAndFlags<WinType> operator | ( const wxSizerFlags& _flgs, WinType
// is added to the dialog/panel's toplevel sizer (wxPanel.GetSizer() is used). If the panel
// has no sizer set via SetSizer(), an assertion is generated.
//
extern void operator+=( wxSizer& target, wxWindow* src );
extern void operator+=( wxSizer& target, wxSizer* src );
extern void operator+=( wxSizer& target, int spacer );
extern void operator+=( wxPanel& target, int spacer );
extern void operator+=( wxDialog& target, int spacer );
template< typename WinType >
static void operator+=( wxSizer& target, const pxWindowAndFlags<WinType>& src )
void operator+=( wxSizer& target, const pxWindowAndFlags<WinType>& src )
{
target.Add( src.window, src.flags );
}
static void operator+=( wxSizer& target, wxWindow* src )
{
target.Add( src );
}
static void operator+=( wxSizer& target, wxSizer* src )
{
target.Add( src );
}
static void operator+=( wxSizer& target, int spacer )
{
target.AddSpacer( spacer );
}
template< typename WinType >
static void operator+=( wxPanel& target, const pxWindowAndFlags<WinType>& src )
void operator+=( wxPanel& target, const pxWindowAndFlags<WinType>& src )
{
if( !pxAssert( target.GetSizer() != NULL ) ) return;
*target.GetSizer() += src;
}
template< typename WinType >
static void operator+=( wxPanel& target, WinType* src )
{
if( !pxAssert( target.GetSizer() != NULL ) ) return;
*target.GetSizer() += src;
}
static void operator+=( wxPanel& target, int spacer )
{
if( !pxAssert( target.GetSizer() != NULL ) ) return;
target.GetSizer()->AddSpacer( spacer );
}
template< typename WinType >
static void operator+=( wxDialog& target, const pxWindowAndFlags<WinType>& src )
void operator+=( wxPanel& target, WinType* src )
{
if( !pxAssert( target.GetSizer() != NULL ) ) return;
*target.GetSizer() += src;
}
template< typename WinType >
static void operator+=( wxDialog& target, WinType* src )
void operator+=( wxDialog& target, const pxWindowAndFlags<WinType>& src )
{
if( !pxAssert( target.GetSizer() != NULL ) ) return;
*target.GetSizer() += src;
}
static void operator+=( wxDialog& target, int spacer )
template< typename WinType >
void operator+=( wxDialog& target, WinType* src )
{
if( !pxAssert( target.GetSizer() != NULL ) ) return;
target.GetSizer()->AddSpacer( spacer );
*target.GetSizer() += src;
}

View File

@ -70,3 +70,9 @@ bool pxCheckBox::GetValue() const
{
return m_checkbox->GetValue();
}
void operator+=( wxSizer& target, pxCheckBox* src )
{
if( !pxAssert( src != NULL ) ) return;
target.Add( src, wxSF.Expand() );
}

View File

@ -120,3 +120,9 @@ pxStaticHeading::pxStaticHeading( wxWindow* parent, const wxString& label, int s
{
m_centerPadding = 0.18;
}
void operator+=( wxSizer& target, pxStaticText* src )
{
if( !pxAssert( src != NULL ) ) return;
src->AddTo( target );
}

View File

@ -98,6 +98,33 @@ wxSizerFlags pxSizerFlags::Checkbox()
return StdExpand();
}
void operator+=( wxSizer& target, wxWindow* src )
{
target.Add( src );
}
void operator+=( wxSizer& target, wxSizer* src )
{
target.Add( src );
}
void operator+=( wxSizer& target, int spacer )
{
target.AddSpacer( spacer );
}
void operator+=( wxPanel& target, int spacer )
{
if( !pxAssert( target.GetSizer() != NULL ) ) return;
target.GetSizer()->AddSpacer( spacer );
}
void operator+=( wxDialog& target, int spacer )
{
if( !pxAssert( target.GetSizer() != NULL ) ) return;
target.GetSizer()->AddSpacer( spacer );
}
// --------------------------------------------------------------------------------------
// pxTextWrapper / pxTextWrapperBase Implementations
// --------------------------------------------------------------------------------------