[Project64] Cleanup Settings/SettingsPage.h
This commit is contained in:
parent
04747706f2
commit
5942722436
|
@ -15,14 +15,14 @@
|
||||||
class CSettingsPage
|
class CSettingsPage
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~CSettingsPage ( void ) = 0 {};
|
virtual ~CSettingsPage(void) = 0 {};
|
||||||
|
|
||||||
virtual LanguageStringID PageTitle ( void ) = 0;
|
virtual LanguageStringID PageTitle(void) = 0;
|
||||||
virtual void HidePage ( void ) = 0;
|
virtual void HidePage(void) = 0;
|
||||||
virtual void ShowPage ( void ) = 0;
|
virtual void ShowPage(void) = 0;
|
||||||
virtual void ApplySettings ( bool UpdateScreen ) = 0;
|
virtual void ApplySettings(bool UpdateScreen) = 0;
|
||||||
virtual bool EnableReset ( void ) = 0;
|
virtual bool EnableReset(void) = 0;
|
||||||
virtual void ResetPage ( void ) = 0;
|
virtual void ResetPage(void) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
|
@ -30,30 +30,29 @@ class CSettingsPageImpl :
|
||||||
public CDialogImpl<T>
|
public CDialogImpl<T>
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
typedef std::map<SettingID,CModifiedEditBox *> TextBoxList;
|
typedef std::map<SettingID, CModifiedEditBox *> TextBoxList;
|
||||||
typedef std::map<SettingID,CModifiedButton *> ButtonList;
|
typedef std::map<SettingID, CModifiedButton *> ButtonList;
|
||||||
typedef std::map<SettingID,CModifiedComboBox *> ComboBoxList;
|
typedef std::map<SettingID, CModifiedComboBox *> ComboBoxList;
|
||||||
typedef std::map<SettingID,CModifiedComboBoxTxt *> ComboBoxTxtList;
|
typedef std::map<SettingID, CModifiedComboBoxTxt *> ComboBoxTxtList;
|
||||||
|
|
||||||
virtual ~CSettingsPageImpl()
|
virtual ~CSettingsPageImpl()
|
||||||
{
|
{
|
||||||
for (TextBoxList::iterator eb_iter = m_TxtBoxList.begin(); eb_iter != m_TxtBoxList.end(); eb_iter ++)
|
for (TextBoxList::iterator eb_iter = m_TxtBoxList.begin(); eb_iter != m_TxtBoxList.end(); eb_iter++)
|
||||||
{
|
{
|
||||||
delete eb_iter->second;
|
delete eb_iter->second;
|
||||||
}
|
}
|
||||||
for (ButtonList::iterator iter = m_ButtonList.begin(); iter != m_ButtonList.end(); iter ++)
|
for (ButtonList::iterator iter = m_ButtonList.begin(); iter != m_ButtonList.end(); iter++)
|
||||||
{
|
{
|
||||||
delete iter->second;
|
delete iter->second;
|
||||||
}
|
}
|
||||||
for (ComboBoxTxtList::iterator cbtxt_iter = m_ComboBoxTxtList.begin(); cbtxt_iter != m_ComboBoxTxtList.end(); cbtxt_iter ++)
|
for (ComboBoxTxtList::iterator cbtxt_iter = m_ComboBoxTxtList.begin(); cbtxt_iter != m_ComboBoxTxtList.end(); cbtxt_iter++)
|
||||||
{
|
{
|
||||||
delete cbtxt_iter->second;
|
delete cbtxt_iter->second;
|
||||||
}
|
}
|
||||||
for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter ++)
|
for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter++)
|
||||||
{
|
{
|
||||||
delete cb_iter->second;
|
delete cb_iter->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
bool Create(HWND hParent, const RECT & rcDispay)
|
bool Create(HWND hParent, const RECT & rcDispay)
|
||||||
{
|
{
|
||||||
|
@ -73,14 +72,14 @@ protected:
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
SetWindowPos(HWND_TOP,&rcDispay,SWP_HIDEWINDOW);
|
SetWindowPos(HWND_TOP, &rcDispay, SWP_HIDEWINDOW);
|
||||||
m_UpdatingTxt = false;
|
m_UpdatingTxt = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckBoxChanged ( UINT /*Code*/, int id, HWND /*ctl*/ )
|
void CheckBoxChanged(UINT /*Code*/, int id, HWND /*ctl*/)
|
||||||
{
|
{
|
||||||
for (ButtonList::iterator iter = m_ButtonList.begin(); iter != m_ButtonList.end(); iter ++)
|
for (ButtonList::iterator iter = m_ButtonList.begin(); iter != m_ButtonList.end(); iter++)
|
||||||
{
|
{
|
||||||
CModifiedButton * Button = iter->second;
|
CModifiedButton * Button = iter->second;
|
||||||
if ((int)Button->GetMenu() != id)
|
if ((int)Button->GetMenu() != id)
|
||||||
|
@ -88,22 +87,23 @@ protected:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Button->SetChanged(true);
|
Button->SetChanged(true);
|
||||||
SendMessage(GetParent(),PSM_CHANGED,(WPARAM)m_hWnd,0);
|
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateModEditBox ( CModifiedEditBox & EditBox, SettingID Type )
|
void UpdateModEditBox(CModifiedEditBox & EditBox, SettingID Type)
|
||||||
{
|
{
|
||||||
if (EditBox.IsChanged())
|
if (EditBox.IsChanged())
|
||||||
{
|
{
|
||||||
stdstr Value = EditBox.GetWindowText();
|
stdstr Value = EditBox.GetWindowText();
|
||||||
if (EditBox.IsbString())
|
if (EditBox.IsbString())
|
||||||
{
|
{
|
||||||
g_Settings->SaveString(Type,Value);
|
g_Settings->SaveString(Type, Value);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
DWORD dwValue = atoi(Value.c_str());
|
DWORD dwValue = atoi(Value.c_str());
|
||||||
g_Settings->SaveDword(Type,dwValue);
|
g_Settings->SaveDword(Type, dwValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (EditBox.IsReset())
|
if (EditBox.IsReset())
|
||||||
|
@ -113,15 +113,14 @@ protected:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UpdateModCheckBox(CModifiedButton & CheckBox, SettingID Type)
|
||||||
void UpdateModCheckBox ( CModifiedButton & CheckBox, SettingID Type )
|
|
||||||
{
|
{
|
||||||
if (CheckBox.IsChanged())
|
if (CheckBox.IsChanged())
|
||||||
{
|
{
|
||||||
bool bValue = CheckBox.GetCheck() == BST_CHECKED;
|
bool bValue = CheckBox.GetCheck() == BST_CHECKED;
|
||||||
if (bValue != g_Settings->LoadBool(Type))
|
if (bValue != g_Settings->LoadBool(Type))
|
||||||
{
|
{
|
||||||
g_Settings->SaveBool(Type,bValue);
|
g_Settings->SaveBool(Type, bValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CheckBox.IsReset())
|
if (CheckBox.IsReset())
|
||||||
|
@ -131,7 +130,7 @@ protected:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ResetCheckBox ( CModifiedButton & CheckBox, SettingID Type )
|
bool ResetCheckBox(CModifiedButton & CheckBox, SettingID Type)
|
||||||
{
|
{
|
||||||
if (!CheckBox.IsChanged())
|
if (!CheckBox.IsChanged())
|
||||||
{
|
{
|
||||||
|
@ -144,7 +143,7 @@ protected:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ResetEditBox ( CModifiedEditBox & EditBox, SettingID Type )
|
bool ResetEditBox(CModifiedEditBox & EditBox, SettingID Type)
|
||||||
{
|
{
|
||||||
if (!EditBox.IsChanged())
|
if (!EditBox.IsChanged())
|
||||||
{
|
{
|
||||||
|
@ -156,15 +155,16 @@ protected:
|
||||||
stdstr Value = g_Settings->LoadDefaultString(Type);
|
stdstr Value = g_Settings->LoadDefaultString(Type);
|
||||||
EditBox.SetWindowText(Value.c_str());
|
EditBox.SetWindowText(Value.c_str());
|
||||||
EditBox.SetReset(true);
|
EditBox.SetReset(true);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
DWORD Value = g_Settings->LoadDefaultDword(Type);
|
DWORD Value = g_Settings->LoadDefaultDword(Type);
|
||||||
EditBox.SetWindowText(stdstr_f("%d",Value).c_str());
|
EditBox.SetWindowText(stdstr_f("%d", Value).c_str());
|
||||||
EditBox.SetReset(true);
|
EditBox.SetReset(true);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
CModifiedEditBox * AddModTextBox ( HWND hWnd, SettingID Type, bool bString )
|
CModifiedEditBox * AddModTextBox(HWND hWnd, SettingID Type, bool bString)
|
||||||
{
|
{
|
||||||
TextBoxList::iterator item = m_TxtBoxList.find(Type);
|
TextBoxList::iterator item = m_TxtBoxList.find(Type);
|
||||||
if (item == m_TxtBoxList.end())
|
if (item == m_TxtBoxList.end())
|
||||||
|
@ -176,13 +176,13 @@ protected:
|
||||||
}
|
}
|
||||||
EditBox->Attach(hWnd);
|
EditBox->Attach(hWnd);
|
||||||
|
|
||||||
m_TxtBoxList.insert(TextBoxList::value_type(Type,EditBox));
|
m_TxtBoxList.insert(TextBoxList::value_type(Type, EditBox));
|
||||||
return EditBox;
|
return EditBox;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddModCheckBox ( HWND hWnd, SettingID Type )
|
void AddModCheckBox(HWND hWnd, SettingID Type)
|
||||||
{
|
{
|
||||||
ButtonList::iterator item = m_ButtonList.find(Type);
|
ButtonList::iterator item = m_ButtonList.find(Type);
|
||||||
if (item == m_ButtonList.end())
|
if (item == m_ButtonList.end())
|
||||||
|
@ -194,11 +194,11 @@ protected:
|
||||||
}
|
}
|
||||||
Button->Attach(hWnd);
|
Button->Attach(hWnd);
|
||||||
|
|
||||||
m_ButtonList.insert(ButtonList::value_type(Type,Button));
|
m_ButtonList.insert(ButtonList::value_type(Type, Button));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CModifiedComboBox * AddModComboBox ( HWND hWnd, SettingID Type )
|
CModifiedComboBox * AddModComboBox(HWND hWnd, SettingID Type)
|
||||||
{
|
{
|
||||||
ComboBoxList::iterator item = m_ComboBoxList.find(Type);
|
ComboBoxList::iterator item = m_ComboBoxList.find(Type);
|
||||||
if (item != m_ComboBoxList.end())
|
if (item != m_ComboBoxList.end())
|
||||||
|
@ -206,17 +206,17 @@ protected:
|
||||||
return item->second;
|
return item->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
CModifiedComboBox * ComboBox = new CModifiedComboBox(g_Settings->LoadDefaultDword(Type),NULL,false);
|
CModifiedComboBox * ComboBox = new CModifiedComboBox(g_Settings->LoadDefaultDword(Type), NULL, false);
|
||||||
if (ComboBox == NULL)
|
if (ComboBox == NULL)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
ComboBox->Attach(hWnd);
|
ComboBox->Attach(hWnd);
|
||||||
m_ComboBoxList.insert(ComboBoxList::value_type(Type,ComboBox));
|
m_ComboBoxList.insert(ComboBoxList::value_type(Type, ComboBox));
|
||||||
return ComboBox;
|
return ComboBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
CModifiedComboBoxTxt * AddModComboBoxTxt ( HWND hWnd, SettingID Type )
|
CModifiedComboBoxTxt * AddModComboBoxTxt(HWND hWnd, SettingID Type)
|
||||||
{
|
{
|
||||||
ComboBoxTxtList::iterator item = m_ComboBoxTxtList.find(Type);
|
ComboBoxTxtList::iterator item = m_ComboBoxTxtList.find(Type);
|
||||||
if (item != m_ComboBoxTxtList.end())
|
if (item != m_ComboBoxTxtList.end())
|
||||||
|
@ -230,47 +230,46 @@ protected:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
ComboBox->Attach(hWnd);
|
ComboBox->Attach(hWnd);
|
||||||
m_ComboBoxTxtList.insert(ComboBoxTxtList::value_type(Type,ComboBox));
|
m_ComboBoxTxtList.insert(ComboBoxTxtList::value_type(Type, ComboBox));
|
||||||
return ComboBox;
|
return ComboBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateCheckBoxes ( void )
|
void UpdateCheckBoxes(void)
|
||||||
{
|
{
|
||||||
for (ButtonList::iterator iter = m_ButtonList.begin(); iter != m_ButtonList.end(); iter ++)
|
for (ButtonList::iterator iter = m_ButtonList.begin(); iter != m_ButtonList.end(); iter++)
|
||||||
{
|
{
|
||||||
CModifiedButton * Button = iter->second;
|
CModifiedButton * Button = iter->second;
|
||||||
bool SettingSelected;
|
bool SettingSelected;
|
||||||
|
|
||||||
Button->SetChanged(g_Settings->LoadBool(iter->first,SettingSelected));
|
Button->SetChanged(g_Settings->LoadBool(iter->first, SettingSelected));
|
||||||
Button->SetCheck(SettingSelected ? BST_CHECKED : BST_UNCHECKED);
|
Button->SetCheck(SettingSelected ? BST_CHECKED : BST_UNCHECKED);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateComboBoxes ( void)
|
void UpdateComboBoxes(void)
|
||||||
{
|
{
|
||||||
for (ComboBoxTxtList::iterator cbtxt_iter = m_ComboBoxTxtList.begin(); cbtxt_iter != m_ComboBoxTxtList.end(); cbtxt_iter ++)
|
for (ComboBoxTxtList::iterator cbtxt_iter = m_ComboBoxTxtList.begin(); cbtxt_iter != m_ComboBoxTxtList.end(); cbtxt_iter++)
|
||||||
{
|
{
|
||||||
CModifiedComboBoxTxt * ComboBox = cbtxt_iter->second;
|
CModifiedComboBoxTxt * ComboBox = cbtxt_iter->second;
|
||||||
stdstr SelectedValue;
|
stdstr SelectedValue;
|
||||||
|
|
||||||
ComboBox->SetChanged(g_Settings->LoadStringVal(cbtxt_iter->first,SelectedValue));
|
ComboBox->SetChanged(g_Settings->LoadStringVal(cbtxt_iter->first, SelectedValue));
|
||||||
ComboBox->SetDefault(SelectedValue);
|
ComboBox->SetDefault(SelectedValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter ++)
|
for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter++)
|
||||||
{
|
{
|
||||||
CModifiedComboBox * ComboBox = cb_iter->second;
|
CModifiedComboBox * ComboBox = cb_iter->second;
|
||||||
uint32_t SelectedValue;
|
uint32_t SelectedValue;
|
||||||
|
|
||||||
ComboBox->SetChanged(g_Settings->LoadDword(cb_iter->first,SelectedValue));
|
ComboBox->SetChanged(g_Settings->LoadDword(cb_iter->first, SelectedValue));
|
||||||
ComboBox->SetDefault(SelectedValue);
|
ComboBox->SetDefault(SelectedValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateTextBoxes ( void)
|
void UpdateTextBoxes(void)
|
||||||
{
|
{
|
||||||
for (TextBoxList::iterator iter = m_TxtBoxList.begin(); iter != m_TxtBoxList.end(); iter ++)
|
for (TextBoxList::iterator iter = m_TxtBoxList.begin(); iter != m_TxtBoxList.end(); iter++)
|
||||||
{
|
{
|
||||||
CModifiedEditBox * TextBox = iter->second;
|
CModifiedEditBox * TextBox = iter->second;
|
||||||
|
|
||||||
|
@ -278,27 +277,28 @@ protected:
|
||||||
if (TextBox->IsbString())
|
if (TextBox->IsbString())
|
||||||
{
|
{
|
||||||
stdstr SelectedValue;
|
stdstr SelectedValue;
|
||||||
TextBox->SetChanged(g_Settings->LoadStringVal(iter->first,SelectedValue));
|
TextBox->SetChanged(g_Settings->LoadStringVal(iter->first, SelectedValue));
|
||||||
TextBox->SetWindowText(SelectedValue.c_str());
|
TextBox->SetWindowText(SelectedValue.c_str());
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
uint32_t SelectedValue;
|
uint32_t SelectedValue;
|
||||||
TextBox->SetChanged(g_Settings->LoadDword(iter->first,SelectedValue));
|
TextBox->SetChanged(g_Settings->LoadDword(iter->first, SelectedValue));
|
||||||
TextBox->SetWindowText(stdstr_f("%d",SelectedValue).c_str());
|
TextBox->SetWindowText(stdstr_f("%d", SelectedValue).c_str());
|
||||||
}
|
}
|
||||||
m_UpdatingTxt = false;
|
m_UpdatingTxt = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void UpdatePageSettings ( void )
|
virtual void UpdatePageSettings(void)
|
||||||
{
|
{
|
||||||
UpdateCheckBoxes();
|
UpdateCheckBoxes();
|
||||||
UpdateComboBoxes();
|
UpdateComboBoxes();
|
||||||
UpdateTextBoxes();
|
UpdateTextBoxes();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComboBoxChanged ( UINT /*Code*/, int id, HWND /*ctl*/ )
|
void ComboBoxChanged(UINT /*Code*/, int id, HWND /*ctl*/)
|
||||||
{
|
{
|
||||||
for (ComboBoxTxtList::iterator cbtxt_iter = m_ComboBoxTxtList.begin(); cbtxt_iter != m_ComboBoxTxtList.end(); cbtxt_iter ++)
|
for (ComboBoxTxtList::iterator cbtxt_iter = m_ComboBoxTxtList.begin(); cbtxt_iter != m_ComboBoxTxtList.end(); cbtxt_iter++)
|
||||||
{
|
{
|
||||||
CModifiedComboBoxTxt * ComboBox = cbtxt_iter->second;
|
CModifiedComboBoxTxt * ComboBox = cbtxt_iter->second;
|
||||||
if ((int)ComboBox->GetMenu() != id)
|
if ((int)ComboBox->GetMenu() != id)
|
||||||
|
@ -306,10 +306,10 @@ protected:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ComboBox->SetChanged(true);
|
ComboBox->SetChanged(true);
|
||||||
SendMessage(GetParent(),PSM_CHANGED,(WPARAM)m_hWnd,0);
|
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter ++)
|
for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter++)
|
||||||
{
|
{
|
||||||
CModifiedComboBox * ComboBox = cb_iter->second;
|
CModifiedComboBox * ComboBox = cb_iter->second;
|
||||||
if ((int)ComboBox->GetMenu() != id)
|
if ((int)ComboBox->GetMenu() != id)
|
||||||
|
@ -317,19 +317,19 @@ protected:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ComboBox->SetChanged(true);
|
ComboBox->SetChanged(true);
|
||||||
SendMessage(GetParent(),PSM_CHANGED,(WPARAM)m_hWnd,0);
|
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditBoxChanged ( UINT /*Code*/, int id, HWND /*ctl*/ )
|
void EditBoxChanged(UINT /*Code*/, int id, HWND /*ctl*/)
|
||||||
{
|
{
|
||||||
if (m_UpdatingTxt)
|
if (m_UpdatingTxt)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (TextBoxList::iterator eb_iter = m_TxtBoxList.begin(); eb_iter != m_TxtBoxList.end(); eb_iter ++)
|
for (TextBoxList::iterator eb_iter = m_TxtBoxList.begin(); eb_iter != m_TxtBoxList.end(); eb_iter++)
|
||||||
{
|
{
|
||||||
CModifiedEditBox * EditBox = eb_iter->second;
|
CModifiedEditBox * EditBox = eb_iter->second;
|
||||||
if ((int)EditBox->GetMenu() != id)
|
if ((int)EditBox->GetMenu() != id)
|
||||||
|
@ -337,12 +337,12 @@ protected:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
EditBox->SetChanged(true);
|
EditBox->SetChanged(true);
|
||||||
SendMessage(GetParent(),PSM_CHANGED,(WPARAM)m_hWnd,0);
|
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool ResetComboBox ( CModifiedComboBox & ComboBox, SettingID Type )
|
virtual bool ResetComboBox(CModifiedComboBox & ComboBox, SettingID Type)
|
||||||
{
|
{
|
||||||
if (!ComboBox.IsChanged())
|
if (!ComboBox.IsChanged())
|
||||||
{
|
{
|
||||||
|
@ -363,7 +363,7 @@ protected:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool ResetComboBoxTxt ( CModifiedComboBoxTxt & ComboBox, SettingID Type )
|
virtual bool ResetComboBoxTxt(CModifiedComboBoxTxt & ComboBox, SettingID Type)
|
||||||
{
|
{
|
||||||
if (!ComboBox.IsChanged())
|
if (!ComboBox.IsChanged())
|
||||||
{
|
{
|
||||||
|
@ -384,7 +384,7 @@ protected:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void UpdateModComboBox ( CModifiedComboBox & ComboBox, SettingID Type )
|
virtual void UpdateModComboBox(CModifiedComboBox & ComboBox, SettingID Type)
|
||||||
{
|
{
|
||||||
if (ComboBox.IsChanged())
|
if (ComboBox.IsChanged())
|
||||||
{
|
{
|
||||||
|
@ -393,7 +393,7 @@ protected:
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g_Settings->SaveDword(Type,*(DWORD *)ComboBox.GetItemData(index));
|
g_Settings->SaveDword(Type, *(DWORD *)ComboBox.GetItemData(index));
|
||||||
}
|
}
|
||||||
if (ComboBox.IsReset())
|
if (ComboBox.IsReset())
|
||||||
{
|
{
|
||||||
|
@ -402,7 +402,7 @@ protected:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void UpdateModComboBoxTxt ( CModifiedComboBoxTxt & ComboBox, SettingID Type )
|
virtual void UpdateModComboBoxTxt(CModifiedComboBoxTxt & ComboBox, SettingID Type)
|
||||||
{
|
{
|
||||||
if (ComboBox.IsChanged())
|
if (ComboBox.IsChanged())
|
||||||
{
|
{
|
||||||
|
@ -411,7 +411,7 @@ protected:
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g_Settings->SaveString(Type,((stdstr *)ComboBox.GetItemData(index))->c_str());
|
g_Settings->SaveString(Type, ((stdstr *)ComboBox.GetItemData(index))->c_str());
|
||||||
}
|
}
|
||||||
if (ComboBox.IsReset())
|
if (ComboBox.IsReset())
|
||||||
{
|
{
|
||||||
|
@ -420,36 +420,36 @@ protected:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
virtual void ApplyEditBoxes ( void )
|
virtual void ApplyEditBoxes(void)
|
||||||
{
|
{
|
||||||
for (TextBoxList::iterator eb_iter = m_TxtBoxList.begin(); eb_iter != m_TxtBoxList.end(); eb_iter ++)
|
for (TextBoxList::iterator eb_iter = m_TxtBoxList.begin(); eb_iter != m_TxtBoxList.end(); eb_iter++)
|
||||||
{
|
{
|
||||||
CModifiedEditBox * EditBox = eb_iter->second;
|
CModifiedEditBox * EditBox = eb_iter->second;
|
||||||
UpdateModEditBox(*EditBox,eb_iter->first);
|
UpdateModEditBox(*EditBox, eb_iter->first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
virtual void ApplyCheckBoxes ( void )
|
virtual void ApplyCheckBoxes(void)
|
||||||
{
|
{
|
||||||
for (ButtonList::iterator iter = m_ButtonList.begin(); iter != m_ButtonList.end(); iter ++)
|
for (ButtonList::iterator iter = m_ButtonList.begin(); iter != m_ButtonList.end(); iter++)
|
||||||
{
|
{
|
||||||
CModifiedButton * Button = iter->second;
|
CModifiedButton * Button = iter->second;
|
||||||
UpdateModCheckBox(*Button,iter->first);
|
UpdateModCheckBox(*Button, iter->first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
virtual void ApplyComboBoxes ( void )
|
virtual void ApplyComboBoxes(void)
|
||||||
{
|
{
|
||||||
for (ComboBoxTxtList::iterator cbtxt_iter = m_ComboBoxTxtList.begin(); cbtxt_iter != m_ComboBoxTxtList.end(); cbtxt_iter ++)
|
for (ComboBoxTxtList::iterator cbtxt_iter = m_ComboBoxTxtList.begin(); cbtxt_iter != m_ComboBoxTxtList.end(); cbtxt_iter++)
|
||||||
{
|
{
|
||||||
CModifiedComboBoxTxt * ComboBox = cbtxt_iter->second;
|
CModifiedComboBoxTxt * ComboBox = cbtxt_iter->second;
|
||||||
UpdateModComboBoxTxt(*ComboBox,cbtxt_iter->first);
|
UpdateModComboBoxTxt(*ComboBox, cbtxt_iter->first);
|
||||||
}
|
}
|
||||||
for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter ++)
|
for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter++)
|
||||||
{
|
{
|
||||||
CModifiedComboBox * ComboBox = cb_iter->second;
|
CModifiedComboBox * ComboBox = cb_iter->second;
|
||||||
UpdateModComboBox(*ComboBox,cb_iter->first);
|
UpdateModComboBox(*ComboBox, cb_iter->first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void ApplySettings( bool UpdateScreen )
|
void ApplySettings(bool UpdateScreen)
|
||||||
{
|
{
|
||||||
ApplyEditBoxes();
|
ApplyEditBoxes();
|
||||||
ApplyCheckBoxes();
|
ApplyCheckBoxes();
|
||||||
|
@ -461,9 +461,9 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EnableReset ( void )
|
bool EnableReset(void)
|
||||||
{
|
{
|
||||||
for (TextBoxList::iterator eb_iter = m_TxtBoxList.begin(); eb_iter != m_TxtBoxList.end(); eb_iter ++)
|
for (TextBoxList::iterator eb_iter = m_TxtBoxList.begin(); eb_iter != m_TxtBoxList.end(); eb_iter++)
|
||||||
{
|
{
|
||||||
CModifiedEditBox * EditBox = eb_iter->second;
|
CModifiedEditBox * EditBox = eb_iter->second;
|
||||||
if (EditBox->IsChanged())
|
if (EditBox->IsChanged())
|
||||||
|
@ -471,7 +471,7 @@ public:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (ButtonList::iterator iter = m_ButtonList.begin(); iter != m_ButtonList.end(); iter ++)
|
for (ButtonList::iterator iter = m_ButtonList.begin(); iter != m_ButtonList.end(); iter++)
|
||||||
{
|
{
|
||||||
CModifiedButton * Button = iter->second;
|
CModifiedButton * Button = iter->second;
|
||||||
if (Button->IsChanged())
|
if (Button->IsChanged())
|
||||||
|
@ -479,7 +479,7 @@ public:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (ComboBoxTxtList::iterator cbtxt_iter = m_ComboBoxTxtList.begin(); cbtxt_iter != m_ComboBoxTxtList.end(); cbtxt_iter ++)
|
for (ComboBoxTxtList::iterator cbtxt_iter = m_ComboBoxTxtList.begin(); cbtxt_iter != m_ComboBoxTxtList.end(); cbtxt_iter++)
|
||||||
{
|
{
|
||||||
CModifiedComboBoxTxt * ComboBox = cbtxt_iter->second;
|
CModifiedComboBoxTxt * ComboBox = cbtxt_iter->second;
|
||||||
if (ComboBox->IsChanged())
|
if (ComboBox->IsChanged())
|
||||||
|
@ -487,7 +487,7 @@ public:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter ++)
|
for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter++)
|
||||||
{
|
{
|
||||||
CModifiedComboBox * ComboBox = cb_iter->second;
|
CModifiedComboBox * ComboBox = cb_iter->second;
|
||||||
if (ComboBox->IsChanged())
|
if (ComboBox->IsChanged())
|
||||||
|
@ -498,44 +498,44 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResetPage ( void )
|
void ResetPage(void)
|
||||||
{
|
{
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
for (TextBoxList::iterator eb_iter = m_TxtBoxList.begin(); eb_iter != m_TxtBoxList.end(); eb_iter ++)
|
for (TextBoxList::iterator eb_iter = m_TxtBoxList.begin(); eb_iter != m_TxtBoxList.end(); eb_iter++)
|
||||||
{
|
{
|
||||||
CModifiedEditBox * EditBox = eb_iter->second;
|
CModifiedEditBox * EditBox = eb_iter->second;
|
||||||
if (ResetEditBox(*EditBox,eb_iter->first))
|
if (ResetEditBox(*EditBox, eb_iter->first))
|
||||||
{
|
{
|
||||||
Changed = true;
|
Changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (ButtonList::iterator iter = m_ButtonList.begin(); iter != m_ButtonList.end(); iter ++)
|
for (ButtonList::iterator iter = m_ButtonList.begin(); iter != m_ButtonList.end(); iter++)
|
||||||
{
|
{
|
||||||
CModifiedButton * Button = iter->second;
|
CModifiedButton * Button = iter->second;
|
||||||
if (ResetCheckBox(*Button,iter->first))
|
if (ResetCheckBox(*Button, iter->first))
|
||||||
{
|
{
|
||||||
Changed = true;
|
Changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (ComboBoxTxtList::iterator cbtxt_iter = m_ComboBoxTxtList.begin(); cbtxt_iter != m_ComboBoxTxtList.end(); cbtxt_iter ++)
|
for (ComboBoxTxtList::iterator cbtxt_iter = m_ComboBoxTxtList.begin(); cbtxt_iter != m_ComboBoxTxtList.end(); cbtxt_iter++)
|
||||||
{
|
{
|
||||||
CModifiedComboBoxTxt * ComboBox = cbtxt_iter->second;
|
CModifiedComboBoxTxt * ComboBox = cbtxt_iter->second;
|
||||||
if (ResetComboBoxTxt(*ComboBox,cbtxt_iter->first))
|
if (ResetComboBoxTxt(*ComboBox, cbtxt_iter->first))
|
||||||
{
|
{
|
||||||
Changed = true;
|
Changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter ++)
|
for (ComboBoxList::iterator cb_iter = m_ComboBoxList.begin(); cb_iter != m_ComboBoxList.end(); cb_iter++)
|
||||||
{
|
{
|
||||||
CModifiedComboBox * ComboBox = cb_iter->second;
|
CModifiedComboBox * ComboBox = cb_iter->second;
|
||||||
if (ResetComboBox(*ComboBox,cb_iter->first))
|
if (ResetComboBox(*ComboBox, cb_iter->first))
|
||||||
{
|
{
|
||||||
Changed = true;
|
Changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Changed)
|
if (Changed)
|
||||||
{
|
{
|
||||||
SendMessage(GetParent(),PSM_CHANGED,(WPARAM)m_hWnd,0);
|
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
|
@ -546,7 +546,6 @@ protected:
|
||||||
bool m_UpdatingTxt;
|
bool m_UpdatingTxt;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef std::vector<CSettingsPage *> SETTING_PAGES;
|
typedef std::vector<CSettingsPage *> SETTING_PAGES;
|
||||||
|
|
||||||
class CConfigSettingSection
|
class CConfigSettingSection
|
||||||
|
@ -555,13 +554,13 @@ class CConfigSettingSection
|
||||||
std::wstring m_PageTitle;
|
std::wstring m_PageTitle;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CConfigSettingSection ( LPCWSTR PageTitle );
|
CConfigSettingSection(LPCWSTR PageTitle);
|
||||||
~CConfigSettingSection();
|
~CConfigSettingSection();
|
||||||
|
|
||||||
LPCWSTR GetPageTitle ( void ) const { return m_PageTitle.c_str(); }
|
LPCWSTR GetPageTitle(void) const { return m_PageTitle.c_str(); }
|
||||||
void AddPage ( CSettingsPage * Page );
|
void AddPage(CSettingsPage * Page);
|
||||||
size_t GetPageCount ( void ) const { return m_Pages.size(); }
|
size_t GetPageCount(void) const { return m_Pages.size(); }
|
||||||
CSettingsPage * GetPage ( int PageNo );
|
CSettingsPage * GetPage(int PageNo);
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "SettingsPage-AdvancedOptions.h"
|
#include "SettingsPage-AdvancedOptions.h"
|
||||||
|
|
Loading…
Reference in New Issue