* Various configuration dialogs remember their positions now. :)
 * AboutBox is fixed, and is now resizable.
 * Fix for Issue 739 : usermode.ini hashes are now case-insensitive on Win32.
 * Likely Fix for Issue 740 : missing text on Linux/GTK.  (need confirmation)

DevNotes:
 * Moved IniInterface.cpp/h to the Utilities lib.  Linux makefiles will need to be updated. >_<

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3178 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2010-06-06 23:26:07 +00:00
parent a849202d28
commit e86d1d1bd4
22 changed files with 374 additions and 198 deletions

View File

@ -219,6 +219,10 @@
RelativePath="..\..\src\Utilities\HashTools.cpp" RelativePath="..\..\src\Utilities\HashTools.cpp"
> >
</File> </File>
<File
RelativePath="..\..\src\Utilities\IniInterface.cpp"
>
</File>
<File <File
RelativePath="..\..\src\Utilities\x86\MemcpyFast.cpp" RelativePath="..\..\src\Utilities\x86\MemcpyFast.cpp"
> >
@ -381,6 +385,10 @@
RelativePath="..\..\include\Utilities\HashMap.h" RelativePath="..\..\include\Utilities\HashMap.h"
> >
</File> </File>
<File
RelativePath="..\..\include\Utilities\IniInterface.h"
>
</File>
<File <File
RelativePath="..\..\include\intrin_x86.h" RelativePath="..\..\include\intrin_x86.h"
> >

View File

@ -15,11 +15,13 @@
#pragma once #pragma once
#include "FixedPointTypes.h"
#include "path.h"
#include <wx/config.h> #include <wx/config.h>
////////////////////////////////////////////////////////////////////////////////////////// // --------------------------------------------------------------------------------------
// IniInterface class (abstract base class) // IniInterface (abstract base class)
// // --------------------------------------------------------------------------------------
// This is used as an interchangable interface for both loading and saving options from an // This is used as an interchangable interface for both loading and saving options from an
// ini/configuration file. The LoadSave code takes an IniInterface, and the interface // ini/configuration file. The LoadSave code takes an IniInterface, and the interface
// implementation defines whether the options are read or written. // implementation defines whether the options are read or written.
@ -29,17 +31,19 @@
class IniInterface class IniInterface
{ {
protected: protected:
wxConfigBase& m_Config; wxConfigBase* m_Config;
public: public:
virtual ~IniInterface(); virtual ~IniInterface();
explicit IniInterface(); explicit IniInterface();
explicit IniInterface( wxConfigBase& config ); explicit IniInterface( wxConfigBase& config );
explicit IniInterface( wxConfigBase* config );
void SetPath( const wxString& path ); void SetPath( const wxString& path );
void Flush(); void Flush();
wxConfigBase& GetConfig() { return m_Config; } wxConfigBase& GetConfig() { pxAssume( m_Config ); return *m_Config; }
bool IsOk() const { return m_Config != NULL; }
virtual bool IsLoading() const=0; virtual bool IsLoading() const=0;
bool IsSaving() const { return !IsLoading(); } bool IsSaving() const { return !IsLoading(); }
@ -76,8 +80,9 @@ protected:
virtual void _EnumEntry( const wxString& var, int& value, const wxChar* const* enumArray, int defvalue )=0; virtual void _EnumEntry( const wxString& var, int& value, const wxChar* const* enumArray, int defvalue )=0;
}; };
////////////////////////////////////////////////////////////////////////////////////////// // --------------------------------------------------------------------------------------
// // IniScopedGroup
// --------------------------------------------------------------------------------------
class IniScopedGroup class IniScopedGroup
{ {
protected: protected:
@ -88,9 +93,9 @@ public:
virtual ~IniScopedGroup(); virtual ~IniScopedGroup();
}; };
////////////////////////////////////////////////////////////////////////////////////////// // --------------------------------------------------------------------------------------
// IniLoader class // IniLoader
// // --------------------------------------------------------------------------------------
// Implementation of the IniInterface base class, which maps ini actions to loading from // Implementation of the IniInterface base class, which maps ini actions to loading from
// an ini source file. // an ini source file.
// //
@ -102,6 +107,7 @@ public:
virtual ~IniLoader() throw(); virtual ~IniLoader() throw();
explicit IniLoader(); explicit IniLoader();
explicit IniLoader( wxConfigBase& config ); explicit IniLoader( wxConfigBase& config );
explicit IniLoader( wxConfigBase* config );
bool IsLoading() const { return true; } bool IsLoading() const { return true; }
@ -125,9 +131,9 @@ protected:
void _EnumEntry( const wxString& var, int& value, const wxChar* const* enumArray, int defvalue ); void _EnumEntry( const wxString& var, int& value, const wxChar* const* enumArray, int defvalue );
}; };
////////////////////////////////////////////////////////////////////////////////////////// // --------------------------------------------------------------------------------------
// IniSaver class // IniSaver
// // --------------------------------------------------------------------------------------
// Implementation of the IniInterface base class, which maps ini actions to saving to // Implementation of the IniInterface base class, which maps ini actions to saving to
// an ini dest file. // an ini dest file.
// //
@ -139,6 +145,7 @@ public:
virtual ~IniSaver(); virtual ~IniSaver();
explicit IniSaver(); explicit IniSaver();
explicit IniSaver( wxConfigBase& config ); explicit IniSaver( wxConfigBase& config );
explicit IniSaver( wxConfigBase* config );
bool IsLoading() const { return false; } bool IsLoading() const { return false; }

View File

@ -129,7 +129,7 @@ namespace Path
extern s64 GetFileSize( const wxString& path ); extern s64 GetFileSize( const wxString& path );
extern wxString Normalize( const wxString& srcpath ); extern wxString Normalize( const wxString& srcpath );
extern wxString Normalize( wxDirName srcpath ); extern wxString Normalize( const wxDirName& srcpath );
extern wxString Combine( const wxString& srcPath, const wxString& srcFile ); extern wxString Combine( const wxString& srcPath, const wxString& srcFile );
extern wxString Combine( const wxDirName& srcPath, const wxFileName& srcFile ); extern wxString Combine( const wxDirName& srcPath, const wxFileName& srcFile );

View File

