[Project] Fix up showing/hiding advanced tab

This commit is contained in:
zilmar 2019-01-13 09:21:10 +11:00
parent c9f1f00f77
commit 05ae250a01
2 changed files with 19 additions and 19 deletions

View File

@ -52,29 +52,29 @@ void CSettingConfig::UpdateAdvanced(bool AdvancedMode)
BoldChangedPages(m_PagesTreeList.GetRootItem());
}
bool CSettingConfig::UpdateAdvanced(bool AdvancedMode, HTREEITEM hItem)
void CSettingConfig::UpdateAdvanced(bool AdvancedMode, HTREEITEM hItem)
{
while (hItem)
{
CSettingsPage * Page = (CSettingsPage *)m_PagesTreeList.GetItemData(hItem);
if (!AdvancedMode && (Page == m_AdvancedPage || Page == m_DefaultsPage))
{
m_PagesTreeList.DeleteItem(hItem);
return true;
HTREEITEM hPage = hItem;
hItem = m_PagesTreeList.GetNextSiblingItem(hItem);
m_PagesTreeList.DeleteItem(hPage);
}
if (AdvancedMode && Page == m_GeneralOptionsPage)
else if (AdvancedMode && Page == m_GeneralOptionsPage)
{
m_PagesTreeList.InsertItemW(TVIF_TEXT | TVIF_PARAM, wGS(m_AdvancedPage->PageTitle()).c_str(), 0, 0, 0, 0, (ULONG)m_AdvancedPage, hItem, TVI_FIRST);
m_PagesTreeList.InsertItemW(TVIF_TEXT | TVIF_PARAM, wGS(m_DefaultsPage->PageTitle()).c_str(), 0, 0, 0, 0, (ULONG)m_DefaultsPage, hItem, TVI_FIRST);
return true;
break;
}
if (UpdateAdvanced(AdvancedMode, m_PagesTreeList.GetChildItem(hItem)))
{
return true;
}
hItem = m_PagesTreeList.GetNextSiblingItem(hItem);
else
{
UpdateAdvanced(AdvancedMode, m_PagesTreeList.GetChildItem(hItem));
hItem = m_PagesTreeList.GetNextSiblingItem(hItem);
}
}
return false;
}
LRESULT CSettingConfig::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)

View File

@ -16,15 +16,15 @@ public:
NOTIFY_HANDLER_EX(IDC_PAGELIST, NM_CLICK, OnPageListClicked)
MESSAGE_HANDLER_EX(PSM_CHANGED, OnSettingPageChanged)
REFLECT_NOTIFICATIONS()
END_MSG_MAP()
END_MSG_MAP()
enum { IDD = IDD_Settings_Config };
enum { IDD = IDD_Settings_Config };
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND /*hWndCtl*/, BOOL& bHandled);
LRESULT OnPageListItemChanged(NMHDR* phdr);
LRESULT OnPageListClicked(NMHDR* phdr);
LRESULT OnSettingPageChanged(UINT /*uMsg*/, WPARAM wPage, LPARAM /*lParam*/);
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND /*hWndCtl*/, BOOL& bHandled);
LRESULT OnPageListItemChanged(NMHDR* phdr);
LRESULT OnPageListClicked(NMHDR* phdr);
LRESULT OnSettingPageChanged(UINT /*uMsg*/, WPARAM wPage, LPARAM /*lParam*/);
public:
CSettingConfig(bool bJustGameSetting = false);
@ -34,7 +34,7 @@ public:
void UpdateAdvanced(bool AdvancedMode);
private:
bool UpdateAdvanced(bool AdvancedMode, HTREEITEM hItem);
void UpdateAdvanced(bool AdvancedMode, HTREEITEM hItem);
void ApplySettings(bool UpdateScreen);
void BoldChangedPages(HTREEITEM hItem);