OSDN Git Service

Fix a bug where the choice of the default setting for an application
[xkeymacs/xkeymacs.git] / xkeymacs / data.cpp
1 #include "stdafx.h"\r
2 #include "data.h"\r
3 \r
4 CData::CData()\r
5 {\r
6         ClearAll();\r
7 }\r
8 \r
9 CData::~CData()\r
10 {\r
11 }\r
12 \r
13 void CData::SetWindowText(LPCTSTR lpszWindowText)\r
14 {\r
15         m_nWindowTextType = CUtils::GetWindowTextType(lpszWindowText);\r
16         if (m_nWindowTextType == IDS_WINDOW_TEXT_IGNORE) {\r
17                 m_strWindowText = _T('*');\r
18         } else {\r
19                 m_strWindowText.Format(lpszWindowText);\r
20         }\r
21 }\r
22 \r
23 CString CData::GetWindowText()\r
24 {\r
25         return m_strWindowText;\r
26 }\r
27 \r
28 void CData::SetWindowTextType(int nWindowTextType)\r
29 {\r
30         m_nWindowTextType = nWindowTextType;\r
31 }\r
32 \r
33 int CData::GetWindowTextType()\r
34 {\r
35         return m_nWindowTextType;\r
36 }\r
37 \r
38 void CData::SetApplicationName(LPCTSTR lpszApplicationName)\r
39 {\r
40         m_strApplicationName.Format(lpszApplicationName);\r
41 }\r
42 \r
43 CString CData::GetApplicationName()\r
44 {\r
45         return m_strApplicationName;\r
46 }\r
47 \r
48 void CData::SetCommandID(int nCommandType, int nKey, int nCommandID)\r
49 {\r
50         ASSERT(nCommandType >= 0 || nCommandType < MAX_COMMAND_TYPE);\r
51         ASSERT(nKey <= 0 || nKey < MAX_KEY);\r
52         m_nCommandID[nCommandType][nKey] = nCommandID;\r
53 }\r
54 \r
55 int CData::GetCommandID(int nCommandType, int nKey)\r
56 {\r
57         ASSERT(nCommandType >= 0 || nCommandType < MAX_COMMAND_TYPE);\r
58         ASSERT(nKey <= 0 || nKey < MAX_KEY);\r
59         return m_nCommandID[nCommandType][nKey];\r
60 }\r
61 \r
62 void CData::ClearAll()\r
63 {\r
64         ZeroMemory(m_nCommandID, sizeof(m_nCommandID));\r
65         ZeroMemory(m_bAtIbeamCursorOnly, sizeof(m_bAtIbeamCursorOnly));\r
66         m_strApplicationName.Empty();\r
67 }\r
68 \r
69 void CData::SetApplicationTitle(LPCTSTR lpszApplicationTitle)\r
70 {\r
71         m_strApplicationTitle.Format(lpszApplicationTitle);\r
72         // delete white space at the end of the application title.\r
73         while (!m_strApplicationTitle.IsEmpty() &&\r
74                         _istspace(m_strApplicationTitle.GetAt(m_strApplicationTitle.GetLength() - 1)))\r
75                 m_strApplicationTitle.Delete(m_strApplicationTitle.GetLength() - 1);\r
76 }\r
77 \r
78 CString CData::GetApplicationTitle()\r
79 {\r
80         return m_strApplicationTitle;\r
81 }\r
82 \r
83 void CData::SetKillRingMax(int nKillRingMax)\r
84 {\r
85         m_nKillRingMax = nKillRingMax;\r
86 }\r
87 \r
88 int CData::GetKillRingMax()\r
89 {\r
90         return m_nKillRingMax;\r
91 }\r
92 \r
93 int CData::GetSettingStyle()\r
94 {\r
95         return m_nSettingStyle;\r
96 }\r
97 \r
98 void CData::SetSettingStyle(int nSettingStyle)\r
99 {\r
100         m_nSettingStyle = nSettingStyle;\r
101 }\r
102 \r
103 void CData::SetIgnoreUndefinedMetaCtrl(BOOL bIgnoreUndefinedMetaCtrl)\r
104 {\r
105         m_bIgnoreUndefinedMetaCtrl = bIgnoreUndefinedMetaCtrl;\r
106 }\r
107 \r
108 BOOL CData::GetIgnoreUndefinedMetaCtrl()\r
109 {\r
110         return m_bIgnoreUndefinedMetaCtrl;\r
111 }\r
112 \r
113 void CData::SetIgnoreUndefinedC_x(BOOL bIgnoreUndefinedC_x)\r
114 {\r
115         m_bIgnoreUndefinedC_x = bIgnoreUndefinedC_x;\r
116 }\r
117 \r
118 BOOL CData::GetIgnoreUndefinedC_x()\r
119 {\r
120         return m_bIgnoreUndefinedC_x;\r
121 }\r
122 \r
123 void CData::SetEnableCUA(BOOL bEnableCUA)\r
124 {\r
125         m_bEnableCUA = bEnableCUA;\r
126 }\r
127 \r
128 BOOL CData::GetEnableCUA()\r
129 {\r
130         return m_bEnableCUA;\r
131 }\r
132 \r
133 void CData::SetUseDialogSetting(BOOL bUseDialogSetting)\r
134 {\r
135         m_bUseDialogSetting = bUseDialogSetting;\r
136 }\r
137 \r
138 BOOL CData::GetUseDialogSetting()\r
139 {\r
140         return m_bUseDialogSetting;\r
141 }\r
142 \r
143 BOOL CData::Get326Compatible()\r
144 {\r
145         return m_b326Compatible;\r
146 }\r
147 \r
148 void CData::Set326Compatible(BOOL b326Compatible)\r
149 {\r
150         m_b326Compatible = b326Compatible;\r
151 }\r