@ -26,19 +26,21 @@
// * An inability to wrap text to conform to a fitted window (a limitation imposed by // * An inability to wrap text to conform to a fitted window (a limitation imposed by
// wxWidgets inability to fit individual directions, ie fit widths and then fit heights, // wxWidgets inability to fit individual directions, ie fit widths and then fit heights,
// which would allow a textbox to wrap text to a sizer-determined width, and then grow // which would allow a textbox to wrap text to a sizer-determined width, and then grow
// the sizers vertically to fit the calcuated text-wrapped height). // the sizers vertically to fit the calculated text-wrapped height).
// //
// * Textbox alignment requires aligning both the textbox contents, and aligning the text // * Textbox alignment requires aligning both the textbox contents, and aligning the text
// control within it's containing sizer. If both alignment flags do not match the result // control within it's containing sizer. If both alignment flags do not match the result
// is typically undesirable. // is typically undesirable.
// //
class pxStaticText : public wxPanel class pxStaticText : public wxWindow
{ {
typedef wxPanel _parent; typedef wxWindow _parent;
protected: protected:
wxAlignment m_align; wxString m_label;
wxString m_wrappedLabel; wxString m_wrappedLabel;
wxAlignment m_align;
bool m_autowrap; bool m_autowrap;
int m_wrappedWidth; int m_wrappedWidth;
int m_heightInLines; int m_heightInLines;
@ -51,6 +53,11 @@ protected:
protected: protected:
explicit pxStaticText( wxWindow* parent=NULL ); explicit pxStaticText( wxWindow* parent=NULL );
// wxWindow overloads!
bool AcceptsFocus() const { return false; }
bool HasTransparentBackground() { return true; }
void DoSetSize(int x, int y, int w, int h, int sizeFlags = wxSIZE_AUTO);
public: public:
pxStaticText( wxWindow* parent, const wxString& label, wxAlignment align=wxALIGN_CENTRE_HORIZONTAL ); pxStaticText( wxWindow* parent, const wxString& label, wxAlignment align=wxALIGN_CENTRE_HORIZONTAL );
pxStaticText( wxWindow* parent, int heightInLines, const wxString& label, wxAlignment align=wxALIGN_CENTRE_HORIZONTAL ); pxStaticText( wxWindow* parent, int heightInLines, const wxString& label, wxAlignment align=wxALIGN_CENTRE_HORIZONTAL );
@ -61,6 +68,11 @@ public:
virtual void SetLabel(const wxString& label); virtual void SetLabel(const wxString& label);
virtual wxString GetLabel() const { return m_label; }
pxStaticText& SetMinWidth( int width );
pxStaticText& SetMinHeight( int height );
pxStaticText& SetHeight( int lines ); pxStaticText& SetHeight( int lines );
pxStaticText& Bold(); pxStaticText& Bold();
pxStaticText& WrapAt( int width ); pxStaticText& WrapAt( int width );

View File

@ -310,7 +310,7 @@ END_DECLARE_EVENT_TYPES()
class pxDialogCreationFlags class pxDialogCreationFlags
{ {
public: public:
int MinimumWidth; wxSize MinimumSize;
wxOrientation BoxSizerOrient; wxOrientation BoxSizerOrient;
bool isResizable; bool isResizable;
@ -326,7 +326,7 @@ public:
pxDialogCreationFlags() pxDialogCreationFlags()
{ {
MinimumWidth = wxDefaultCoord; MinimumSize = wxDefaultSize;
BoxSizerOrient = wxVERTICAL; BoxSizerOrient = wxVERTICAL;
isResizable = false; isResizable = false;
hasContextHelp = false; hasContextHelp = false;
@ -362,6 +362,8 @@ public:
return *this; return *this;
} }
// NOTE: Enabling system menu on dialogs usually doesn't work, and might cause
// other unwanted behavior, such as a missing close button.
pxDialogCreationFlags& SetSystemMenu( bool enable=true ) pxDialogCreationFlags& SetSystemMenu( bool enable=true )
{ {
hasSystemMenu = enable; hasSystemMenu = enable;
@ -388,10 +390,20 @@ public:
pxDialogCreationFlags& SetMinWidth( int width ) pxDialogCreationFlags& SetMinWidth( int width )
{ {
if( width > MinimumWidth ) MinimumWidth = width; if( width > MinimumSize.x ) MinimumSize.SetWidth( width );
return *this; return *this;
} }
pxDialogCreationFlags& SetMinHeight( int height )
{
if( height > MinimumSize.y ) MinimumSize.SetHeight( height );
return *this;
}
pxDialogCreationFlags& SetMinSize( const wxSize& size )
{
return SetMinWidth(size.x).SetMinHeight(size.y);
}
pxDialogCreationFlags Horizontal() const pxDialogCreationFlags Horizontal() const
@ -424,6 +436,8 @@ public:
return pxDialogCreationFlags(*this).SetMaximize( enable ); return pxDialogCreationFlags(*this).SetMaximize( enable );
} }
// NOTE: Enabling system menu on dialogs usually doesn't work, and might cause
// other unwanted behavior, such as a missing close button.
pxDialogCreationFlags SystemMenu( bool enable=true ) const pxDialogCreationFlags SystemMenu( bool enable=true ) const
{ {
return pxDialogCreationFlags(*this).SetSystemMenu( false ); return pxDialogCreationFlags(*this).SetSystemMenu( false );
@ -473,6 +487,21 @@ public:
{ {
return pxDialogCreationFlags(*this).SetMinWidth( width ); return pxDialogCreationFlags(*this).SetMinWidth( width );
} }
pxDialogCreationFlags MinHeight( int height ) const
{
return pxDialogCreationFlags(*this).SetMinHeight( height );
}
pxDialogCreationFlags MinSize( const wxSize& size ) const
{
return pxDialogCreationFlags(*this).SetMinSize( size );
}
pxDialogCreationFlags MinSize( int width, int height ) const
{
return pxDialogCreationFlags(*this).SetMinWidth( width ).SetMinHeight( height );
}
int GetWxWindowFlags() const int GetWxWindowFlags() const
{ {
@ -498,13 +527,14 @@ class wxDialogWithHelpers : public wxDialog
protected: protected:
bool m_hasContextHelp; bool m_hasContextHelp;
wxBoxSizer* m_extraButtonSizer; wxBoxSizer* m_extraButtonSizer;
wxRect m_CreatedRect;
public: public:
wxDialogWithHelpers(); wxDialogWithHelpers();
wxDialogWithHelpers(wxWindow* parent, const wxString& title, const pxDialogCreationFlags& cflags = pxDialogCreationFlags() ); wxDialogWithHelpers(wxWindow* parent, const wxString& title, const pxDialogCreationFlags& cflags = pxDialogCreationFlags() );
virtual ~wxDialogWithHelpers() throw(); virtual ~wxDialogWithHelpers() throw();
void Init(); void Init( const pxDialogCreationFlags& cflags );
void AddOkCancel( wxSizer& sizer, bool hasApply=false ); void AddOkCancel( wxSizer& sizer, bool hasApply=false );
void AddOkCancel( wxSizer* sizer=NULL, bool hasApply=false ); void AddOkCancel( wxSizer* sizer=NULL, bool hasApply=false );
@ -522,12 +552,15 @@ public:
virtual pxStaticText& Text( const wxString& label ); virtual pxStaticText& Text( const wxString& label );
virtual pxStaticText& Heading( const wxString& label ); virtual pxStaticText& Heading( const wxString& label );
virtual wxDialogWithHelpers& SetMinWidth( int newWidth ); wxDialogWithHelpers& SetMinWidth( int newWidth );
wxDialogWithHelpers& SetMinHeight( int newHeight );
protected: protected:
void OnDialogCreated( wxCommandEvent& evt ); void OnDialogCreated( wxCommandEvent& evt );
void OnOkCancel(wxCommandEvent& evt); void OnOkCancel(wxCommandEvent& evt);
void OnCloseWindow(wxCloseEvent& event); void OnCloseWindow(wxCloseEvent& event);
void DoAutoCenter();
}; };
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------

View File

@ -14,7 +14,6 @@
*/ */
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "System.h"
#include "IniInterface.h" #include "IniInterface.h"
static int _calcEnumLength( const wxChar* const* enumArray ) static int _calcEnumLength( const wxChar* const* enumArray )
@ -29,37 +28,8 @@ static int _calcEnumLength( const wxChar* const* enumArray )
return cnt; return cnt;
} }
////////////////////////////////////////////////////////////////////////////////////////// IniScopedGroup::IniScopedGroup( IniInterface& mommy, const wxString& group )
// : m_mom( mommy )
IniInterface::IniInterface( wxConfigBase& config ) :
m_Config( config )
{
}
IniInterface::IniInterface() :
m_Config( *wxConfigBase::Get() )
{
}
IniInterface::~IniInterface()
{
Flush();
}
void IniInterface::SetPath( const wxString& path )
{
m_Config.SetPath( path );
}
void IniInterface::Flush()
{
m_Config.Flush();
}
//////////////////////////////////////////////////////////////////////////////////////////
//
IniScopedGroup::IniScopedGroup( IniInterface& mommy, const wxString& group ) :
m_mom( mommy )
{ {
pxAssertDev( wxStringTokenize( group, L"/" ).Count() <= 1, L"Cannot nest more than one group deep per instance of IniScopedGroup." ); pxAssertDev( wxStringTokenize( group, L"/" ).Count() <= 1, L"Cannot nest more than one group deep per instance of IniScopedGroup." );
m_mom.SetPath( group ); m_mom.SetPath( group );
@ -70,26 +40,62 @@ IniScopedGroup::~IniScopedGroup()
m_mom.SetPath( L".." ); m_mom.SetPath( L".." );
} }
////////////////////////////////////////////////////////////////////////////////////////// // --------------------------------------------------------------------------------------
// // IniInterface (implementations)
// --------------------------------------------------------------------------------------
IniLoader::IniLoader( wxConfigBase& config ) : IniInterface( config ) IniInterface::IniInterface( wxConfigBase& config )
{ {
m_Config = &config;
} }
IniInterface::IniInterface( wxConfigBase* config )
{
m_Config = config;
}
IniInterface::IniInterface()
{
m_Config = wxConfigBase::Get( false );
}
IniInterface::~IniInterface()
{
Flush();
}
void IniInterface::SetPath( const wxString& path )
{
if( m_Config ) m_Config->SetPath( path );
}
void IniInterface::Flush()
{
if( m_Config ) m_Config->Flush();
}
// --------------------------------------------------------------------------------------
// IniLoader (implementations)
// --------------------------------------------------------------------------------------
IniLoader::IniLoader( wxConfigBase& config ) : IniInterface( config ) { }
IniLoader::IniLoader( wxConfigBase* config ) : IniInterface( config ) { }
IniLoader::IniLoader() : IniInterface() {} IniLoader::IniLoader() : IniInterface() {}
IniLoader::~IniLoader() throw() {} IniLoader::~IniLoader() throw() {}
void IniLoader::Entry( const wxString& var, wxString& value, const wxString& defvalue ) void IniLoader::Entry( const wxString& var, wxString& value, const wxString& defvalue )
{ {
m_Config.Read( var, &value, defvalue ); if( m_Config )
m_Config->Read( var, &value, defvalue );
else
value = defvalue;
} }
void IniLoader::Entry( const wxString& var, wxDirName& value, const wxDirName& defvalue ) void IniLoader::Entry( const wxString& var, wxDirName& value, const wxDirName& defvalue )
{ {
wxString dest; wxString dest;
m_Config.Read( var, &dest, wxEmptyString ); if( m_Config ) m_Config->Read( var, &dest, wxEmptyString );
if( dest.IsEmpty() ) if( dest.IsEmpty() )
value = defvalue; value = defvalue;
@ -99,26 +105,32 @@ void IniLoader::Entry( const wxString& var, wxDirName& value, const wxDirName& d
void IniLoader::Entry( const wxString& var, wxFileName& value, const wxFileName& defvalue ) void IniLoader::Entry( const wxString& var, wxFileName& value, const wxFileName& defvalue )
{ {
wxString dest; wxString dest( defvalue.GetFullPath() );
m_Config.Read( var, &dest, defvalue.GetFullPath() ); if( m_Config ) m_Config->Read( var, &dest, defvalue.GetFullPath() );
value = dest; value = dest;
} }
void IniLoader::Entry( const wxString& var, int& value, const int defvalue ) void IniLoader::Entry( const wxString& var, int& value, const int defvalue )
{ {
m_Config.Read( var, &value, defvalue ); if( m_Config )
m_Config->Read( var, &value, defvalue );
else
value = defvalue;
} }
void IniLoader::Entry( const wxString& var, uint& value, const uint defvalue ) void IniLoader::Entry( const wxString& var, uint& value, const uint defvalue )
{ {
m_Config.Read( var, (int*)&value, (int)defvalue ); if( m_Config )
m_Config->Read( var, (int*)&value, (int)defvalue );
else
value = defvalue;
} }
void IniLoader::Entry( const wxString& var, bool& value, const bool defvalue ) void IniLoader::Entry( const wxString& var, bool& value, const bool defvalue )
{ {
// TODO : Stricter value checking on enabled/disabled? // TODO : Stricter value checking on enabled/disabled?
wxString dest; wxString dest(defvalue ? L"enabled" : L"disabled");
m_Config.Read( var, &dest, defvalue ? L"enabled" : L"disabled" ); if( m_Config ) m_Config->Read( var, &dest, dest );
value = (dest == L"enabled") || (dest == L"1"); value = (dest == L"enabled") || (dest == L"1");
} }
@ -143,23 +155,35 @@ void IniLoader::Entry( const wxString& var, Fixed100& value, const Fixed100& def
// has way too much rounding error so we really need to do things out manually.. >_< // has way too much rounding error so we really need to do things out manually.. >_<
wxString readval( value.ToString() ); wxString readval( value.ToString() );
m_Config.Read( var, &readval ); if( m_Config ) m_Config->Read( var, &readval );
value = Fixed100::FromString( readval, value ); value = Fixed100::FromString( readval, value );
} }
void IniLoader::Entry( const wxString& var, wxPoint& value, const wxPoint& defvalue ) void IniLoader::Entry( const wxString& var, wxPoint& value, const wxPoint& defvalue )
{ {
TryParse( value, m_Config.Read( var, ToString( defvalue ) ), defvalue ); if( !m_Config )
{
value = defvalue; return;
}
TryParse( value, m_Config->Read( var, ToString( defvalue ) ), defvalue );
} }
void IniLoader::Entry( const wxString& var, wxSize& value, const wxSize& defvalue ) void IniLoader::Entry( const wxString& var, wxSize& value, const wxSize& defvalue )
{ {
TryParse( value, m_Config.Read( var, ToString( defvalue ) ), defvalue ); if( !m_Config )
{
value = defvalue; return;
}
TryParse( value, m_Config->Read( var, ToString( defvalue ) ), defvalue );
} }
void IniLoader::Entry( const wxString& var, wxRect& value, const wxRect& defvalue ) void IniLoader::Entry( const wxString& var, wxRect& value, const wxRect& defvalue )
{ {
TryParse( value, m_Config.Read( var, ToString( defvalue ) ), defvalue ); if( !m_Config )
{
value = defvalue; return;
}
TryParse( value, m_Config->Read( var, ToString( defvalue ) ), defvalue );
} }
void IniLoader::_EnumEntry( const wxString& var, int& value, const wxChar* const* enumArray, int defvalue ) void IniLoader::_EnumEntry( const wxString& var, int& value, const wxChar* const* enumArray, int defvalue )
@ -175,8 +199,14 @@ void IniLoader::_EnumEntry( const wxString& var, int& value, const wxChar* const
// Sanity confirmed, proceed with craziness! // Sanity confirmed, proceed with craziness!
if( !m_Config )
{
value = defvalue;
return;
}
wxString retval; wxString retval;
m_Config.Read( var, &retval, enumArray[defvalue] ); m_Config->Read( var, &retval, enumArray[defvalue] );
int i=0; int i=0;
while( enumArray[i] != NULL && ( retval != enumArray[i] ) ) i++; while( enumArray[i] != NULL && ( retval != enumArray[i] ) ) i++;
@ -192,82 +222,95 @@ void IniLoader::_EnumEntry( const wxString& var, int& value, const wxChar* const
value = i; value = i;
} }
////////////////////////////////////////////////////////////////////////////////////////// // --------------------------------------------------------------------------------------
// // IniSaver (implementations)
// --------------------------------------------------------------------------------------
IniSaver::IniSaver( wxConfigBase& config ) : IniInterface( config ) { }
IniSaver::IniSaver( wxConfigBase* config ) : IniInterface( config ) { }
IniSaver::IniSaver( wxConfigBase& config ) : IniInterface( config )
{
}
IniSaver::IniSaver() : IniInterface() {} IniSaver::IniSaver() : IniInterface() {}
IniSaver::~IniSaver() {} IniSaver::~IniSaver() {}
void IniSaver::Entry( const wxString& var, wxString& value, const wxString& defvalue ) void IniSaver::Entry( const wxString& var, wxString& value, const wxString& defvalue )
{ {
m_Config.Write( var, value ); if( !m_Config ) return;
m_Config->Write( var, value );
} }
void IniSaver::Entry( const wxString& var, wxDirName& value, const wxDirName& defvalue ) void IniSaver::Entry( const wxString& var, wxDirName& value, const wxDirName& defvalue )
{ {
if( !m_Config ) return;
/*if( value == defvalue ) /*if( value == defvalue )
m_Config.Write( var, wxString() ); m_Config->Write( var, wxString() );
else*/ else*/
m_Config.Write( var, value.ToString() ); m_Config->Write( var, value.ToString() );
} }
void IniSaver::Entry( const wxString& var, wxFileName& value, const wxFileName& defvalue ) void IniSaver::Entry( const wxString& var, wxFileName& value, const wxFileName& defvalue )
{ {
m_Config.Write( var, value.GetFullPath() ); if( !m_Config ) return;
m_Config->Write( var, value.GetFullPath() );
} }
void IniSaver::Entry( const wxString& var, int& value, const int defvalue ) void IniSaver::Entry( const wxString& var, int& value, const int defvalue )
{ {
m_Config.Write( var, value ); if( !m_Config ) return;
m_Config->Write( var, value );
} }
void IniSaver::Entry( const wxString& var, uint& value, const uint defvalue ) void IniSaver::Entry( const wxString& var, uint& value, const uint defvalue )
{ {
m_Config.Write( var, (int)value ); if( !m_Config ) return;
m_Config->Write( var, (int)value );
} }
void IniSaver::Entry( const wxString& var, bool& value, const bool defvalue ) void IniSaver::Entry( const wxString& var, bool& value, const bool defvalue )
{ {
m_Config.Write( var, value ? L"enabled" : L"disabled" ); if( !m_Config ) return;
m_Config->Write( var, value ? L"enabled" : L"disabled" );
} }
bool IniSaver::EntryBitBool( const wxString& var, bool value, const bool defvalue ) bool IniSaver::EntryBitBool( const wxString& var, bool value, const bool defvalue )
{ {
m_Config.Write( var, value ? L"enabled" : L"disabled" ); if( m_Config ) m_Config->Write( var, value ? L"enabled" : L"disabled" );
return value; return value;
} }
int IniSaver::EntryBitfield( const wxString& var, int value, const int defvalue ) int IniSaver::EntryBitfield( const wxString& var, int value, const int defvalue )
{ {
m_Config.Write( var, value ); if( m_Config ) m_Config->Write( var, value );
return value; return value;
} }
void IniSaver::Entry( const wxString& var, Fixed100& value, const Fixed100& defvalue ) void IniSaver::Entry( const wxString& var, Fixed100& value, const Fixed100& defvalue )
{ {
if( !m_Config ) return;
// Note: the "easy" way would be to convert to double and load/save that, but floating point // Note: the "easy" way would be to convert to double and load/save that, but floating point
// has way too much rounding error so we really need to do things out manually, using strings. // has way too much rounding error so we really need to do things out manually, using strings.
m_Config.Write( var, value.ToString() ); m_Config->Write( var, value.ToString() );
} }
void IniSaver::Entry( const wxString& var, wxPoint& value, const wxPoint& defvalue ) void IniSaver::Entry( const wxString& var, wxPoint& value, const wxPoint& defvalue )
{ {
m_Config.Write( var, ToString( value ) ); if( !m_Config ) return;
m_Config->Write( var, ToString( value ) );
} }
void IniSaver::Entry( const wxString& var, wxSize& value, const wxSize& defvalue ) void IniSaver::Entry( const wxString& var, wxSize& value, const wxSize& defvalue )
{ {
m_Config.Write( var, ToString( value ) ); if( !m_Config ) return;
m_Config->Write( var, ToString( value ) );
} }
void IniSaver::Entry( const wxString& var, wxRect& value, const wxRect& defvalue ) void IniSaver::Entry( const wxString& var, wxRect& value, const wxRect& defvalue )
{ {
m_Config.Write( var, ToString( value ) ); if( !m_Config ) return;
m_Config->Write( var, ToString( value ) );
} }
void IniSaver::_EnumEntry( const wxString& var, int& value, const wxChar* const* enumArray, int defvalue ) void IniSaver::_EnumEntry( const wxString& var, int& value, const wxChar* const* enumArray, int defvalue )
@ -282,6 +325,8 @@ void IniSaver::_EnumEntry( const wxString& var, int& value, const wxChar* const*
defvalue = cnt-1; defvalue = cnt-1;
} }
if( !m_Config ) return;
if( value >= cnt ) if( value >= cnt )
{ {
Console.Warning( L"(SaveSettings) An illegal enumerated index was detected when saving '%s'", var.c_str() ); Console.Warning( L"(SaveSettings) An illegal enumerated index was detected when saving '%s'", var.c_str() );
@ -297,6 +342,6 @@ void IniSaver::_EnumEntry( const wxString& var, int& value, const wxChar* const*
value = defvalue; value = defvalue;
} }
m_Config.Write( var, enumArray[value] ); m_Config->Write( var, enumArray[value] );
} }

View File

@ -20,7 +20,7 @@
#include <wx/utils.h> #include <wx/utils.h>
// --------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------
// wxDirName Implementations // wxDirName (implementations)
// --------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------
wxFileName wxDirName::Combine( const wxFileName& right ) const wxFileName wxDirName::Combine( const wxFileName& right ) const
@ -116,10 +116,9 @@ wxString Path::Normalize( const wxString& src )
return normalize.GetFullPath(); return normalize.GetFullPath();
} }
wxString Path::Normalize( wxDirName src ) wxString Path::Normalize( const wxDirName& src )
{ {
src.Normalize(); return wxDirName(src).Normalize().ToString();
return src.ToString();
} }
// Concatenates two pathnames together, inserting delimiters (backslash on win32) // Concatenates two pathnames together, inserting delimiters (backslash on win32)

View File

@ -21,13 +21,13 @@
// pxStaticText (implementations) // pxStaticText (implementations)
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
pxStaticText::pxStaticText( wxWindow* parent ) pxStaticText::pxStaticText( wxWindow* parent )
: _parent( parent ) : _parent( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER )
{ {
m_heightInLines = 1; m_heightInLines = 1;
} }
pxStaticText::pxStaticText( wxWindow* parent, const wxString& label, wxAlignment align ) pxStaticText::pxStaticText( wxWindow* parent, const wxString& label, wxAlignment align )
: _parent( parent ) : _parent( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER )
{ {
m_heightInLines = 1; m_heightInLines = 1;
m_align = align; m_align = align;
@ -40,12 +40,19 @@ void pxStaticText::Init( const wxString& label )
{ {
m_autowrap = true; m_autowrap = true;
m_wrappedWidth = -1; m_wrappedWidth = -1;
m_label = label;
//SetHeight( 1 );
SetLabel( label );
Connect( wxEVT_PAINT, wxPaintEventHandler(pxStaticText::paintEvent) ); Connect( wxEVT_PAINT, wxPaintEventHandler(pxStaticText::paintEvent) );
} }
// we need to refresh the window after changing its size as the standard
// control doesn't always update itself properly (fials typically on window resizes where
// the control is expanded to fit -- ie the control's size changes but the position does not)
void pxStaticText::DoSetSize(int x, int y, int w, int h, int sizeFlags)
{
_parent::DoSetSize(x, y, w, h, sizeFlags);
Refresh();
}
void pxStaticText::SetPaddingDefaults() void pxStaticText::SetPaddingDefaults()
{ {
m_paddingPix_horiz = 7; m_paddingPix_horiz = 7;
@ -55,6 +62,18 @@ void pxStaticText::SetPaddingDefaults()
m_paddingPct_vert = 0.0f; m_paddingPct_vert = 0.0f;
} }
pxStaticText& pxStaticText::SetMinWidth( int width )
{
SetMinSize( wxSize( width, GetMinHeight() ) );
return *this;
}
pxStaticText& pxStaticText::SetMinHeight( int height )
{
SetMinSize( wxSize( GetMinWidth(), height) );
return *this;
}
pxStaticText& pxStaticText::SetHeight( int lines ) pxStaticText& pxStaticText::SetHeight( int lines )
{ {
if( !pxAssert(lines > 0) ) lines = 2; if( !pxAssert(lines > 0) ) lines = 2;
@ -165,8 +184,7 @@ wxSize pxStaticText::GetBestWrappedSize( const wxClientDC& dc ) const
idealWidth = (int)(wxGetDisplaySize().GetWidth() * 0.66) - (parentalAdjust*2); idealWidth = (int)(wxGetDisplaySize().GetWidth() * 0.66) - (parentalAdjust*2);
} }
wxString label(GetLabel()); return dc.GetMultiLineTextExtent(pxTextWrapper().Wrap( this, m_label, idealWidth - calcPaddingWidth(idealWidth) ).GetResult());
return dc.GetMultiLineTextExtent(pxTextWrapper().Wrap( this, label, idealWidth - calcPaddingWidth(idealWidth) ).GetResult());
} }
pxStaticText& pxStaticText::WrapAt( int width ) pxStaticText& pxStaticText::WrapAt( int width )
@ -179,10 +197,7 @@ pxStaticText& pxStaticText::WrapAt( int width )
m_wrappedWidth = width; m_wrappedWidth = width;
if( width > 1 ) if( width > 1 )
{ wrappedLabel = pxTextWrapper().Wrap( this, m_label, width ).GetResult();
wxString label( GetLabel() );
wrappedLabel = pxTextWrapper().Wrap( this, label, width ).GetResult();
}
if(m_wrappedLabel != wrappedLabel ) if(m_wrappedLabel != wrappedLabel )
{ {
@ -218,10 +233,7 @@ bool pxStaticText::_updateWrapping( bool textChanged )
m_wrappedWidth = newWidth; m_wrappedWidth = newWidth;
if( m_wrappedWidth > 1 ) if( m_wrappedWidth > 1 )
{ wrappedLabel = pxTextWrapper().Wrap( this, m_label, m_wrappedWidth ).GetResult();
wxString label( GetLabel() );
wrappedLabel = pxTextWrapper().Wrap( this, label, m_wrappedWidth ).GetResult();
}
if( m_wrappedLabel == wrappedLabel ) return false; if( m_wrappedLabel == wrappedLabel ) return false;
m_wrappedLabel = wrappedLabel; m_wrappedLabel = wrappedLabel;
@ -236,10 +248,10 @@ void pxStaticText::UpdateWrapping( bool textChanged )
void pxStaticText::SetLabel(const wxString& label) void pxStaticText::SetLabel(const wxString& label)
{ {
const bool labelChanged( label != GetLabel() ); const bool labelChanged( label != m_label );
if( labelChanged ) if( labelChanged )
{ {
_parent::SetLabel( label ); m_label = label;
Refresh(); Refresh();
} }
@ -280,17 +292,8 @@ void pxStaticText::paintEvent(wxPaintEvent& evt)
pxWindowTextWriter writer( dc ); pxWindowTextWriter writer( dc );
writer.Align( m_align ); writer.Align( m_align );
wxString label; const wxString& label( m_autowrap ? m_wrappedLabel : m_label );
if( m_autowrap ) _updateWrapping( false );
if( m_autowrap )
{
_updateWrapping( false );
label = m_wrappedLabel;
}
else
{
label = GetLabel();
}
int tWidth, tHeight; int tWidth, tHeight;
dc.GetMultiLineTextExtent( label, &tWidth, &tHeight ); dc.GetMultiLineTextExtent( label, &tWidth, &tHeight );

View File

@ -87,8 +87,9 @@ pxWindowTextWriter& pxWindowTextWriter::MoveY( int ydelta )
void pxWindowTextWriter::_DoWriteLn( const wxChar* msg ) void pxWindowTextWriter::_DoWriteLn( const wxChar* msg )
{ {
pxAssume( msg ); pxAssume( msg );
int tWidth, tHeight; int tWidth, tHeight;
m_dc.GetTextExtent( msg, &tWidth, &tHeight ); m_dc.GetMultiLineTextExtent( msg, &tWidth, &tHeight );
wxPoint dispos( m_curpos ); wxPoint dispos( m_curpos );

View File

@ -18,6 +18,7 @@
#include "wxGuiTools.h" #include "wxGuiTools.h"
#include "pxStaticText.h" #include "pxStaticText.h"
#include "Threading.h" #include "Threading.h"
#include "IniInterface.h"
#include <wx/cshelp.h> #include <wx/cshelp.h>
#include <wx/tooltip.h> #include <wx/tooltip.h>
@ -27,7 +28,7 @@ using namespace pxSizerFlags;
pxDialogCreationFlags pxDialogFlags() pxDialogCreationFlags pxDialogFlags()
{ {
return pxDialogCreationFlags().CloseBox().SystemMenu().Caption().Vertical(); return pxDialogCreationFlags().CloseBox().Caption().Vertical();
} }
@ -116,7 +117,7 @@ wxDialogWithHelpers::wxDialogWithHelpers()
m_hasContextHelp = false; m_hasContextHelp = false;
m_extraButtonSizer = NULL; m_extraButtonSizer = NULL;
Init(); Init( pxDialogFlags() );
} }
wxDialogWithHelpers::wxDialogWithHelpers( wxWindow* parent, const wxString& title, const pxDialogCreationFlags& cflags ) wxDialogWithHelpers::wxDialogWithHelpers( wxWindow* parent, const wxString& title, const pxDialogCreationFlags& cflags )
@ -129,16 +130,21 @@ wxDialogWithHelpers::wxDialogWithHelpers( wxWindow* parent, const wxString& titl
*this += StdPadding; *this += StdPadding;
} }
Init(); Init( cflags );
SetMinWidth( cflags.MinimumWidth ); SetMinSize( cflags.MinimumSize );
} }
wxDialogWithHelpers::~wxDialogWithHelpers() throw() wxDialogWithHelpers::~wxDialogWithHelpers() throw()
{ {
} }
void wxDialogWithHelpers::Init() void wxDialogWithHelpers::Init( const pxDialogCreationFlags& cflags )
{ {
// This fixes it so that the dialogs show up in the task bar in Vista:
// (otherwise they go stupid iconized mode if the user minimizes them)
if( cflags.hasMinimizeBox )
SetExtraStyle(GetExtraStyle() & ~wxTOPLEVEL_EX_DIALOG);
m_extraButtonSizer = NULL; m_extraButtonSizer = NULL;
if( m_hasContextHelp ) if( m_hasContextHelp )
@ -172,10 +178,8 @@ wxString wxDialogWithHelpers::GetDialogName() const
return wxEmptyString; return wxEmptyString;
} }
void wxDialogWithHelpers::SmartCenterFit() void wxDialogWithHelpers::DoAutoCenter()
{ {
Fit();
// Smart positioning logic! If our parent window is larger than our window by some // Smart positioning logic! If our parent window is larger than our window by some
// good amount, then we center on that. If not, center relative to the screen. This // good amount, then we center on that. If not, center relative to the screen. This
// avoids the popup automatically eclipsing the parent window (which happens in PCSX2 // avoids the popup automatically eclipsing the parent window (which happens in PCSX2
@ -196,12 +200,50 @@ void wxDialogWithHelpers::SmartCenterFit()
if( centerfail ) CenterOnScreen(); if( centerfail ) CenterOnScreen();
} }
void wxDialogWithHelpers::SmartCenterFit()
{
Fit();
const wxString dlgName( GetDialogName() );
if( dlgName.IsEmpty() )
{
DoAutoCenter(); return;
}
if( wxConfigBase* cfg = wxConfigBase::Get( false ) )
{
wxRect screenRect( GetScreenRect() );
IniLoader loader( cfg );
IniScopedGroup group( loader, L"DialogPositions" );
cfg->SetRecordDefaults( false );
if( GetWindowStyle() & wxRESIZE_BORDER )
{
wxSize size;
loader.Entry( dlgName + L"_Size", size, screenRect.GetSize() );
SetSize( size );
}
if( !cfg->Exists( dlgName + L"_Pos" ) )
DoAutoCenter();
else
{
wxPoint pos;
loader.Entry( dlgName + L"_Pos", pos, screenRect.GetPosition() );
SetPosition( pos );
}
cfg->SetRecordDefaults( true );
}
}
// Overrides wxDialog behavior to include automatic Fit() and CenterOnParent/Screen. The centering // Overrides wxDialog behavior to include automatic Fit() and CenterOnParent/Screen. The centering
// is based on a heuristic the centers against the parent window if the parent window is at least // is based on a heuristic the centers against the parent window if the parent window is at least
// 75% larger than the fitted dialog. // 75% larger than the fitted dialog.
int wxDialogWithHelpers::ShowModal() int wxDialogWithHelpers::ShowModal()
{ {
SmartCenterFit(); SmartCenterFit();
m_CreatedRect = GetScreenRect();
return wxDialog::ShowModal(); return wxDialog::ShowModal();
} }
@ -210,7 +252,11 @@ int wxDialogWithHelpers::ShowModal()
// 75% larger than the fitted dialog. // 75% larger than the fitted dialog.
bool wxDialogWithHelpers::Show( bool show ) bool wxDialogWithHelpers::Show( bool show )
{ {
if( show ) SmartCenterFit(); if( show )
{
SmartCenterFit();
m_CreatedRect = GetScreenRect();
}
return wxDialog::Show( show ); return wxDialog::Show( show );
} }
@ -231,6 +277,30 @@ pxStaticText& wxDialogWithHelpers::Heading( const wxString& label )
void wxDialogWithHelpers::OnCloseWindow( wxCloseEvent& evt ) void wxDialogWithHelpers::OnCloseWindow( wxCloseEvent& evt )
{ {
// Save the dialog position if the dialog is named...
// FIXME : This doesn't get called if the app is exited by alt-f4'ing the main app window.
// ... not sure how to fix that yet. I could register a list of open windows into wxAppWithHelpers
// that systematically get closed. Seems like work, maybe later. --air
if( wxConfigBase* cfg = wxConfigBase::Get( false ) )
{
const wxString dlgName( GetDialogName() );
const wxRect screenRect( GetScreenRect() );
if( !dlgName.IsEmpty() && ( m_CreatedRect != screenRect) )
{
wxPoint pos( screenRect.GetPosition() );
IniSaver saver( cfg );
IniScopedGroup group( saver, L"DialogPositions" );
if( GetWindowStyle() & wxRESIZE_BORDER )
{
wxSize size( screenRect.GetSize() );
saver.Entry( dlgName + L"_Size", size, screenRect.GetSize() );
}
saver.Entry( dlgName + L"_Pos", pos, screenRect.GetPosition() );
}
}
if( !IsModal() ) Destroy(); if( !IsModal() ) Destroy();
evt.Skip(); evt.Skip();
} }
@ -292,6 +362,14 @@ wxDialogWithHelpers& wxDialogWithHelpers::SetMinWidth( int newWidth )
return *this; return *this;
} }
wxDialogWithHelpers& wxDialogWithHelpers::SetMinHeight( int newHeight )
{
SetMinSize( wxSize( GetMinWidth(), newHeight ) );
if( wxSizer* sizer = GetSizer() )
sizer->SetMinSize( wxSize( sizer->GetMinSize().GetWidth(), newHeight ) );
return *this;
}
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
// wxPanelWithHelpers Implementations // wxPanelWithHelpers Implementations
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------

View File

@ -17,7 +17,7 @@
#include <wx/fileconf.h> #include <wx/fileconf.h>
#include "IniInterface.h" #include "Utilities/IniInterface.h"
#include "Config.h" #include "Config.h"
#include "GS.h" #include "GS.h"

View File

@ -16,11 +16,12 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "App.h" #include "App.h"
#include "MainFrame.h" #include "MainFrame.h"
#include "IniInterface.h"
#include "Plugins.h" #include "Plugins.h"
#include "MemoryCardFile.h" #include "MemoryCardFile.h"
#include "Utilities/IniInterface.h"
#include <wx/stdpaths.h> #include <wx/stdpaths.h>
#include "DebugTools/Debug.h" #include "DebugTools/Debug.h"
@ -317,13 +318,10 @@ wxString AppConfig::FullpathTo( PluginsEnum_t pluginidx ) const
// rather than any other type of more direct string comparison! // rather than any other type of more direct string comparison!
bool AppConfig::FullpathMatchTest( PluginsEnum_t pluginId, const wxString& cmpto ) const bool AppConfig::FullpathMatchTest( PluginsEnum_t pluginId, const wxString& cmpto ) const
{ {
wxFileName right( cmpto ); // Implementation note: wxFileName automatically normalizes things as needed in it's
wxFileName left( FullpathTo(pluginId) ); // equality comparison implementations, so we can do a simple comparison as follows:
left.MakeAbsolute(); return wxFileName(cmpto).SameAs( FullpathTo(pluginId) );
right.MakeAbsolute();
return left == right;
} }
wxDirName GetLogFolder() wxDirName GetLogFolder()
@ -352,7 +350,7 @@ AppConfig::AppConfig()
: MainGuiPosition( wxDefaultPosition ) : MainGuiPosition( wxDefaultPosition )
, SysSettingsTabName( L"Cpu" ) , SysSettingsTabName( L"Cpu" )
, McdSettingsTabName( L"Standard" ) , McdSettingsTabName( L"Standard" )
, AppSettingsTabName( L"GS Window" ) , AppSettingsTabName( L"Plugins" )
, DeskTheme( L"default" ) , DeskTheme( L"default" )
{ {
LanguageId = wxLANGUAGE_DEFAULT; LanguageId = wxLANGUAGE_DEFAULT;

View File

@ -15,7 +15,7 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "App.h" #include "App.h"
#include "IniInterface.h" #include "Utilities/IniInterface.h"
#include "Utilities/EventSource.inl" #include "Utilities/EventSource.inl"
template class EventSource< IEventListener_CoreThread >; template class EventSource< IEventListener_CoreThread >;

View File

@ -14,11 +14,11 @@
*/ */
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "IniInterface.h"
#include "MainFrame.h" #include "MainFrame.h"
#include "ConsoleLogger.h" #include "ConsoleLogger.h"
#include "MSWstuff.h" #include "MSWstuff.h"
#include "Utilities/IniInterface.h"
#include "DebugTools/Debug.h" #include "DebugTools/Debug.h"
#include "Dialogs/ModalPopups.h" #include "Dialogs/ModalPopups.h"
@ -61,6 +61,9 @@ void Pcsx2App::WipeUserModeSettings()
if( !usrlocaldir.Exists() ) return; if( !usrlocaldir.Exists() ) return;
wxString cwd( Path::Normalize( wxGetCwd() ) ); wxString cwd( Path::Normalize( wxGetCwd() ) );
#ifdef __WXMSW__
cwd.MakeLower();
#endif
u32 hashres = HashTools::Hash( (char*)cwd.c_str(), cwd.Length()*sizeof(wxChar) ); u32 hashres = HashTools::Hash( (char*)cwd.c_str(), cwd.Length()*sizeof(wxChar) );
wxFileName usermodefile( FilenameDefs::GetUsermodeConfig() ); wxFileName usermodefile( FilenameDefs::GetUsermodeConfig() );
@ -91,6 +94,10 @@ void Pcsx2App::ReadUserModeSettings()
} }
wxString cwd( Path::Normalize( wxGetCwd() ) ); wxString cwd( Path::Normalize( wxGetCwd() ) );
#ifdef __WXMSW__
cwd.MakeLower();
#endif
u32 hashres = HashTools::Hash( (char*)cwd.c_str(), cwd.Length()*sizeof(wxChar) ); u32 hashres = HashTools::Hash( (char*)cwd.c_str(), cwd.Length()*sizeof(wxChar) );
wxFileName usermodefile( FilenameDefs::GetUsermodeConfig() ); wxFileName usermodefile( FilenameDefs::GetUsermodeConfig() );

View File

@ -14,7 +14,6 @@
*/ */
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "IniInterface.h"
#include "MainFrame.h" #include "MainFrame.h"
#include "GSFrame.h" #include "GSFrame.h"
@ -26,6 +25,7 @@
#include "Dialogs/ConfigurationDialog.h" #include "Dialogs/ConfigurationDialog.h"
#include "Dialogs/LogOptionsDialog.h" #include "Dialogs/LogOptionsDialog.h"
#include "Utilities/IniInterface.h"
#include "Utilities/HashMap.h" #include "Utilities/HashMap.h"
#ifdef __WXMSW__ #ifdef __WXMSW__

View File

@ -32,16 +32,13 @@ using namespace pxSizerFlags;
// -------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------
Dialogs::AboutBoxDialog::AboutBoxDialog( wxWindow* parent ) Dialogs::AboutBoxDialog::AboutBoxDialog( wxWindow* parent )
: wxDialogWithHelpers( parent, _("About PCSX2") ) : wxDialogWithHelpers( parent, _("About PCSX2"), pxDialogFlags().Resize().MinWidth( 460 ) )
, m_bitmap_dualshock( this, wxID_ANY, wxBitmap( EmbeddedImage<res_Dualshock>().Get() ), , m_bitmap_dualshock( this, wxID_ANY, wxBitmap( EmbeddedImage<res_Dualshock>().Get() ),
wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN
) )
{ {
static const wxString LabelAuthors = fromUTF8( static const wxString LabelAuthors = fromUTF8(
"Developers" "Arcum42, Refraction, drk||raziel, cottonvibes, gigaherz, "
"\n\n"
"v0.9.6+: Arcum42, Refraction, "
"drk||raziel, cottonvibes, gigaherz, "
"rama, Jake.Stine, saqib, Tmkk, pseudonym" "rama, Jake.Stine, saqib, Tmkk, pseudonym"
"\n\n" "\n\n"
"Previous versions: Alexey silinov, Aumatt, " "Previous versions: Alexey silinov, Aumatt, "
@ -56,38 +53,36 @@ Dialogs::AboutBoxDialog::AboutBoxDialog( wxWindow* parent )
); );
static const wxString LabelGreets = fromUTF8( static const wxString LabelGreets = fromUTF8(
"Contributors" "Hiryu and Sjeep (libcdvd / iso filesystem), nneeve (fpu and vu), gregory (linux distros)"
"\n\n"
"Hiryu and Sjeep (libcdvd / iso filesystem), nneeve (fpu and vu)"
"\n\n" "\n\n"
"Plugin Specialists: ChickenLiver (Lilypad), Efp (efp), " "Plugin Specialists: ChickenLiver (Lilypad), Efp (efp), "
"Gabest (Gsdx, Cdvdolio, Xpad), Zeydlitz (ZZogl)" "Gabest (Gsdx, Cdvdolio, Xpad), Zeydlitz (ZZogl)"
"\n\n" "\n\n"
"Special thanks to: black_wd, Belmont, BGome, _Demo_, Dreamtime, " "Special thanks to: black_wd, Belmont, BGome, _Demo_, Dreamtime, "
"F|RES, MrBrown, razorblade, Seta-san, Skarmeth, feal87, Athos, gregory" "F|RES, MrBrown, razorblade, Seta-san, Skarmeth, feal87, Athos"
); );
// This sizer holds text of the authors and a logo! // This sizer holds text of the authors and a logo!
wxBoxSizer& AuthLogoSizer = *new wxBoxSizer( wxHORIZONTAL ); wxFlexGridSizer& AuthLogoSizer = *new wxFlexGridSizer( 2, 0, StdPadding );
AuthLogoSizer.AddGrowableCol(0, 4);
AuthLogoSizer.AddGrowableCol(1, 3);
// this sizer holds text of the contributors/testers, and a ps2 image! // this sizer holds text of the contributors/testers, and a ps2 image!
wxBoxSizer& ContribSizer = *new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer& ContribSizer = *new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer& aboutUs = *new wxStaticBoxSizer( wxVERTICAL, this ); wxStaticBoxSizer& aboutUs = *new wxStaticBoxSizer( wxVERTICAL, this );
wxStaticBoxSizer& contribs = *new wxStaticBoxSizer( wxVERTICAL, this ); wxStaticBoxSizer& contribs = *new wxStaticBoxSizer( wxVERTICAL, this );
pxStaticText& label_auth = Text( LabelAuthors ); pxStaticText& label_auth = Text( LabelAuthors ).SetMinWidth(240);
pxStaticText& label_greets = Text( LabelGreets ); pxStaticText& label_greets = Text( LabelGreets ).SetMinWidth(200);
//label_auth->Wrap( 340 ); aboutUs += Heading(L"Developers").Bold() | StdExpand();
//label_greets->Wrap( 200 ); aboutUs += label_auth | StdExpand();
contribs += Heading(L"Contributors").Bold() | StdExpand();
contribs += label_greets | StdExpand();
aboutUs += label_auth | StdExpand(); AuthLogoSizer += aboutUs | StdExpand();
contribs += label_greets | StdExpand(); AuthLogoSizer += contribs | StdExpand();
AuthLogoSizer += aboutUs;
AuthLogoSizer += 7;
AuthLogoSizer += contribs;
ContribSizer += pxStretchSpacer( 1 ); ContribSizer += pxStretchSpacer( 1 );
ContribSizer += m_bitmap_dualshock | StdSpace(); ContribSizer += m_bitmap_dualshock | StdSpace();
@ -95,17 +90,23 @@ Dialogs::AboutBoxDialog::AboutBoxDialog( wxWindow* parent )
// Main (top-level) layout // Main (top-level) layout
*this += Text(_("PCSX2 - Playstation 2 Emulator")) | StdCenter(); *this += StdPadding;
*this += AuthLogoSizer | StdSpace(); *this += Text(_("PCSX2")).Bold() | pxExpand;
*this += Text(_("A Playstation 2 Emulator")) | pxExpand;
*this += AuthLogoSizer | StdExpand();
*this += new wxHyperlinkCtrl( this, wxID_ANY, *this += new wxHyperlinkCtrl( this, wxID_ANY,
_("Pcsx2 Official Website and Forums"), L"http://www.pcsx2.net" _("PCSX2 Official Website and Forums"), L"http://www.pcsx2.net"
) | wxSizerFlags(1).Center().Border( wxALL, 3 ); ) | pxProportion(1).Center().Border( wxALL, 3 );
*this += new wxHyperlinkCtrl( this, wxID_ANY, *this += new wxHyperlinkCtrl( this, wxID_ANY,
_("Pcsx2 Official Svn Repository at Googlecode"), L"http://code.google.com/p/pcsx2" _("PCSX2 Official Svn Repository at Googlecode"), L"http://code.google.com/p/pcsx2"
) | wxSizerFlags(1).Center().Border( wxALL, 3 ); ) | pxProportion(1).Center().Border( wxALL, 3 );
*this += ContribSizer | StdExpand(); *this += ContribSizer | StdExpand();
*this += new wxButton( this, wxID_OK, L"I've seen enough") | StdCenter(); *this += new wxButton( this, wxID_OK, L"I've seen enough") | StdCenter();
int bestHeight = GetBestSize().GetHeight();
if( bestHeight < 400 ) bestHeight = 400;
SetMinHeight( bestHeight );
} }

View File

@ -64,10 +64,6 @@ wxString BaseApplicableDialog::GetDialogName() const
void BaseApplicableDialog::Init() void BaseApplicableDialog::Init()
{ {
// This fixes it so that the dialogs show up in the task bar in Vista:
// (otherwise they go stupid iconized mode if the user minimizes them)
SetExtraStyle(GetExtraStyle() & ~wxTOPLEVEL_EX_DIALOG);
Connect( pxEvt_ApplySettings, wxCommandEventHandler (BaseApplicableDialog::OnSettingsApplied) ); Connect( pxEvt_ApplySettings, wxCommandEventHandler (BaseApplicableDialog::OnSettingsApplied) );
wxCommandEvent applyEvent( pxEvt_ApplySettings ); wxCommandEvent applyEvent( pxEvt_ApplySettings );

View File

@ -132,7 +132,7 @@ void MainEmuFrame::OnMoveAround( wxMoveEvent& evt )
proglog->SetPosition( g_Conf->ProgLogBox.DisplayPosition ); proglog->SetPosition( g_Conf->ProgLogBox.DisplayPosition );
} }
//evt.Skip(); evt.Skip();
} }
void MainEmuFrame::OnLogBoxHidden() void MainEmuFrame::OnLogBoxHidden()

