mirror of https://github.com/PCSX2/pcsx2.git
wxgui: missing file updates from my previous commit.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1492 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
aeaba2ad18
commit
32233c1509
|
@ -16,7 +16,7 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// All of the options screens in PCSX2 are implemented as panels which can be bound to
|
// All of the options screens in PCSX2 are implemented as panels which can be bound to
|
||||||
// either their own dialog boxes, or made into children of a paged Properties box. The
|
// either their own dialog boxes, or made into children of a paged Properties box. The
|
||||||
// paged Properties box is generally superior design, and there's a good chance we'll not
|
// paged Properties box is generally superior design, and there's a good chance we'll not
|
||||||
// want to deviate form that design anytime soon. But there's no harm in keeping nice
|
// want to deviate form that design anytime soon. But there's no harm in keeping nice
|
||||||
|
@ -28,6 +28,7 @@
|
||||||
#include <wx/statline.h>
|
#include <wx/statline.h>
|
||||||
|
|
||||||
#include "wxHelpers.h"
|
#include "wxHelpers.h"
|
||||||
|
#include "Utilities/SafeArray.h"
|
||||||
|
|
||||||
namespace Panels
|
namespace Panels
|
||||||
{
|
{
|
||||||
|
@ -46,7 +47,7 @@ namespace Panels
|
||||||
void INTCSTATSlow_Click(wxCommandEvent &event);
|
void INTCSTATSlow_Click(wxCommandEvent &event);
|
||||||
void IdleLoopFF_Click(wxCommandEvent &event);
|
void IdleLoopFF_Click(wxCommandEvent &event);
|
||||||
};
|
};
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
class GameFixesPanel: public wxPanelWithHelpers
|
class GameFixesPanel: public wxPanelWithHelpers
|
||||||
|
@ -70,19 +71,44 @@ namespace Panels
|
||||||
class PathsPanel: public wxPanelWithHelpers
|
class PathsPanel: public wxPanelWithHelpers
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
class DirPickerPanel : public wxPanelWithHelpers
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
wxDirName (*m_GetDefaultFunc)();
|
||||||
|
wxDirPickerCtrl* m_pickerCtrl;
|
||||||
|
wxCheckBox* m_checkCtrl;
|
||||||
|
|
||||||
|
public:
|
||||||
|
DirPickerPanel( wxWindow* parent, const wxDirName& initPath, wxDirName (*getDefault)(), const wxString& label, const wxString& dialogLabel );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void UseDefaultPath_Click(wxCommandEvent &event);
|
||||||
|
};
|
||||||
|
|
||||||
class MyBasePanel : public wxPanelWithHelpers
|
class MyBasePanel : public wxPanelWithHelpers
|
||||||
{
|
{
|
||||||
|
protected:
|
||||||
|
wxBoxSizer& s_main;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MyBasePanel(wxWindow& parent, int id=wxID_ANY);
|
MyBasePanel(wxWindow& parent, int id=wxID_ANY);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxDirPickerCtrl& AddDirPicker( wxBoxSizer& sizer, int id, const wxDirName& defaultPath, const wxString& label, const wxString& dialogLabel, bool pathMustExist=true );
|
void AddDirPicker( wxBoxSizer& sizer, const wxDirName& initPath, wxDirName (*getDefaultFunc)(),
|
||||||
|
const wxString& label, const wxString& popupLabel, enum ExpandedMsgEnum tooltip );
|
||||||
};
|
};
|
||||||
|
|
||||||
class StandardPanel : public MyBasePanel
|
class StandardPanel : public MyBasePanel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
StandardPanel(wxWindow& parent, int id=wxID_ANY);
|
StandardPanel(wxWindow& parent, int id=wxID_ANY);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
//DirPickerInfo m_BiosPicker;
|
||||||
|
//DirPickerInfo m_SavestatesPicker;
|
||||||
|
//DirPickerInfo m_SnapshotsPicker;
|
||||||
|
//DirPickerInfo m_MemorycardsPicker;
|
||||||
|
//DirPickerInfo m_LogsPicker;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AdvancedPanel : public MyBasePanel
|
class AdvancedPanel : public MyBasePanel
|
||||||
|
|
|
@ -25,79 +25,97 @@
|
||||||
using namespace wxHelpers;
|
using namespace wxHelpers;
|
||||||
static const int BetweenFolderSpace = 5;
|
static const int BetweenFolderSpace = 5;
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
void Panels::PathsPanel::DirPickerPanel::UseDefaultPath_Click(wxCommandEvent &event)
|
||||||
wxDirPickerCtrl& Panels::PathsPanel::MyBasePanel::AddDirPicker( wxBoxSizer& sizer, int id, const wxDirName& defaultPath, const wxString& label, const wxString& dialogLabel, bool pathMustExist )
|
|
||||||
{
|
{
|
||||||
// fixme: Should wxGTK (linux) force-enable the wxDIRP_USE_TEXTCTRL? It's not "standard" on that platform
|
wxASSERT( m_pickerCtrl != NULL && m_checkCtrl != NULL );
|
||||||
// but it might still be preferred. - air
|
m_pickerCtrl->Enable( !m_checkCtrl->IsChecked() );
|
||||||
|
m_pickerCtrl->SetPath( m_GetDefaultFunc().ToString() );
|
||||||
|
}
|
||||||
|
|
||||||
wxDirName normalized( defaultPath );
|
// ------------------------------------------------------------------------
|
||||||
|
Panels::PathsPanel::DirPickerPanel::DirPickerPanel( wxWindow* parent, const wxDirName& initPath, wxDirName (*getDefault)(),
|
||||||
|
const wxString& label, const wxString& dialogLabel ) :
|
||||||
|
wxPanelWithHelpers( parent, wxID_ANY )
|
||||||
|
, m_GetDefaultFunc( getDefault )
|
||||||
|
{
|
||||||
|
wxDirName normalized( initPath );
|
||||||
normalized.Normalize();
|
normalized.Normalize();
|
||||||
|
|
||||||
wxDirPickerCtrl* jobe = new wxDirPickerCtrl( this, id, normalized.ToString(), dialogLabel );
|
|
||||||
wxStaticBoxSizer& s_box = *new wxStaticBoxSizer( wxVERTICAL, this, label );
|
wxStaticBoxSizer& s_box = *new wxStaticBoxSizer( wxVERTICAL, this, label );
|
||||||
|
|
||||||
s_box.Add( jobe, wxSizerFlags().Border(wxLEFT | wxRIGHT | wxTOP, 5).Expand() );
|
// Force the Dir Picker to use a text control. This isn't standard on Linux/GTK but it's much
|
||||||
AddCheckBox( s_box, _("Use operating system default settings") );
|
// more usable, so to hell with standards.
|
||||||
sizer.Add( &s_box, SizerFlags::StdGroupie() );
|
|
||||||
return *jobe;
|
m_pickerCtrl = new wxDirPickerCtrl( this, wxID_ANY, normalized.ToString(), dialogLabel,
|
||||||
|
wxDefaultPosition, wxDefaultSize, wxDIRP_USE_TEXTCTRL | wxDIRP_DIR_MUST_EXIST
|
||||||
|
);
|
||||||
|
|
||||||
|
s_box.Add( m_pickerCtrl, wxSizerFlags().Border(wxLEFT | wxRIGHT | wxTOP, 5).Expand() );
|
||||||
|
m_checkCtrl = &AddCheckBox( s_box, _("Use operating system default settings") );
|
||||||
|
|
||||||
|
SetSizerAndFit( &s_box );
|
||||||
|
|
||||||
|
Connect( m_checkCtrl->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PathsPanel::DirPickerPanel::UseDefaultPath_Click ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
Panels::PathsPanel::MyBasePanel::MyBasePanel( wxWindow& parent, int id ) :
|
Panels::PathsPanel::MyBasePanel::MyBasePanel( wxWindow& parent, int id ) :
|
||||||
wxPanelWithHelpers( &parent, id )
|
wxPanelWithHelpers( &parent, id )
|
||||||
|
, s_main( *new wxBoxSizer( wxVERTICAL ) )
|
||||||
{
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void Panels::PathsPanel::MyBasePanel::AddDirPicker( wxBoxSizer& sizer, const wxDirName& initPath, wxDirName (*getDefaultFunc)(), const wxString& label, const wxString& popupLabel, ExpandedMsgEnum tooltip )
|
||||||
|
{
|
||||||
|
DirPickerPanel* dpan = new DirPickerPanel( this, initPath, getDefaultFunc, label, popupLabel );
|
||||||
|
dpan->SetToolTip( pxE(tooltip) );
|
||||||
|
sizer.Add( dpan, SizerFlags::StdGroupie() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
Panels::PathsPanel::StandardPanel::StandardPanel( wxWindow& parent, int id ) :
|
Panels::PathsPanel::StandardPanel::StandardPanel( wxWindow& parent, int id ) :
|
||||||
MyBasePanel( parent, id )
|
MyBasePanel( parent, id )
|
||||||
{
|
{
|
||||||
wxBoxSizer& s_main = *new wxBoxSizer( wxVERTICAL );
|
AddDirPicker( s_main, g_Conf.Folders.Bios, PathDefs::GetBios,
|
||||||
|
_("Bios:"), _("Select folder with PS2 Bios"), Msg_Tooltips_Bios );
|
||||||
AddDirPicker( s_main, wxID_ANY, g_Conf.Folders.Bios, _("Bios:"), _("Select folder with PS2 Bios") )
|
|
||||||
.SetToolTip( pxE(Msg_Tooltips_Bios) );
|
|
||||||
|
|
||||||
s_main.AddSpacer( BetweenFolderSpace );
|
s_main.AddSpacer( BetweenFolderSpace );
|
||||||
AddDirPicker( s_main, wxID_ANY, g_Conf.Folders.Savestates, _("Savestates:"), _("Select folder for Savestates") )
|
AddDirPicker( s_main, g_Conf.Folders.Savestates, PathDefs::GetSavestates,
|
||||||
.SetToolTip( pxE(Msg_Tooltips_Savestates) );
|
_("Savestates:"), _("Select folder for Savestates"), Msg_Tooltips_Savestates );
|
||||||
|
|
||||||
s_main.AddSpacer( BetweenFolderSpace );
|
s_main.AddSpacer( BetweenFolderSpace );
|
||||||
AddDirPicker( s_main, wxID_ANY, g_Conf.Folders.Snapshots, _("Snapshots:"), _("Select a folder for Snapshots") )
|
AddDirPicker( s_main, g_Conf.Folders.Snapshots, PathDefs::GetSnapshots,
|
||||||
.SetToolTip( pxE(Msg_Tooltips_Snapshots) );
|
_("Snapshots:"), _("Select a folder for Snapshots"), Msg_Tooltips_Snapshots );
|
||||||
|
|
||||||
s_main.AddSpacer( BetweenFolderSpace );
|
s_main.AddSpacer( BetweenFolderSpace );
|
||||||
AddDirPicker( s_main, wxID_ANY, g_Conf.Folders.Logs, _("Log/Dumps:" ), _("Select a folder for logs/dumps") )
|
AddDirPicker( s_main, g_Conf.Folders.Logs, PathDefs::GetLogs,
|
||||||
.SetToolTip( pxE(Msg_Tooltips_Logs) );
|
_("Logs/Dumps:" ), _("Select a folder for logs/dumps"), Msg_Tooltips_Logs );
|
||||||
|
|
||||||
s_main.AddSpacer( BetweenFolderSpace );
|
s_main.AddSpacer( BetweenFolderSpace );
|
||||||
AddDirPicker( s_main, wxID_ANY, g_Conf.Folders.MemoryCards, _("Memorycards:"), _("Select a default Memorycards folder") )
|
AddDirPicker( s_main, g_Conf.Folders.MemoryCards, PathDefs::GetMemoryCards,
|
||||||
.SetToolTip( pxE(Msg_Tooltips_Memorycards) );
|
_("Memorycards:"), _("Select a default Memorycards folder"), Msg_Tooltips_Memorycards );
|
||||||
|
|
||||||
s_main.AddSpacer( 5 );
|
s_main.AddSpacer( 5 );
|
||||||
|
|
||||||
SetSizerAndFit( &s_main );
|
SetSizerAndFit( &s_main );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
Panels::PathsPanel::AdvancedPanel::AdvancedPanel( wxWindow& parent, int id ) :
|
Panels::PathsPanel::AdvancedPanel::AdvancedPanel( wxWindow& parent, int id ) :
|
||||||
MyBasePanel( parent, id )
|
MyBasePanel( parent, id )
|
||||||
{
|
{
|
||||||
wxBoxSizer& s_main = *new wxBoxSizer( wxVERTICAL );
|
|
||||||
|
|
||||||
wxStaticBoxSizer& advanced = *new wxStaticBoxSizer( wxVERTICAL, this, _("Advanced") );
|
wxStaticBoxSizer& advanced = *new wxStaticBoxSizer( wxVERTICAL, this, _("Advanced") );
|
||||||
AddStaticText( advanced, pxE(Msg_Dialog_AdvancedPaths), 420, wxALIGN_CENTRE );
|
AddStaticText( advanced, pxE(Msg_Dialog_AdvancedPaths), 420, wxALIGN_CENTRE );
|
||||||
|
|
||||||
AddDirPicker( advanced, wxID_ANY, g_Conf.Folders.Plugins, _("Plugins:"), _("Select folder for PCSX2 plugins") )
|
AddDirPicker( advanced, g_Conf.Folders.Plugins, PathDefs::GetPlugins,
|
||||||
.SetToolTip( pxE(Msg_Tooltips_PluginsPath) );
|
_("Plugins:"), _("Select folder for PCSX2 plugins"), Msg_Tooltips_PluginsPath );
|
||||||
|
|
||||||
advanced.AddSpacer( BetweenFolderSpace );
|
advanced.AddSpacer( BetweenFolderSpace );
|
||||||
AddDirPicker( advanced, wxID_ANY, g_Conf.Folders.Settings, _("Settings:"), _("Select a folder for PCSX2 settings/inis") )
|
AddDirPicker( advanced, g_Conf.Folders.Settings, PathDefs::GetSettings,
|
||||||
.SetToolTip( pxE(Msg_Tooltips_SettingsPath) );
|
_("Settings:"), _("Select a folder for PCSX2 settings/inis"), Msg_Tooltips_SettingsPath );
|
||||||
|
|
||||||
wxStaticBoxSizer& s_diag = *new wxStaticBoxSizer( wxVERTICAL, this, _("Default folder mode") );
|
wxStaticBoxSizer& s_diag = *new wxStaticBoxSizer( wxVERTICAL, this, _("Default folder mode") );
|
||||||
|
|
||||||
AddStaticText( s_diag,
|
AddStaticText( s_diag,
|
||||||
L"This setting only affects folders which are set to use the default folder configurations for your "
|
L"This setting only affects folders which are set to use the default folder configurations for your "
|
||||||
L"operating system. Any folders which are configured manually will override this option. ",
|
L"operating system. Any folders which are configured manually will override this option. ",
|
||||||
|
@ -110,7 +128,7 @@ Panels::PathsPanel::AdvancedPanel::AdvancedPanel( wxWindow& parent, int id ) :
|
||||||
|
|
||||||
advanced.AddSpacer( 4 );
|
advanced.AddSpacer( 4 );
|
||||||
advanced.Add( &s_diag, SizerFlags::StdGroupie() );
|
advanced.Add( &s_diag, SizerFlags::StdGroupie() );
|
||||||
|
|
||||||
s_main.Add( &advanced, SizerFlags::StdGroupie() );
|
s_main.Add( &advanced, SizerFlags::StdGroupie() );
|
||||||
s_main.AddSpacer( 5 );
|
s_main.AddSpacer( 5 );
|
||||||
|
|
||||||
|
@ -123,7 +141,7 @@ Panels::PathsPanel::PathsPanel( wxWindow& parent, int id ) :
|
||||||
{
|
{
|
||||||
wxBoxSizer& s_main = *new wxBoxSizer( wxVERTICAL );
|
wxBoxSizer& s_main = *new wxBoxSizer( wxVERTICAL );
|
||||||
wxNotebook& notebook = *new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_BOTTOM | wxNB_FIXEDWIDTH );
|
wxNotebook& notebook = *new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_BOTTOM | wxNB_FIXEDWIDTH );
|
||||||
|
|
||||||
notebook.AddPage( new StandardPanel( notebook ), _("Standard") );
|
notebook.AddPage( new StandardPanel( notebook ), _("Standard") );
|
||||||
notebook.AddPage( new AdvancedPanel( notebook ), _("Advanced") );
|
notebook.AddPage( new AdvancedPanel( notebook ), _("Advanced") );
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,6 @@ Panels::SpeedHacksPanel::SpeedHacksPanel( wxWindow& parent, int id ) :
|
||||||
wxPanelWithHelpers( &parent, id )
|
wxPanelWithHelpers( &parent, id )
|
||||||
{
|
{
|
||||||
wxBoxSizer& mainSizer = *new wxBoxSizer( wxVERTICAL );
|
wxBoxSizer& mainSizer = *new wxBoxSizer( wxVERTICAL );
|
||||||
wxBoxSizer& secondarySizer = *new wxBoxSizer( wxHORIZONTAL );
|
|
||||||
|
|
||||||
wxStaticBoxSizer& sliderSizer = *new wxStaticBoxSizer( wxVERTICAL, this, _("Cycle Hacks") );
|
wxStaticBoxSizer& sliderSizer = *new wxStaticBoxSizer( wxVERTICAL, this, _("Cycle Hacks") );
|
||||||
wxStaticBoxSizer& miscSizer = *new wxStaticBoxSizer( wxVERTICAL, this, _("Misc Speed Hacks") );
|
wxStaticBoxSizer& miscSizer = *new wxStaticBoxSizer( wxVERTICAL, this, _("Misc Speed Hacks") );
|
||||||
|
|
Loading…
Reference in New Issue