blob: cd30f08594b981bcae1ef1aa74da1e1c05409e07 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
/*
* AdvancedConfigDlg.h
* -------------------
* Purpose: Implementation of the advanced settings dialog.
* Notes : (currently none)
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#pragma once
#include "openmpt/all/BuildSettings.hpp"
#include "CListCtrl.h"
#if MPT_USTRING_MODE_WIDE
#include <unordered_map>
#else
#include <map>
#endif
OPENMPT_NAMESPACE_BEGIN
#ifdef MPT_MFC_FULL
class CAdvancedSettingsList : public CMFCListCtrlEx
{
private:
std::vector<SettingPath> & m_indexToPath;
public:
CAdvancedSettingsList(std::vector<SettingPath> & indexToPath) : m_indexToPath(indexToPath) {}
COLORREF OnGetCellBkColor(int nRow, int nColumn) override;
COLORREF OnGetCellTextColor(int nRow, int nColumn) override;
};
#endif // MPT_MFC_FULL
class COptionsAdvanced: public CPropertyPage
{
#ifdef MPT_MFC_FULL
using ListCtrl = CAdvancedSettingsList;
#else // MPT_MFC_FULL
using ListCtrl = CListCtrlEx;
#endif // !MPT_MFC_FULL
protected:
ListCtrl m_List;
#if MPT_USTRING_MODE_WIDE
using GroupMap = std::unordered_map<mpt::ustring, int>;
#else
using GroupMap = std::map<mpt::ustring, int>;
#endif
std::vector<SettingPath> m_indexToPath;
GroupMap m_groups;
bool m_listGrouped = false;
public:
#ifdef MPT_MFC_FULL
COptionsAdvanced():CPropertyPage(IDD_OPTIONS_ADVANCED), m_List(m_indexToPath) {}
#else // !MPT_MFC_FULL
COptionsAdvanced():CPropertyPage(IDD_OPTIONS_ADVANCED) {}
#endif // MPT_MFC_FULL
protected:
BOOL OnInitDialog() override;
void OnOK() override;
BOOL OnSetActive() override;
void DoDataExchange(CDataExchange* pDX) override;
BOOL PreTranslateMessage(MSG *msg) override;
afx_msg void OnOptionDblClick(NMHDR *, LRESULT *);
afx_msg void OnSettingsChanged() { SetModified(TRUE); }
afx_msg void OnFindStringChanged() { ReInit(); }
afx_msg void OnSaveNow();
#ifndef MPT_MFC_FULL
afx_msg void OnCustomDrawList(NMHDR* pNMHDR, LRESULT* pResult);
#endif // !MPT_MFC_FULL
void ReInit();
DECLARE_MESSAGE_MAP();
};
OPENMPT_NAMESPACE_END
|