| 214 | } |
| 215 | |
| 216 | void CSuperComboBox::LoadState(LPCTSTR szRegSubKey) |
| 217 | { |
| 218 | ResetContent(); |
| 219 | |
| 220 | int cnt = AfxGetApp()->GetProfileInt(szRegSubKey, _T("Count"), 0); |
| 221 | int idx = 0; |
| 222 | for (int i=0; i < cnt && idx < m_nMaxItems; i++) |
| 223 | { |
| 224 | CString s,s2; |
| 225 | s2.Format(_T("Item_%d"), i); |
| 226 | s = AfxGetApp()->GetProfileString(szRegSubKey, s2); |
| 227 | if (FindStringExact(-1, s) == CB_ERR && !s.IsEmpty()) |
| 228 | { |
| 229 | AddString(s); |
| 230 | idx++; |
| 231 | } |
| 232 | } |
| 233 | if (idx > 0) |
| 234 | { |
| 235 | bool bIsEmpty = (m_bCanBeEmpty ? (AfxGetApp()->GetProfileInt(szRegSubKey, _T("Empty"), FALSE) == TRUE) : false); |
| 236 | if (bIsEmpty) |
| 237 | { |
| 238 | SetCurSel(-1); |
| 239 | } |
| 240 | else |
| 241 | { |
| 242 | SetCurSel(0); |
| 243 | if (m_bExtendedFileNames) |
| 244 | GetEditCtrl()->SetWindowText(m_sFullStateText[0]); |
| 245 | } |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | void CSuperComboBox::GetLBText(int nIndex, CString &rString) const |
| 250 | { |
nothing calls this directly
no test coverage detected