updated gui a little bit

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@488 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2008-09-09 23:34:13 +00:00
parent 7ae9fb085b
commit 38ff37539d
9 changed files with 64 additions and 25 deletions

View File

@ -117,6 +117,7 @@ void SConfig::LoadSettings()
ini.Get("Core", "UseDynarec", &m_LocalCoreStartupParameter.bUseJIT, true);
ini.Get("Core", "UseDualCore", &m_LocalCoreStartupParameter.bUseDualCore, false);
ini.Get("Core", "LockThreads", &m_LocalCoreStartupParameter.bLockThreads, true);
ini.Get("Core", "DefaultGCM", &m_LocalCoreStartupParameter.m_strDefaultGCM);
ini.Get("Core", "OptimizeQuantizers", &m_LocalCoreStartupParameter.bOptimizeQuantizers, true);
}
}

View File

@ -86,6 +86,7 @@ EVT_MENU(IDM_HELPGOOGLECODE, CFrame::OnHelp)
EVT_MENU(IDM_HELPABOUT, CFrame::OnHelp)
EVT_MENU(wxID_REFRESH, CFrame::OnRefresh)
EVT_MENU(IDM_PLAY, CFrame::OnPlay)
EVT_MENU(IDM_PAUSE, CFrame::OnPlay)
EVT_MENU(IDM_STOP, CFrame::OnStop)
EVT_MENU(IDM_PLUGIN_OPTIONS, CFrame::OnPluginOptions)
EVT_MENU(IDM_CONFIG_GFX_PLUGIN, CFrame::OnPluginGFX)
@ -217,7 +218,7 @@ void CFrame::CreateMenu()
pOptionsMenu->Append(IDM_CONFIG_DSP_PLUGIN, _T("&DSP settings"));
pOptionsMenu->Append(IDM_CONFIG_PAD_PLUGIN, _T("&PAD settings"));
pOptionsMenu->AppendSeparator();
pOptionsMenu->Append(IDM_TOGGLE_FULLSCREEN, _T("&Fullscreen"));
pOptionsMenu->Append(IDM_TOGGLE_FULLSCREEN, _T("&Fullscreen\tEsc"));
pOptionsMenu->AppendCheckItem(IDM_TOGGLE_DUALCORE, _T("&Dual-core (unstable!)"));
pOptionsMenu->Check(IDM_TOGGLE_DUALCORE, SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore);
m_pMenuBar->Append(pOptionsMenu, _T("&Options"));
@ -254,7 +255,7 @@ void CFrame::PopulateToolbar(wxToolBar* toolBar)
toolBar->AddTool(wxID_REFRESH, _T("Refresh"), m_Bitmaps[Toolbar_Refresh], _T("Refresh"));
toolBar->AddTool(IDM_BROWSE, _T("Browse"), m_Bitmaps[Toolbar_Browse], _T("Browse for an ISO directory..."));
toolBar->AddSeparator();
toolBar->AddTool(IDM_PLAY, _T("Play"), m_Bitmaps[Toolbar_Play], _T("Play"));
m_pToolPlay = toolBar->AddTool(IDM_PLAY, _T("Play"), m_Bitmaps[Toolbar_Play], _T("Play"));
toolBar->SetToolDisabledBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Play_Dis]);
toolBar->AddTool(IDM_STOP, _T("Stop"), m_Bitmaps[Toolbar_Stop], _T("Stop"));
toolBar->SetToolDisabledBitmap(IDM_STOP, m_Bitmaps[Toolbar_Stop_Dis]);
@ -575,6 +576,11 @@ void CFrame::UpdateGUI()
GetToolBar()->EnableTool(IDM_STOP, false);
GetToolBar()->EnableTool(IDM_PLAY, false);
m_pToolPlay->SetShortHelp(_T("Play"));
m_pToolPlay->SetLabel(_T("Play"));
m_pMenuItemPlay->SetText(_T("Play"));
m_pMenuItemPlay->Enable(false);
m_pMenuItemStop->Enable(false);
m_pMenuItemLoad->Enable(false);
@ -595,19 +601,22 @@ void CFrame::UpdateGUI()
if (Core::GetState() == Core::CORE_RUN)
{
GetToolBar()->SetToolNormalBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Pause]);
GetToolBar()->SetToolShortHelp(IDM_PLAY, _T("Pause"));
m_pToolPlay->SetNormalBitmap(m_Bitmaps[Toolbar_Pause]);
m_pToolPlay->SetShortHelp(_T("Pause"));
m_pToolPlay->SetLabel(_T("Pause"));
m_pMenuItemPlay->SetText(_T("Pause"));
}
else
{
GetToolBar()->SetToolNormalBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Play]);
GetToolBar()->SetToolShortHelp(IDM_PLAY, _T("Play"));
m_pToolPlay->SetNormalBitmap(m_Bitmaps[Toolbar_Play]);
m_pToolPlay->SetShortHelp(_T("Play"));
m_pToolPlay->SetLabel(_T("Play"));
m_pMenuItemPlay->SetText(_T("Play"));
}
}
GetToolBar()->Realize();
}
// gamelistctrl

