project64/Source/Project64/UserInterface/Settings/SettingsPage-Options.cpp

79 lines
3.0 KiB
C++
Raw Normal View History

2012-12-19 09:30:18 +00:00
/****************************************************************************
* *
2015-11-10 05:21:49 +00:00
* Project64 - A Nintendo 64 emulator. *
2012-12-19 09:30:18 +00:00
* http://www.pj64-emu.com/ *
* Copyright (C) 2012 Project64. All rights reserved. *
* *
* License: *
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
* *
****************************************************************************/
#include "stdafx.h"
2015-09-07 19:47:44 +00:00
#include "SettingsPage.h"
CGeneralOptionsPage::CGeneralOptionsPage(CSettingConfig * SettingsConfig, HWND hParent, const RECT & rcDispay) :
m_SettingsConfig(SettingsConfig)
{
if (!Create(hParent, rcDispay))
{
return;
}
2015-03-17 02:56:53 +00:00
//Set the text for all gui Items
SetDlgItemTextW(m_hWnd, IDC_AUTOSLEEP, GS(OPTION_AUTO_SLEEP));
SetDlgItemTextW(m_hWnd, IDC_LOAD_FULLSCREEN, GS(OPTION_AUTO_FULLSCREEN));
SetDlgItemTextW(m_hWnd, IDC_SCREEN_SAVER, GS(OPTION_DISABLE_SS));
SetDlgItemTextW(m_hWnd, IDC_BASIC_MODE, GS(OPTION_BASIC_MODE));
SetDlgItemTextW(m_hWnd, IDC_MAXROMS_TXT, GS(RB_MAX_ROMS));
2015-03-18 02:09:33 +00:00
SetDlgItemTextW(m_hWnd, IDC_ROMSEL_TEXT2, GS(RB_ROMS));
2015-03-17 02:56:53 +00:00
SetDlgItemTextW(m_hWnd, IDC_MAXROMDIR_TXT, GS(RB_MAX_DIRS));
2015-03-18 02:09:33 +00:00
SetDlgItemTextW(m_hWnd, IDC_ROMSEL_TEXT4, GS(RB_DIRS));
2015-03-17 02:56:53 +00:00
AddModCheckBox(GetDlgItem(IDC_AUTOSLEEP), Setting_AutoSleep);
AddModCheckBox(GetDlgItem(IDC_LOAD_FULLSCREEN), Setting_AutoFullscreen);
AddModCheckBox(GetDlgItem(IDC_SCREEN_SAVER), Setting_DisableScrSaver);
AddModCheckBox(GetDlgItem(IDC_BASIC_MODE), UserInterface_BasicMode);
CModifiedEditBox * TxtBox = AddModTextBox(GetDlgItem(IDC_REMEMBER), File_RecentGameFileCount, false);
TxtBox->SetTextField(GetDlgItem(IDC_MAXROMS_TXT));
TxtBox = AddModTextBox(GetDlgItem(IDC_REMEMBERDIR), Directory_RecentGameDirCount, false);
TxtBox->SetTextField(GetDlgItem(IDC_MAXROMDIR_TXT));
UpdatePageSettings();
}
void CGeneralOptionsPage::HidePage()
{
ShowWindow(SW_HIDE);
}
void CGeneralOptionsPage::ShowPage()
{
ShowWindow(SW_SHOW);
}
void CGeneralOptionsPage::ApplySettings(bool UpdateScreen)
{
CSettingsPageImpl<CGeneralOptionsPage>::ApplySettings(UpdateScreen);
}
bool CGeneralOptionsPage::EnableReset(void)
{
if (CSettingsPageImpl<CGeneralOptionsPage>::EnableReset()) { return true; }
return false;
}
void CGeneralOptionsPage::ResetPage()
{
CSettingsPageImpl<CGeneralOptionsPage>::ResetPage();
m_SettingsConfig->UpdateAdvanced((int)::SendMessage(GetDlgItem(IDC_BASIC_MODE), BM_GETCHECK, 0, 0) == 0);
}
void CGeneralOptionsPage::OnBasicMode(UINT Code, int id, HWND ctl)
{
CheckBoxChanged(Code, id, ctl);
m_SettingsConfig->UpdateAdvanced((int)::SendMessage(ctl, BM_GETCHECK, 0, 0) == 0);
}