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:
Jake.Stine 2009-07-12 01:02:50 +00:00
parent aeaba2ad18
commit 32233c1509
3 changed files with 80 additions and 37 deletions

View File

@ -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
{ {
@ -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

View File

@ -25,76 +25,94 @@
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") );

View File

@ -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") );