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 "wxHelpers.h"
#include "Utilities/SafeArray.h"
namespace Panels
{
@ -70,19 +71,44 @@ namespace Panels
class PathsPanel: public wxPanelWithHelpers
{
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
{
protected:
wxBoxSizer& s_main;
public:
MyBasePanel(wxWindow& parent, int id=wxID_ANY);
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
{
public:
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

View File

@ -25,76 +25,94 @@
using namespace wxHelpers;
static const int BetweenFolderSpace = 5;
// ------------------------------------------------------------------------
wxDirPickerCtrl& Panels::PathsPanel::MyBasePanel::AddDirPicker( wxBoxSizer& sizer, int id, const wxDirName& defaultPath, const wxString& label, const wxString& dialogLabel, bool pathMustExist )
void Panels::PathsPanel::DirPickerPanel::UseDefaultPath_Click(wxCommandEvent &event)
{
// fixme: Should wxGTK (linux) force-enable the wxDIRP_USE_TEXTCTRL? It's not "standard" on that platform
// but it might still be preferred. - air
wxASSERT( m_pickerCtrl != NULL && m_checkCtrl != NULL );
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();
wxDirPickerCtrl* jobe = new wxDirPickerCtrl( this, id, normalized.ToString(), dialogLabel );
wxStaticBoxSizer& s_box = *new wxStaticBoxSizer( wxVERTICAL, this, label );
s_box.Add( jobe, wxSizerFlags().Border(wxLEFT | wxRIGHT | wxTOP, 5).Expand() );
AddCheckBox( s_box, _("Use operating system default settings") );
sizer.Add( &s_box, SizerFlags::StdGroupie() );
return *jobe;
// Force the Dir Picker to use a text control. This isn't standard on Linux/GTK but it's much
// more usable, so to hell with standards.
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 ) :
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 ) :
MyBasePanel( parent, id )
{
wxBoxSizer& s_main = *new wxBoxSizer( wxVERTICAL );
AddDirPicker( s_main, wxID_ANY, g_Conf.Folders.Bios, _("Bios:"), _("Select folder with PS2 Bios") )
.SetToolTip( pxE(Msg_Tooltips_Bios) );
AddDirPicker( s_main, g_Conf.Folders.Bios, PathDefs::GetBios,
_("Bios:"), _("Select folder with PS2 Bios"), Msg_Tooltips_Bios );
s_main.AddSpacer( BetweenFolderSpace );
AddDirPicker( s_main, wxID_ANY, g_Conf.Folders.Savestates, _("Savestates:"), _("Select folder for Savestates") )
.SetToolTip( pxE(Msg_Tooltips_Savestates) );
AddDirPicker( s_main, g_Conf.Folders.Savestates, PathDefs::GetSavestates,
_("Savestates:"), _("Select folder for Savestates"), Msg_Tooltips_Savestates );
s_main.AddSpacer( BetweenFolderSpace );
AddDirPicker( s_main, wxID_ANY, g_Conf.Folders.Snapshots, _("Snapshots:"), _("Select a folder for Snapshots") )
.SetToolTip( pxE(Msg_Tooltips_Snapshots) );
AddDirPicker( s_main, g_Conf.Folders.Snapshots, PathDefs::GetSnapshots,
_("Snapshots:"), _("Select a folder for Snapshots"), Msg_Tooltips_Snapshots );
s_main.AddSpacer( BetweenFolderSpace );
AddDirPicker( s_main, wxID_ANY, g_Conf.Folders.Logs, _("Log/Dumps:" ), _("Select a folder for logs/dumps") )
.SetToolTip( pxE(Msg_Tooltips_Logs) );
AddDirPicker( s_main, g_Conf.Folders.Logs, PathDefs::GetLogs,
_("Logs/Dumps:" ), _("Select a folder for logs/dumps"), Msg_Tooltips_Logs );
s_main.AddSpacer( BetweenFolderSpace );
AddDirPicker( s_main, wxID_ANY, g_Conf.Folders.MemoryCards, _("Memorycards:"), _("Select a default Memorycards folder") )
.SetToolTip( pxE(Msg_Tooltips_Memorycards) );
AddDirPicker( s_main, g_Conf.Folders.MemoryCards, PathDefs::GetMemoryCards,
_("Memorycards:"), _("Select a default Memorycards folder"), Msg_Tooltips_Memorycards );
s_main.AddSpacer( 5 );
SetSizerAndFit( &s_main );
}
// ------------------------------------------------------------------------
Panels::PathsPanel::AdvancedPanel::AdvancedPanel( wxWindow& parent, int id ) :
MyBasePanel( parent, id )
{
wxBoxSizer& s_main = *new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer& advanced = *new wxStaticBoxSizer( wxVERTICAL, this, _("Advanced") );
AddStaticText( advanced, pxE(Msg_Dialog_AdvancedPaths), 420, wxALIGN_CENTRE );
AddDirPicker( advanced, wxID_ANY, g_Conf.Folders.Plugins, _("Plugins:"), _("Select folder for PCSX2 plugins") )
.SetToolTip( pxE(Msg_Tooltips_PluginsPath) );
AddDirPicker( advanced, g_Conf.Folders.Plugins, PathDefs::GetPlugins,
_("Plugins:"), _("Select folder for PCSX2 plugins"), Msg_Tooltips_PluginsPath );
advanced.AddSpacer( BetweenFolderSpace );
AddDirPicker( advanced, wxID_ANY, g_Conf.Folders.Settings, _("Settings:"), _("Select a folder for PCSX2 settings/inis") )
.SetToolTip( pxE(Msg_Tooltips_SettingsPath) );
AddDirPicker( advanced, g_Conf.Folders.Settings, PathDefs::GetSettings,
_("Settings:"), _("Select a folder for PCSX2 settings/inis"), Msg_Tooltips_SettingsPath );
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 )
{
wxBoxSizer& mainSizer = *new wxBoxSizer( wxVERTICAL );
wxBoxSizer& secondarySizer = *new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer& sliderSizer = *new wxStaticBoxSizer( wxVERTICAL, this, _("Cycle Hacks") );
wxStaticBoxSizer& miscSizer = *new wxStaticBoxSizer( wxVERTICAL, this, _("Misc Speed Hacks") );