2016-01-27 09:11:59 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
|
|
|
#include "SettingsPage.h"
|
|
|
|
|
|
|
|
CGeneralOptionsPage::CGeneralOptionsPage(CSettingConfig * SettingsConfig, HWND hParent, const RECT & rcDispay) :
|
2022-09-21 05:16:07 +00:00
|
|
|
m_SettingsConfig(SettingsConfig)
|
2016-01-27 09:11:59 +00:00
|
|
|
{
|
|
|
|
if (!Create(hParent, rcDispay))
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-03-18 02:11:54 +00:00
|
|
|
// Set the text for all GUI items
|
2020-05-12 12:19:05 +00:00
|
|
|
SetDlgItemText(IDC_AUTOSLEEP, wGS(OPTION_AUTO_SLEEP).c_str());
|
|
|
|
SetDlgItemText(IDC_LOAD_FULLSCREEN, wGS(OPTION_AUTO_FULLSCREEN).c_str());
|
|
|
|
SetDlgItemText(IDC_SCREEN_SAVER, wGS(OPTION_DISABLE_SS).c_str());
|
2021-05-26 20:26:18 +00:00
|
|
|
SetDlgItemText(IDC_DISCORD_RPC, wGS(OPTION_DISCORD_RPC).c_str());
|
2020-05-12 12:19:05 +00:00
|
|
|
SetDlgItemText(IDC_BASIC_MODE, wGS(OPTION_BASIC_MODE).c_str());
|
|
|
|
SetDlgItemText(IDC_MAXROMS_TXT, wGS(RB_MAX_ROMS).c_str());
|
|
|
|
SetDlgItemText(IDC_ROMSEL_TEXT2, wGS(RB_ROMS).c_str());
|
|
|
|
SetDlgItemText(IDC_MAXROMDIR_TXT, wGS(RB_MAX_DIRS).c_str());
|
|
|
|
SetDlgItemText(IDC_ROMSEL_TEXT4, wGS(RB_DIRS).c_str());
|
|
|
|
SetDlgItemText(IDC_IPLDIR_TXT, wGS(OPTION_IPL_ROM_PATH).c_str());
|
2016-01-27 09:11:59 +00:00
|
|
|
|
2021-03-18 00:32:37 +00:00
|
|
|
AddModCheckBox(GetDlgItem(IDC_AUTOSLEEP), (SettingID)Setting_AutoSleep);
|
|
|
|
AddModCheckBox(GetDlgItem(IDC_LOAD_FULLSCREEN), (SettingID)Setting_AutoFullscreen);
|
|
|
|
AddModCheckBox(GetDlgItem(IDC_SCREEN_SAVER), (SettingID)Setting_DisableScrSaver);
|
2022-09-21 05:16:07 +00:00
|
|
|
AddModCheckBox(GetDlgItem(IDC_DISCORD_RPC), (SettingID)Setting_EnableDiscordRPC);
|
2016-01-27 09:11:59 +00:00
|
|
|
AddModCheckBox(GetDlgItem(IDC_BASIC_MODE), UserInterface_BasicMode);
|
|
|
|
|
2021-03-18 00:32:37 +00:00
|
|
|
CModifiedEditBox * TxtBox = AddModTextBox(GetDlgItem(IDC_REMEMBER), (SettingID)File_RecentGameFileCount, false);
|
2016-01-27 09:11:59 +00:00
|
|
|
TxtBox->SetTextField(GetDlgItem(IDC_MAXROMS_TXT));
|
|
|
|
|
2021-03-18 00:32:37 +00:00
|
|
|
TxtBox = AddModTextBox(GetDlgItem(IDC_REMEMBERDIR), (SettingID)Directory_RecentGameDirCount, false);
|
2016-01-27 09:11:59 +00:00
|
|
|
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)
|
|
|
|
{
|
2022-09-21 05:16:07 +00:00
|
|
|
if (CSettingsPageImpl<CGeneralOptionsPage>::EnableReset())
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2016-01-27 09:11:59 +00:00
|
|
|
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);
|
2016-06-03 22:23:30 +00:00
|
|
|
}
|