View File

@ -83,6 +83,8 @@ class CFrame
wxMenuItem* m_pMenuItemLoad;
wxMenuItem* m_pMenuItemSave;
wxToolBarToolBase* m_pToolPlay;
wxBusyInfo* m_pBootProcessDialog;
void UpdateGUI();

View File

@ -46,6 +46,7 @@ EVT_LIST_ITEM_ACTIVATED(LIST_CTRL, CGameListCtrl::OnActivated)
EVT_LIST_COL_END_DRAG(LIST_CTRL, CGameListCtrl::OnColEndDrag)
EVT_MENU(IDM_EDITPATCHFILE, CGameListCtrl::OnEditPatchFile)
EVT_MENU(IDM_OPENCONTAININGFOLDER, CGameListCtrl::OnOpenContainingFolder)
EVT_MENU(IDM_SETDEFAULTGCM, CGameListCtrl::OnSetDefaultGCM)
END_EVENT_TABLE()
@ -340,6 +341,7 @@ CGameListCtrl::OnRightClick(wxMouseEvent& event)
std::string menu_text = StringFromFormat("Edit &patch file: %s.ini", unique_id.c_str());
popupMenu.Append(IDM_EDITPATCHFILE, wxString::FromAscii(menu_text.c_str())); //Pretty much everything in wxwidgets is a wxString, try to convert to those first!
popupMenu.Append(IDM_OPENCONTAININGFOLDER, wxString::FromAscii("Open &containing folder"));
popupMenu.Append(IDM_SETDEFAULTGCM, wxString::FromAscii("Set as &default ISO"));
PopupMenu(&popupMenu);
}
}
@ -383,6 +385,15 @@ CGameListCtrl::OnOpenContainingFolder(wxCommandEvent& WXUNUSED (event)) {
File::Explore(path);
}
void
CGameListCtrl::OnSetDefaultGCM(wxCommandEvent& WXUNUSED (event)) {
const CISOFile *iso = GetSelectedISO();
if (!iso)
return;
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM = iso->GetFileName();
SConfig::GetInstance().SaveSettings();
}
void
CGameListCtrl::OnEditPatchFile(wxCommandEvent& WXUNUSED (event))
{

View File

@ -67,6 +67,7 @@ class CGameListCtrl : public wxListCtrl
void OnSize(wxSizeEvent& event);
void OnEditPatchFile(wxCommandEvent& event);
void OnOpenContainingFolder(wxCommandEvent& event);
void OnSetDefaultGCM(wxCommandEvent& event);
virtual bool MSWDrawSubItem(wxPaintDC& rPaintDC, int item, int subitem);

View File

@ -43,11 +43,13 @@ enum
IDM_LOADSLOT9,
IDM_LOADSLOT10,
IDM_PLAY,
IDM_PAUSE,
IDM_STOP,
IDM_BROWSE,
IDM_MEMCARD,
IDM_EDITPATCHFILE,
IDM_OPENCONTAININGFOLDER,
IDM_SETDEFAULTGCM,
IDM_PLUGIN_OPTIONS,
IDM_CONFIG_GFX_PLUGIN,
IDM_CONFIG_DSP_PLUGIN,

View File

@ -33,6 +33,7 @@ BEGIN_EVENT_TABLE(ConfigDialog,wxDialog)
EVT_CHECKBOX(ID_FORCEFILTERING,ConfigDialog::ForceFilteringCheck)
EVT_CHECKBOX(ID_FORCEANISOTROPY,ConfigDialog::ForceAnisotropyCheck)
EVT_CHECKBOX(ID_WIREFRAME,ConfigDialog::WireframeCheck)
EVT_CHECKBOX(ID_SHOWFPS,ConfigDialog::ShowFPSCheck)
EVT_CHECKBOX(ID_STATISTICS,ConfigDialog::OverlayCheck)
EVT_CHECKBOX(ID_SHADERERRORS,ConfigDialog::ShowShaderErrorsCheck)
EVT_CHECKBOX(ID_TEXFMTOVERLAY,ConfigDialog::TexFmtOverlayChange)
@ -113,6 +114,9 @@ void ConfigDialog::CreateGUIControls()
m_ForceFiltering->SetValue(g_Config.bForceFiltering);
//page3
m_ShowFPS = new wxCheckBox(m_PageAdvanced, ID_SHOWFPS, wxT("Overlay FPS"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_ShowFPS->SetValue(g_Config.bShowFPS);
m_Statistics = new wxCheckBox(m_PageAdvanced, ID_STATISTICS, wxT("Overlay some statistics"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_Statistics->SetValue(g_Config.bOverlayStats);
@ -170,11 +174,12 @@ void ConfigDialog::CreateGUIControls()
sPage3->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
sPage3->Add(m_Wireframe, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_ShaderErrors, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_Statistics, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_TexFmtOverlay, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_TexFmtCenter, wxGBPosition(3, 1), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_DumpTextures, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_TexturePath, wxGBPosition(4, 1), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_ShowFPS, wxGBPosition(2, 0), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_Statistics, wxGBPosition(3, 0), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_TexFmtOverlay, wxGBPosition(4, 0), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_TexFmtCenter, wxGBPosition(4, 1), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_DumpTextures, wxGBPosition(5, 0), wxGBSpan(1, 1), wxALL, 5);
sPage3->Add(m_TexturePath, wxGBPosition(5, 1), wxGBSpan(1, 1), wxALL, 5);
m_PageAdvanced->SetSizer(sPage3);
sPage3->Layout();
@ -261,6 +266,11 @@ void ConfigDialog::ShowShaderErrorsCheck(wxCommandEvent& event)
g_Config.bShowShaderErrors = m_ShaderErrors->IsChecked();
}
void ConfigDialog::ShowFPSCheck(wxCommandEvent& event)
{
g_Config.bShowFPS = m_ShowFPS->IsChecked();
}
void ConfigDialog::OverlayCheck(wxCommandEvent& event)
{
g_Config.bOverlayStats = m_Statistics->IsChecked();

View File

@ -55,6 +55,7 @@ class ConfigDialog : public wxDialog
void ForceFilteringCheck(wxCommandEvent& event);
void ForceAnisotropyCheck(wxCommandEvent& event);
void WireframeCheck(wxCommandEvent& event);
void ShowFPSCheck(wxCommandEvent& event);
void OverlayCheck(wxCommandEvent& event);
void ShowShaderErrorsCheck(wxCommandEvent& event);
void TexFmtOverlayChange(wxCommandEvent& event);
@ -70,6 +71,7 @@ class ConfigDialog : public wxDialog
wxCheckBox *m_TexFmtCenter;
wxCheckBox *m_TexFmtOverlay;
wxCheckBox *m_Statistics;
wxCheckBox *m_ShowFPS;
wxCheckBox *m_ShaderErrors;
wxCheckBox *m_Wireframe;
wxCheckBox *m_ForceAnisotropy;
@ -95,6 +97,7 @@ class ConfigDialog : public wxDialog
ID_SHADERERRORS,
ID_TEXFMTCENTER,
ID_TEXFMTOVERLAY,
ID_SHOWFPS,
ID_STATISTICS,
ID_DUMPTEXTURES,
ID_WIREFRAME,

View File

@ -52,15 +52,16 @@ void Config::Load()
IniFile iniFile;
iniFile.Load("gfx_opengl.ini");
iniFile.Get("Hardware", "Adapter", &iAdapter, 0);
if (iAdapter == -1)
iAdapter = 0;
iniFile.Get("Hardware", "WindowedRes", &temp, 0);
strcpy(iWindowedRes, temp.c_str());
iniFile.Get("Hardware", "FullscreenRes", &temp, 0);
strcpy(iFSResolution, temp.c_str());
iniFile.Get("Hardware", "Fullscreen", &bFullscreen, 0);
iniFile.Get("Hardware", "RenderToMainframe", &renderToMainframe, 0);
if (iAdapter == -1)
iAdapter = 0;
iniFile.Get("Settings", "ShowFPS", &bShowFPS, false);
iniFile.Get("Settings", "OverlayStats", &bOverlayStats, false);
iniFile.Get("Settings", "Postprocess", &iPostprocessEffect, 0);
iniFile.Get("Settings", "DLOptimize", &iCompileDLsLevel, 0);
@ -84,7 +85,6 @@ void Config::Load()
iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0);
iniFile.Get("Enhancements", "ForceMaxAniso", &bForceMaxAniso, 0);
iniFile.Get("Enhancements", "StretchToFit", &bStretchToFit, false);
iniFile.Get("Enhancements", "ShowFPS", &bShowFPS, false);
}
void Config::Save()
@ -97,6 +97,7 @@ void Config::Save()
iniFile.Set("Hardware", "Fullscreen", bFullscreen);
iniFile.Set("Hardware", "RenderToMainframe", renderToMainframe);
iniFile.Set("Settings", "ShowFPS", bShowFPS);
iniFile.Set("Settings", "OverlayStats", bOverlayStats);
iniFile.Set("Settings", "Postprocess", iPostprocessEffect);
iniFile.Set("Settings", "DLOptimize", iCompileDLsLevel);
@ -104,14 +105,13 @@ void Config::Save()
iniFile.Set("Settings", "ShowShaderErrors", bShowShaderErrors);
iniFile.Set("Settings", "Multisample", iMultisampleMode);
iniFile.Set("Settings", "TexDumpPath", texDumpPath);
iniFile.Set("Settings", "TexFmtOverlayEnable", bTexFmtOverlayEnable);
iniFile.Set("Settings", "TexFmtOverlayCenter", bTexFmtOverlayCenter);
iniFile.Set("Enhancements", "ForceFiltering", bForceFiltering);
iniFile.Set("Enhancements", "ForceMaxAniso", bForceMaxAniso);
iniFile.Set("Enhancements", "StretchToFit", bStretchToFit);
iniFile.Set("Enhancements", "ShowFPS", bShowFPS);
iniFile.Save("gfx_opengl.ini");
}