View File

@ -20,12 +20,13 @@
#include "GS.h" #include "GS.h"
#include "MainFrame.h" #include "MainFrame.h"
#include "IsoDropTarget.h"
#include "Dialogs/ModalPopups.h" #include "Dialogs/ModalPopups.h"
#include "Dialogs/ConfigurationDialog.h" #include "Dialogs/ConfigurationDialog.h"
#include "Dialogs/LogOptionsDialog.h" #include "Dialogs/LogOptionsDialog.h"
#include "IniInterface.h" #include "Utilities/IniInterface.h"
#include "IsoDropTarget.h"
using namespace Dialogs; using namespace Dialogs;
@ -51,7 +52,7 @@ void MainEmuFrame::Menu_McdSettings_Click(wxCommandEvent &event)
void MainEmuFrame::Menu_WindowSettings_Click(wxCommandEvent &event) void MainEmuFrame::Menu_WindowSettings_Click(wxCommandEvent &event)
{ {
wxCommandEvent evt( pxEvt_SetSettingsPage ); wxCommandEvent evt( pxEvt_SetSettingsPage );
evt.SetString( L"Window" ); evt.SetString( L"GS Window" );
AppOpenDialog<SysConfigDialog>( this )->GetEventHandler()->ProcessEvent( evt ); AppOpenDialog<SysConfigDialog>( this )->GetEventHandler()->ProcessEvent( evt );
} }
@ -64,7 +65,6 @@ void MainEmuFrame::Menu_GSSettings_Click(wxCommandEvent &event)
void MainEmuFrame::Menu_SelectPluginsBios_Click(wxCommandEvent &event) void MainEmuFrame::Menu_SelectPluginsBios_Click(wxCommandEvent &event)
{ {
//AppOpenDialog<BiosSelectorDialog>( this );
AppOpenDialog<ComponentsConfigDialog>( this ); AppOpenDialog<ComponentsConfigDialog>( this );
} }

View File

@ -165,8 +165,7 @@ void Panels::BiosSelectorPanel::DoRefresh()
m_ComboBox->Clear(); m_ComboBox->Clear();
wxFileName right( g_Conf->FullpathToBios() ); const wxFileName right( g_Conf->FullpathToBios() );
right.MakeAbsolute();
for( size_t i=0; i<m_BiosList->GetCount(); ++i ) for( size_t i=0; i<m_BiosList->GetCount(); ++i )
{ {
@ -174,10 +173,7 @@ void Panels::BiosSelectorPanel::DoRefresh()
if( !IsBIOS((*m_BiosList)[i], description) ) continue; if( !IsBIOS((*m_BiosList)[i], description) ) continue;
int sel = m_ComboBox->Append( description, (void*)i ); int sel = m_ComboBox->Append( description, (void*)i );
wxFileName left( (*m_BiosList)[i] ); if( wxFileName((*m_BiosList)[i] ) == right )
left.MakeAbsolute();
if( left == right )
m_ComboBox->SetSelection( sel ); m_ComboBox->SetSelection( sel );
} }
} }

View File

@ -16,7 +16,7 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "MainFrame.h" #include "MainFrame.h"
#include "IsoDropTarget.h" #include "IsoDropTarget.h"
#include "IniInterface.h" #include "Utilities/IniInterface.h"
extern wxString GetMsg_IsoImageChanged(); extern wxString GetMsg_IsoImageChanged();

View File

@ -1964,10 +1964,6 @@
RelativePath="..\..\gui\i18n.cpp" RelativePath="..\..\gui\i18n.cpp"
> >
</File> </File>
<File
RelativePath="..\..\gui\IniInterface.cpp"
>
</File>
<File <File
RelativePath="..\..\gui\IsoDropTarget.cpp" RelativePath="..\..\gui\IsoDropTarget.cpp"
> >
@ -2689,10 +2685,6 @@
RelativePath="..\..\HostGui.h" RelativePath="..\..\HostGui.h"
> >
</File> </File>
<File
RelativePath="..\..\gui\IniInterface.h"
>
</File>
<File <File
RelativePath="..\..\gui\IsoDropTarget.h" RelativePath="..\..\gui\IsoDropTarget.h"
> >