diff --git a/common/include/Utilities/wxGuiTools.h b/common/include/Utilities/wxGuiTools.h index f9a3466680..702567bd3e 100644 --- a/common/include/Utilities/wxGuiTools.h +++ b/common/include/Utilities/wxGuiTools.h @@ -181,11 +181,18 @@ pxWindowAndFlags operator | ( const wxSizerFlags& _flgs, WinType& _win extern void operator+=( wxSizer& target, wxWindow* src ); extern void operator+=( wxSizer& target, wxSizer* src ); extern void operator+=( wxSizer& target, int spacer ); - -extern void operator+=( wxWindow& target, wxWindow* src ); -extern void operator+=( wxWindow& target, wxSizer* src ); extern void operator+=( wxWindow& target, int spacer ); +// Important: This template is needed in order to retain window type information and +// invoke the proper overloaded version of += (which is used by pxStaticText and other +// classes to perform special actions when added to sizers). +template< typename WinType > +void operator+=( wxWindow& target, WinType* src ) +{ + if( !pxAssert( target.GetSizer() != NULL ) ) return; + *target.GetSizer() += src; +} + template< typename WinType > void operator+=( wxSizer& target, const pxWindowAndFlags& src ) { diff --git a/common/src/Utilities/wxGuiTools.cpp b/common/src/Utilities/wxGuiTools.cpp index 840caca744..b54155bef1 100644 --- a/common/src/Utilities/wxGuiTools.cpp +++ b/common/src/Utilities/wxGuiTools.cpp @@ -115,18 +115,6 @@ void operator+=( wxSizer& target, int spacer ) target.AddSpacer( spacer ); } -void operator+=( wxWindow& target, wxWindow* src ) -{ - if( !pxAssert( target.GetSizer() != NULL ) ) return; - *target.GetSizer() += src; -} - -void operator+=( wxWindow& target, wxSizer* src ) -{ - if( !pxAssert( target.GetSizer() != NULL ) ) return; - *target.GetSizer() += src; -} - void operator+=( wxWindow& target, int spacer ) { if( !pxAssert( target.GetSizer() != NULL ) ) return; diff --git a/pcsx2/gui/Panels/VideoPanel.cpp b/pcsx2/gui/Panels/VideoPanel.cpp index c072a7e351..e2ebea9f74 100644 --- a/pcsx2/gui/Panels/VideoPanel.cpp +++ b/pcsx2/gui/Panels/VideoPanel.cpp @@ -54,6 +54,10 @@ wxTextCtrl* CreateNumericalTextCtrl( wxWindow* parent, int digits ) return ctrl; } +// -------------------------------------------------------------------------------------- +// FramelimiterPanel Implementations +// -------------------------------------------------------------------------------------- + Panels::FramelimiterPanel::FramelimiterPanel( wxWindow* parent ) : BaseApplicableConfigPanel( parent ) { @@ -137,12 +141,27 @@ Panels::FramelimiterPanel::FramelimiterPanel( wxWindow* parent ) m_text_BaseNtsc ->SetValue( L"59.94" ); m_text_BasePal ->SetValue( L"50.00" ); + + OnSettingsChanged(); +} + +void Panels::FramelimiterPanel::OnSettingsChanged() +{ + const Pcsx2Config::VideoOptions& conf( g_Conf->EmuOptions.Video ); + + // TODO : Apply options from config *to* checkboxes (once video config struct is implemented) } void Panels::FramelimiterPanel::Apply() { + Pcsx2Config::VideoOptions& conf( g_Conf->EmuOptions.Video ); + + // TODO : Apply options from checkboxes (once video config struct is is implemented) } +// -------------------------------------------------------------------------------------- +// GSWindowSetting Implementation +// -------------------------------------------------------------------------------------- Panels::GSWindowSettingsPanel::GSWindowSettingsPanel( wxWindow* parent ) : BaseApplicableConfigPanel( parent ) @@ -210,6 +229,10 @@ void Panels::GSWindowSettingsPanel::Apply() { } +// -------------------------------------------------------------------------------------- +// VideoPanel Implementation +// -------------------------------------------------------------------------------------- + Panels::VideoPanel::VideoPanel( wxWindow* parent ) : BaseApplicableConfigPanel( parent ) { @@ -232,6 +255,7 @@ Panels::VideoPanel::VideoPanel( wxWindow* parent ) : *s_table += left | StdExpand(); *s_table += right | StdExpand(); + *this += StaticHeading(L"This panel is not implemented yet.\nIT DOES NOT WORK. AT ALL."); *this += s_table; // TODO: