mirror of https://github.com/PCSX2/pcsx2.git
wxNewGui: Cleanups of the Logging dialog layout (yet unfinished).. added some helper functions for common dialog layout stuff. Still learning my way around wx. :/
git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@837 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
6ce8ac189c
commit
376b694baa
|
@ -76,7 +76,7 @@ namespace R3000A
|
|||
struct LogSources
|
||||
{
|
||||
bool
|
||||
R5900:1, // instructions and exception vectors for the R5900 (EE)
|
||||
R5900:1, // instructions and exception vectors for the R5900 (EE)
|
||||
R3000A:1, // instructions and exception vectors for the R3000a (IOP)
|
||||
|
||||
Memory:1, // memory accesses (loads and stores)
|
||||
|
@ -91,7 +91,7 @@ struct LogSources
|
|||
GIF:1,
|
||||
SIF:1,
|
||||
IPU:1,
|
||||
VUM:1, // VU memory access logs
|
||||
VUMacro:1, // VU macro mode logs (pipelines)
|
||||
RPC:1,
|
||||
Counters:1, // EE's counters!
|
||||
|
||||
|
@ -156,7 +156,7 @@ extern bool SrcLog_GPU( const char* fmt, ... );
|
|||
#define GIF_LOG (varLog.GIF) && SrcLog_GIF
|
||||
#define SIF_LOG (varLog.SIF) && SrcLog_SIF
|
||||
#define IPU_LOG (varLog.IPU) && SrcLog_IPU
|
||||
#define VUM_LOG (varLog.VUM) && SrcLog_VUM
|
||||
#define VUM_LOG (varLog.VUMacro) && SrcLog_VUM
|
||||
#define RPC_LOG (varLog.RPC) && SrcLog_RPC
|
||||
#define EECNT_LOG (varLog.Counters) && SrcLog_EECNT
|
||||
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
#include "PrecompiledHeader.h"
|
||||
#include "Misc.h"
|
||||
#include "frmGameFixes.h"
|
||||
#include "wxHelpers.h"
|
||||
|
||||
using namespace wxHelpers;
|
||||
|
||||
frmGameFixes::frmGameFixes(wxWindow* parent, int id, const wxPoint& pos, const wxSize& size, long style):
|
||||
wxDialog( parent, id, _T("Game Special Fixes"), pos, size )
|
||||
|
@ -39,15 +42,14 @@ wxDialog( parent, id, _T("Game Special Fixes"), pos, size )
|
|||
|
||||
wxBoxSizer& mainSizer = *new wxBoxSizer( wxVERTICAL );
|
||||
wxStaticBoxSizer& groupSizer = *new wxStaticBoxSizer( groupbox, wxVERTICAL );
|
||||
wxSizerFlags stdSpacing( wxSizerFlags().Border( wxALL, 6 ) );
|
||||
|
||||
groupSizer.Add( chk_FPUCompareHack);
|
||||
groupSizer.Add( chk_TriAce);
|
||||
groupSizer.Add( chk_GodWar);
|
||||
groupSizer.Add( chk_FPUCompareHack, CheckboxFlags );
|
||||
groupSizer.Add( chk_TriAce, CheckboxFlags );
|
||||
groupSizer.Add( chk_GodWar, CheckboxFlags );
|
||||
|
||||
mainSizer.Add( label_Title, wxSizerFlags().Align(wxALIGN_CENTER).DoubleBorder() );
|
||||
mainSizer.Add( &groupSizer, wxSizerFlags().Align(wxALIGN_CENTER).DoubleHorzBorder() );
|
||||
mainSizer.Add( CreateStdDialogButtonSizer( wxOK | wxCANCEL ), wxSizerFlags().Align(wxALIGN_RIGHT).Border() );
|
||||
mainSizer.Add( label_Title, stdCenteredFlags );
|
||||
mainSizer.Add( &groupSizer, stdSpacingFlags );
|
||||
mainSizer.Add( CreateStdDialogButtonSizer( wxOK | wxCANCEL ), stdButtonSizerFlags );
|
||||
|
||||
SetSizerAndFit( &mainSizer );
|
||||
}
|
||||
|
|
|
@ -20,67 +20,73 @@
|
|||
#include "Misc.h"
|
||||
#include "frmLogging.h"
|
||||
|
||||
frmLogging::frmLogging(wxWindow* parent, int id, const wxPoint& pos, const wxSize& size, long style):
|
||||
wxDialog( parent, id, _T("Logging"), pos, size )
|
||||
#include <wx/statline.h>
|
||||
|
||||
using namespace wxHelpers;
|
||||
|
||||
frmLogging::frmLogging(wxWindow* parent, int id, const wxPoint& pos, const wxSize& size):
|
||||
wxDialogWithHelpers( parent, id, _T("Logging"), pos, size )
|
||||
{
|
||||
int i;
|
||||
wxStaticBox* mainbox = new wxStaticBox( this, -1, wxEmptyString);
|
||||
wxBoxSizer *mainsizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
wxStaticBox* eebox = new wxStaticBox( this, -1, _T("EE Logs"));
|
||||
wxStaticBoxSizer *eeSizer = new wxStaticBoxSizer( eebox, wxVERTICAL );
|
||||
eeSizer->Add(new wxCheckBox(this, EE_CPU_LOG, _T("Cpu Log")), 0, wxEXPAND);
|
||||
eeSizer->Add(new wxCheckBox(this, EE_MEM_LOG, _T("Mem Log")), 0, wxEXPAND);
|
||||
eeSizer->Add(new wxCheckBox(this, EE_HW_LOG, _T("Hw Log")), 0, wxEXPAND);
|
||||
eeSizer->Add(new wxCheckBox(this, EE_DMA_LOG, _T("Dma Log")), 0, wxEXPAND);
|
||||
eeSizer->Add(new wxCheckBox(this, EE_BIOS_LOG, _T("Bios Log")), 0, wxEXPAND);
|
||||
eeSizer->Add(new wxCheckBox(this, EE_ELF_LOG, _T("Elf Log")), 0, wxEXPAND);
|
||||
eeSizer->Add(new wxCheckBox(this, EE_FPU_LOG, _T("Fpu Log")), 0, wxEXPAND);
|
||||
eeSizer->Add(new wxCheckBox(this, EE_MMI_LOG, _T("MMI Log")), 0, wxEXPAND);
|
||||
eeSizer->Add(new wxCheckBox(this, EE_VU0_LOG, _T("VU0 Log")), 0, wxEXPAND);
|
||||
eeSizer->Add(new wxCheckBox(this, EE_COP0_LOG, _T("Cop0 Log")), 0, wxEXPAND);
|
||||
eeSizer->Add(new wxCheckBox(this, EE_VIF_LOG, _T("Vif Log")), 0, wxEXPAND);
|
||||
eeSizer->Add(new wxCheckBox(this, EE_SPR_LOG, _T("SPR Log")), 0, wxEXPAND);
|
||||
eeSizer->Add(new wxCheckBox(this, EE_GIF_LOG, _T("GIF Log")), 0, wxEXPAND);
|
||||
eeSizer->Add(new wxCheckBox(this, EE_SIF_LOG, _T("Sif Log")), 0, wxEXPAND);
|
||||
eeSizer->Add(new wxCheckBox(this, EE_IPU_LOG, _T("IPU Log")), 0, wxEXPAND);
|
||||
eeSizer->Add(new wxCheckBox(this, EE_VU_MACRO_LOG, _T("VU Macro Log")), 0, wxEXPAND);
|
||||
eeSizer->Add(new wxCheckBox(this, EE_RPC_LOG, _T("RPC Log")), 0, wxEXPAND);
|
||||
wxStaticBoxSizer& eeDisasm = *new wxStaticBoxSizer( wxVERTICAL, this, _T("EE Disasm") );
|
||||
wxStaticBoxSizer& eeHw = *new wxStaticBoxSizer( wxVERTICAL, this, _T("EE Hardware") );
|
||||
|
||||
mainsizer->Add(eeSizer, 0, wxEXPAND);
|
||||
AddCheckBox( eeDisasm, _T("Core"), EE_CPU_LOG );
|
||||
AddCheckBox( eeDisasm, _T("Memory"), EE_MEM_LOG );
|
||||
AddCheckBox( eeDisasm, _T("Bios"), EE_BIOS_LOG );
|
||||
AddCheckBox( eeDisasm, _T("Elf"), EE_ELF_LOG );
|
||||
AddCheckBox( eeDisasm, _T("Fpu"), EE_FPU_LOG );
|
||||
AddCheckBox( eeDisasm, _T("VU0"), EE_VU0_LOG );
|
||||
AddCheckBox( eeDisasm, _T("Cop0"), EE_COP0_LOG );
|
||||
AddCheckBox( eeDisasm, _T("VU Macro"), EE_VU_MACRO_LOG );
|
||||
|
||||
AddCheckBox( eeHw, _T("Registers"), EE_HW_LOG );
|
||||
AddCheckBox( eeHw, _T("Dma"), EE_DMA_LOG );
|
||||
AddCheckBox( eeHw, _T("Vif"), EE_VIF_LOG );
|
||||
AddCheckBox( eeHw, _T("SPR"), EE_SPR_LOG );
|
||||
AddCheckBox( eeHw, _T("GIF"), EE_GIF_LOG );
|
||||
AddCheckBox( eeHw, _T("Sif"), EE_SIF_LOG );
|
||||
AddCheckBox( eeHw, _T("IPU"), EE_IPU_LOG );
|
||||
AddCheckBox( eeHw, _T("RPC"), EE_RPC_LOG );
|
||||
|
||||
wxStaticBox* iopbox = new wxStaticBox( this, -1, _T("IOP Logs"));
|
||||
wxStaticBoxSizer *iopSizer = new wxStaticBoxSizer( iopbox, wxVERTICAL );
|
||||
iopSizer->Add(new wxCheckBox(this, IOP_IOP_LOG, _T("IOP Log")), 0, wxEXPAND);
|
||||
iopSizer->Add(new wxCheckBox(this, IOP_MEM_LOG, _T("Mem Log")), 0, wxEXPAND);
|
||||
iopSizer->Add(new wxCheckBox(this, IOP_HW_LOG, _T("Hw Log")), 0, wxEXPAND);
|
||||
iopSizer->Add(new wxCheckBox(this, IOP_BIOS_LOG, _T("Bios Log")), 0, wxEXPAND);
|
||||
iopSizer->Add(new wxCheckBox(this, IOP_DMA_LOG, _T("Dma Log")), 0, wxEXPAND);
|
||||
iopSizer->Add(new wxCheckBox(this, IOP_PAD_LOG, _T("Pad Log")), 0, wxEXPAND);
|
||||
iopSizer->Add(new wxCheckBox(this, IOP_GTE_LOG, _T("Gte Log")), 0, wxEXPAND);
|
||||
iopSizer->Add(new wxCheckBox(this, IOP_CDR_LOG, _T("Cdr Log")), 0, wxEXPAND);
|
||||
iopSizer->Add(new wxCheckBox(this, IOP_GPU_LOG, _T("GPU Log")), 0, wxEXPAND);
|
||||
|
||||
mainsizer->Add(iopSizer, 0, wxEXPAND);
|
||||
wxStaticBoxSizer& iopSizer = *new wxStaticBoxSizer( iopbox, wxVERTICAL );
|
||||
AddCheckBox( iopSizer, _T("IOP Log"), IOP_IOP_LOG );
|
||||
AddCheckBox( iopSizer, _T("Mem Log"), IOP_MEM_LOG );
|
||||
AddCheckBox( iopSizer, _T("Hw Log"), IOP_HW_LOG);
|
||||
AddCheckBox( iopSizer, _T("Bios Log"), IOP_BIOS_LOG );
|
||||
AddCheckBox( iopSizer, _T("Dma Log"), IOP_DMA_LOG );
|
||||
AddCheckBox( iopSizer, _T("Pad Log"), IOP_PAD_LOG );
|
||||
AddCheckBox( iopSizer, _T("Gte Log"), IOP_GTE_LOG );
|
||||
AddCheckBox( iopSizer, _T("Cdr Log"), IOP_CDR_LOG );
|
||||
AddCheckBox( iopSizer, _T("GPU Log"), IOP_GPU_LOG );
|
||||
|
||||
wxStaticBox* miscbox = new wxStaticBox( this, -1, _T("Misc"));
|
||||
wxStaticBoxSizer *miscSizer = new wxStaticBoxSizer( miscbox, wxVERTICAL );
|
||||
miscSizer->Add(new wxCheckBox(this, STDOUT_LOG, _T("Log to STDOUT")), 0, wxEXPAND);
|
||||
miscSizer->Add(new wxCheckBox(this, SYMS_LOG, _T("SYMs Log")), 0, wxEXPAND);
|
||||
wxStaticBoxSizer& miscSizer = *new wxStaticBoxSizer( miscbox, wxVERTICAL );
|
||||
AddCheckBox( miscSizer, _T("Log to STDOUT"), STDOUT_LOG );
|
||||
AddCheckBox( miscSizer, _T("SYMs Log"), SYMS_LOG );
|
||||
|
||||
mainsizer->Add(miscSizer, 0, wxEXPAND);
|
||||
mainsizer->Add( &eeDisasm, stdSpacingFlags );
|
||||
mainsizer->Add( &eeHw, stdSpacingFlags );
|
||||
mainsizer->Add( &iopSizer, stdSpacingFlags );
|
||||
mainsizer->Add( &miscSizer, stdSpacingFlags );
|
||||
|
||||
SetSizerAndFit( mainsizer, true );
|
||||
|
||||
|
||||
// Connect all the checkboxes to one function, and pass the checkbox id as user data.
|
||||
// (user data pointer isn't actually a pointer, but instead just the checkbox id)
|
||||
for (i = EE_CPU_LOG; i >= SYMS_LOG; i++)
|
||||
Connect(i, wxEVT_COMMAND_CHECKBOX_CLICKED, i, wxCommandEventHandler(frmLogging::LogChecked));
|
||||
Connect( i, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(frmLogging::LogChecked), (wxObject*)i );
|
||||
}
|
||||
|
||||
|
||||
void frmLogging::LogChecked(wxCommandEvent &event)
|
||||
{
|
||||
// The checkbox checked should be in event.m_callbackUserData.
|
||||
int checkId = (int)event.m_callbackUserData;
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
|
|
@ -19,13 +19,14 @@
|
|||
#include <wx/wx.h>
|
||||
#include <wx/image.h>
|
||||
|
||||
#include "wxHelpers.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
class frmLogging: public wxDialog
|
||||
class frmLogging: public wxDialogWithHelpers
|
||||
{
|
||||
public:
|
||||
|
||||
frmLogging(wxWindow* parent, int id, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE);
|
||||
frmLogging( wxWindow* parent, int id, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize );
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
#include "PrecompiledHeader.h"
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include "wxHelpers.h"
|
||||
|
||||
namespace wxHelpers
|
||||
{
|
||||
wxSizerFlags stdCenteredFlags( wxSizerFlags().Align(wxALIGN_CENTER).DoubleBorder() );
|
||||
wxSizerFlags stdSpacingFlags( wxSizerFlags().Border( wxALL, 6 ) );
|
||||
wxSizerFlags stdButtonSizerFlags( wxSizerFlags().Align(wxALIGN_RIGHT).Border() );
|
||||
wxSizerFlags CheckboxFlags( wxSizerFlags().Border( wxALL, 6 ).Expand() );
|
||||
|
||||
void AddCheckBox( wxBoxSizer& sizer, wxWindow* parent, const wxString& label, wxWindowID id )
|
||||
{
|
||||
sizer.Add( new wxCheckBox( parent, id, label ), CheckboxFlags );
|
||||
}
|
||||
}
|
||||
|
||||
void wxDialogWithHelpers::AddCheckBox( wxBoxSizer& sizer, const wxString& label, wxWindowID id )
|
||||
{
|
||||
wxHelpers::AddCheckBox( sizer, this, label, id );
|
||||
}
|
||||
|
||||
wxDialogWithHelpers::wxDialogWithHelpers( wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size ) :
|
||||
wxDialog( parent, id, title, pos, size )
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
#pragma once
|
||||
|
||||
namespace wxHelpers
|
||||
{
|
||||
// Creates a new checkbox and adds it to the specified sizer/parent combo.
|
||||
// Uses the default psacer setting for adding checkboxes.
|
||||
extern void AddCheckBox( wxBoxSizer& sizer, wxWindow* parent, const wxString& label, wxWindowID id=wxID_ANY );
|
||||
|
||||
|
||||
extern wxSizerFlags stdCenteredFlags;
|
||||
extern wxSizerFlags stdSpacingFlags;
|
||||
|
||||
// This force-aligns the std button sizer to the right, where (at least) us win32 platform
|
||||
// users always expect it to be. Most likely Mac platforms expect it on the left side
|
||||
// just because it's *not* where win32 sticks it. Too bad!
|
||||
extern wxSizerFlags stdButtonSizerFlags;
|
||||
|
||||
extern wxSizerFlags CheckboxFlags;
|
||||
}
|
||||
|
||||
class wxDialogWithHelpers : public wxDialog
|
||||
{
|
||||
public:
|
||||
wxDialogWithHelpers(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize );
|
||||
|
||||
void AddCheckBox( wxBoxSizer& sizer, const wxString& label, wxWindowID id=wxID_ANY );
|
||||
};
|
|
@ -2932,6 +2932,14 @@
|
|||
RelativePath="..\..\NewGUI\main.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\NewGUI\wxHelpers.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\NewGUI\wxHelpers.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="..\..\Common.h"
|
||||
|
|
Loading…
Reference in New Issue