more changes to the ogl config gui (replaced everything with sizers)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@137 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2008-08-05 21:05:12 +00:00
parent 9a377ac874
commit 491a9205b6
2 changed files with 83 additions and 34 deletions

View File

@ -51,71 +51,119 @@ ConfigDialog::~ConfigDialog()
void ConfigDialog::CreateGUIControls() void ConfigDialog::CreateGUIControls()
{ {
// buttons
m_OK = new wxButton(this, ID_OK, wxT("OK"), wxPoint(404,208), wxSize(73,25), 0, wxDefaultValidator, wxT("OK"));
m_Apply = new wxButton(this, ID_APPLY, wxT("Apply"), wxPoint(324,208), wxSize(73,25), 0, wxDefaultValidator, wxT("Apply"));
m_Close = new wxButton(this, ID_CLOSE, wxT("Close"), wxPoint(244,208), wxSize(73,25), 0, wxDefaultValidator, wxT("Close"));
//notebook //notebook
m_Notebook = new wxNotebook(this, ID_PAGEENHANCEMENTS, wxPoint(0,0),wxSize(484,198)); m_Notebook = new wxNotebook(this, ID_PAGEENHANCEMENTS, wxDefaultPosition, wxDefaultSize);
m_PageVideo = new wxPanel(m_Notebook, ID_PAGEVIDEO, wxPoint(4,24), wxSize(476,170)); m_PageVideo = new wxPanel(m_Notebook, ID_PAGEVIDEO, wxDefaultPosition, wxDefaultSize);
m_Notebook->AddPage(m_PageVideo, wxT("Video")); m_Notebook->AddPage(m_PageVideo, wxT("Video"));
m_PageEnhancements = new wxPanel(m_Notebook, ID_WXNOTEBOOKPAGE3, wxPoint(4,24), wxSize(476,170)); m_PageEnhancements = new wxPanel(m_Notebook, ID_WXNOTEBOOKPAGE3, wxDefaultPosition, wxDefaultSize);
m_Notebook->AddPage(m_PageEnhancements, wxT("Enhancements")); m_Notebook->AddPage(m_PageEnhancements, wxT("Enhancements"));
m_PageAdvanced = new wxPanel(m_Notebook, ID_PAGEADVANCED, wxPoint(4,24), wxSize(476,170)); m_PageAdvanced = new wxPanel(m_Notebook, ID_PAGEADVANCED, wxDefaultPosition, wxDefaultSize);
m_Notebook->AddPage(m_PageAdvanced, wxT("Advanced")); m_Notebook->AddPage(m_PageAdvanced, wxT("Advanced"));
//buttons
m_Close = new wxButton(this, ID_CLOSE, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_Apply = new wxButton(this, ID_APPLY, wxT("Apply"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_OK = new wxButton(this, ID_OK, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
//put notebook and buttons in sizers
wxBoxSizer* sButtons;
sButtons = new wxBoxSizer(wxHORIZONTAL);
sButtons->Add(0, 0, 1, wxEXPAND, 5);
sButtons->Add(m_Close, 0, wxALL, 5);
sButtons->Add(m_Apply, 0, wxALL, 5);
sButtons->Add(m_OK, 0, wxALL, 5);
wxBoxSizer* sMain;
sMain = new wxBoxSizer(wxVERTICAL);
sMain->Add(m_Notebook, 1, wxEXPAND|wxALL, 5);
sMain->Add(sButtons, 0, wxEXPAND, 5);
this->SetSizer(sMain);
this->Layout();
//page1 //page1
m_Fullscreen = new wxCheckBox(m_PageVideo, ID_FULLSCREEN, wxT("Fullscreen"), wxPoint(12,16), wxSize(137,25), 0, wxDefaultValidator, wxT("Fullscreen")); m_Fullscreen = new wxCheckBox(m_PageVideo, ID_FULLSCREEN, wxT("Fullscreen"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_Fullscreen->SetValue(g_Config.bFullscreen); m_Fullscreen->SetValue(g_Config.bFullscreen);
m_RenderToMainWindow = new wxCheckBox(m_PageVideo, ID_RENDERTOMAINWINDOW, wxT("Render to main window"), wxPoint(12,40), wxSize(137,25), 0, wxDefaultValidator, wxT("RenderToMainWindow")); m_RenderToMainWindow = new wxCheckBox(m_PageVideo, ID_RENDERTOMAINWINDOW, wxT("Render to main window"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_RenderToMainWindow->SetValue(g_Config.renderToMainframe); m_RenderToMainWindow->SetValue(g_Config.renderToMainframe);
wxStaticText *WxStaticText2 = new wxStaticText(m_PageVideo, ID_WXSTATICTEXT2, wxT("Fullscreen video mode:"), wxPoint(12,72), wxDefaultSize, 0, wxT("WxStaticText2")); wxStaticText *FSText = new wxStaticText(m_PageVideo, ID_FSTEXT, wxT("Fullscreen video mode:"), wxDefaultPosition, wxDefaultSize, 0);
wxArrayString arrayStringFor_FullscreenCB; wxArrayString arrayStringFor_FullscreenCB;
m_FullscreenCB = new wxComboBox(m_PageVideo, ID_FULLSCREENCB, wxT(""), wxPoint(132,72), wxSize(121,21), arrayStringFor_FullscreenCB, 0, wxDefaultValidator, wxT("FullscreenCB")); m_FullscreenCB = new wxComboBox(m_PageVideo, ID_FULLSCREENCB, wxT(""), wxDefaultPosition, wxDefaultSize, arrayStringFor_FullscreenCB, 0, wxDefaultValidator);
wxStaticText *WxStaticText1 = new wxStaticText(m_PageVideo, ID_WXSTATICTEXT1, wxT("Windowed resolution:"), wxPoint(12,104), wxDefaultSize, 0, wxT("WxStaticText1")); wxStaticText *WMText = new wxStaticText(m_PageVideo, ID_WMTEXT, wxT("Windowed resolution:"), wxDefaultPosition, wxDefaultSize, 0);
wxArrayString arrayStringFor_WindowResolutionCB; wxArrayString arrayStringFor_WindowResolutionCB;
m_WindowResolutionCB = new wxComboBox(m_PageVideo, ID_WINDOWRESOLUTIONCB, wxT(""), wxPoint(132,104), wxSize(121,21), arrayStringFor_WindowResolutionCB, 0, wxDefaultValidator, wxT("WindowResolutionCB")); m_WindowResolutionCB = new wxComboBox(m_PageVideo, ID_WINDOWRESOLUTIONCB, wxT(""), wxDefaultPosition, wxDefaultSize, arrayStringFor_WindowResolutionCB, 0, wxDefaultValidator);
//page2 //page2
m_ForceFiltering = new wxCheckBox(m_PageEnhancements, ID_FORCEFILTERING, wxT("Force bi/trlinear (May cause small glitches)"), wxPoint(12,16), wxSize(233,25), 0, wxDefaultValidator, wxT("ForceFiltering")); m_ForceFiltering = new wxCheckBox(m_PageEnhancements, ID_FORCEFILTERING, wxT("Force bi/trilinear filtering (May cause small glitches)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_ForceFiltering->SetValue(g_Config.bForceFiltering); m_ForceFiltering->SetValue(g_Config.bForceFiltering);
//page3 //page3
m_Statistics = new wxCheckBox(m_PageAdvanced, ID_STATISTICS, wxT("Overlay some statistics"), wxPoint(12,40), wxSize(233,25), 0, wxDefaultValidator, wxT("Statistics")); m_Statistics = new wxCheckBox(m_PageAdvanced, ID_STATISTICS, wxT("Overlay some statistics"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_Statistics->SetValue(g_Config.bOverlayStats); m_Statistics->SetValue(g_Config.bOverlayStats);
m_DumpTextures = new wxCheckBox(m_PageAdvanced, ID_DUMPTEXTURES, wxT("Dump textures to:"), wxPoint(12,88), wxSize(233,25), 0, wxDefaultValidator, wxT("DumpTextures")); m_DumpTextures = new wxCheckBox(m_PageAdvanced, ID_DUMPTEXTURES, wxT("Dump textures to:"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_DumpTextures->SetValue(g_Config.bDumpTextures); m_DumpTextures->SetValue(g_Config.bDumpTextures);
m_TexturePath = new wxDirPickerCtrl(m_PageAdvanced, ID_TEXTUREPATH, wxEmptyString, wxT("Choose a directory to store texture dumps:"), wxPoint(12,120), wxSize(233,25), 0);//wxDIRP_USE_TEXTCTRL); m_TexturePath = new wxDirPickerCtrl(m_PageAdvanced, ID_TEXTUREPATH, wxEmptyString, wxT("Choose a directory to store texture dumps:"), wxDefaultPosition, wxDefaultSize, wxDIRP_USE_TEXTCTRL);
m_TexturePath->SetPath(wxString::FromAscii(g_Config.texDumpPath)); m_TexturePath->SetPath(wxString::FromAscii(g_Config.texDumpPath));
m_TexturePath->Enable(m_DumpTextures->IsChecked()); m_TexturePath->Enable(m_DumpTextures->IsChecked());
//TODO: make the following work ^^ //TODO: make the following work ^^
wxStaticText *WxStaticText3 = new wxStaticText(m_PageVideo, ID_WXSTATICTEXT3, wxT("Anti-alias mode:"), wxPoint(12,136), wxDefaultSize, 0, wxT("AA")); wxStaticText *AAText = new wxStaticText(m_PageVideo, ID_AATEXT, wxT("Anti-alias mode:"), wxDefaultPosition, wxDefaultSize, 0);
wxArrayString arrayStringFor_AliasModeCB; wxArrayString arrayStringFor_AliasModeCB;
m_AliasModeCB = new wxComboBox(m_PageVideo, ID_ALIASMODECB, wxT(""), wxPoint(132,136), wxSize(121,21), arrayStringFor_AliasModeCB, 0, wxDefaultValidator, wxT("AliasModeCB")); m_AliasModeCB = new wxComboBox(m_PageVideo, ID_ALIASMODECB, wxT(""), wxDefaultPosition, wxDefaultSize, arrayStringFor_AliasModeCB, 0, wxDefaultValidator);
m_AliasModeCB->Enable(false); m_AliasModeCB->Enable(false);
m_ForceAnisotropy = new wxCheckBox(m_PageEnhancements, ID_FORCEANISOTROPY, wxT("Force maximum ansitropy filtering"), wxPoint(12,48), wxSize(233,25), 0, wxDefaultValidator, wxT("ForceAnisotropy")); m_ForceAnisotropy = new wxCheckBox(m_PageEnhancements, ID_FORCEANISOTROPY, wxT("Force maximum ansitropy filtering"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
//m_ForceAnisotropy->SetValue(g_Config.bForceMaxAniso); //m_ForceAnisotropy->SetValue(g_Config.bForceMaxAniso);
m_ForceAnisotropy->Enable(false); m_ForceAnisotropy->Enable(false);
m_Wireframe = new wxCheckBox(m_PageAdvanced, ID_WIREFRAME, wxT("Wireframe"), wxPoint(12,16), wxSize(233,25), 0, wxDefaultValidator, wxT("Wireframe")); m_Wireframe = new wxCheckBox(m_PageAdvanced, ID_WIREFRAME, wxT("Wireframe"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
//m_Wireframe->SetValue(g_Config.bWireFrame); //m_Wireframe->SetValue(g_Config.bWireFrame);
m_Wireframe->Enable(false); m_Wireframe->Enable(false);
m_ShaderErrors = new wxCheckBox(m_PageAdvanced, ID_SHADERERRORS, wxT("Show shader compilation issues"), wxPoint(12,64), wxSize(233,25), 0, wxDefaultValidator, wxT("ShaderErrors")); m_ShaderErrors = new wxCheckBox(m_PageAdvanced, ID_SHADERERRORS, wxT("Show shader compilation issues"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
//m_ShaderErrors->SetValue(g_Config.bShowShaderErrors); //m_ShaderErrors->SetValue(g_Config.bShowShaderErrors);
m_ShaderErrors->Enable(false); m_ShaderErrors->Enable(false);
//Put options in sizers in the notebook
wxGridBagSizer* sPage1;
sPage1 = new wxGridBagSizer(0, 0);
sPage1->SetFlexibleDirection(wxBOTH);
sPage1->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
sPage1->Add(m_Fullscreen, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALL, 5);
sPage1->Add(m_RenderToMainWindow, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 5);
sPage1->Add(FSText, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sPage1->Add(m_FullscreenCB, wxGBPosition(2, 1), wxGBSpan(1, 1), wxALL, 5);
sPage1->Add(WMText, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sPage1->Add(m_WindowResolutionCB, wxGBPosition(3, 1), wxGBSpan(1, 1), wxALL, 5);
sPage1->Add(AAText, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALIGN_CENTER_VERTICAL|wxALL, 5);
sPage1->Add(m_AliasModeCB, wxGBPosition(4, 1), wxGBSpan(1, 1), wxALL, 5);
m_PageVideo->SetSizer(sPage1);
sPage1->Layout();
wxBoxSizer* sPage2;
sPage2 = new wxBoxSizer(wxVERTICAL);
sPage2->Add(m_ForceFiltering, 0, wxALL, 5);
sPage2->Add(m_ForceAnisotropy, 0, wxALL, 5);
m_PageEnhancements->SetSizer(sPage2);
sPage2->Layout();
wxBoxSizer* sPage3;
sPage3 = new wxBoxSizer(wxVERTICAL);
sPage3->Add(m_Wireframe, 0, wxALL, 5);
sPage3->Add(m_Statistics, 0, wxALL, 5);
sPage3->Add(m_ShaderErrors, 0, wxALL, 5);
sPage3->Add(m_DumpTextures, 0, wxALL, 5);
sPage3->Add(m_TexturePath, 0, wxALL, 5);
m_PageAdvanced->SetSizer(sPage3);
sPage3->Layout();
SetIcon(wxNullIcon); SetIcon(wxNullIcon);
SetSize(8,8,492,273);
Center(); Center();
} }

View File

@ -28,6 +28,7 @@
#include <wx/notebook.h> #include <wx/notebook.h>
#include <wx/panel.h> #include <wx/panel.h>
#include <wx/filepicker.h> #include <wx/filepicker.h>
#include <wx/gbsizer.h>
#undef ConfigDialog_STYLE #undef ConfigDialog_STYLE
@ -96,10 +97,10 @@ class ConfigDialog : public wxDialog
ID_WIREFRAME = 1021, ID_WIREFRAME = 1021,
ID_FORCEANISOTROPY = 1020, ID_FORCEANISOTROPY = 1020,
ID_FORCEFILTERING = 1019, ID_FORCEFILTERING = 1019,
ID_WXSTATICTEXT3 = 1015, ID_AATEXT = 1015,
ID_ALIASMODECB = 1014, ID_ALIASMODECB = 1014,
ID_WXSTATICTEXT2 = 1013, ID_FSTEXT = 1013,
ID_WXSTATICTEXT1 = 1012, ID_WMTEXT = 1012,
ID_WINDOWRESOLUTIONCB = 1011, ID_WINDOWRESOLUTIONCB = 1011,
ID_FULLSCREENCB = 1010, ID_FULLSCREENCB = 1010,
ID_RENDERTOMAINWINDOW = 1009, ID_RENDERTOMAINWINDOW = 1009,