MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / InitOptions

Method InitOptions

source/Configuration/PageSlots.cpp:285–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283//
284
285void CPageSlots::InitOptions(HWND hWnd)
286{
287 BOOL enable = FALSE, enableOpt = FALSE;
288
289 SS_CARDTYPE currConfig[NUM_SLOTS];
290 for (int i = SLOT0; i < NUM_SLOTS; i++)
291 currConfig[i] = m_PropertySheetHelper.GetConfigNew().m_Slot[i];
292
293 for (int slot = SLOT0; slot < NUM_SLOTS; slot++)
294 {
295 if (slot == SLOT0 && IsAppleIIe(m_PropertySheetHelper.GetConfigNew().m_Apple2Type))
296 {
297 enable = FALSE;
298 enableOpt = FALSE;
299 }
300 else
301 {
302 GetCardMgr().GetCardChoicesForSlot(slot, currConfig, m_choicesList[slot]);
303 const std::string choices = GetCardNameChoices(m_choicesList[slot]);
304 int currentChoice = CardTypeToComboItem(slot);
305 m_PropertySheetHelper.FillComboBox(hWnd, IDC_SLOT0 + slot, choices.c_str(), currentChoice);
306
307 enable = TRUE;
308 enableOpt = CardTypeHasOptions(m_PropertySheetHelper.GetConfigNew().m_Slot[slot]);
309 }
310
311 EnableWindow(GetDlgItem(hWnd, IDC_SLOT0 + slot), enable);
312 EnableWindow(GetDlgItem(hWnd, IDC_SLOT0_OPTION + slot), enableOpt);
313 }
314
315 if (IsAppleIIe(m_PropertySheetHelper.GetConfigNew().m_Apple2Type))
316 {
317 GetCardMgr().GetCardChoicesForAuxSlot(m_choicesListAux);
318 const std::string choices = GetCardNameChoices(m_choicesListAux);
319 int currentChoice = CardTypeToComboItem(SLOT_AUX);
320 m_PropertySheetHelper.FillComboBox(hWnd, IDC_SLOTAUX, choices.c_str(), currentChoice);
321
322 enable = TRUE;
323 enableOpt = CardTypeHasOptions(m_PropertySheetHelper.GetConfigNew().m_SlotAux);
324 }
325 else
326 {
327 enable = FALSE;
328 enableOpt = FALSE;
329 }
330
331 EnableWindow(GetDlgItem(hWnd, IDC_SLOTAUX), enable);
332 EnableWindow(GetDlgItem(hWnd, IDC_SLOTAUX_OPTION), enableOpt);
333
334 //
335
336 // Find any Uthernet/Uthernet2 card and get its config
337 // NB. Assume we don't have both cards inserted - just use the 1st one we find
338
339 SS_CARDTYPE card = CT_Empty;
340
341 for (int slot = SLOT1; slot < NUM_SLOTS; slot++)
342 {

Callers

nothing calls this directly

Calls 5

IsAppleIIeFunction · 0.85
GetCardChoicesForSlotMethod · 0.80
FillComboBoxMethod · 0.80
QuerySlotMethod · 0.80

Tested by

no test coverage detected