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

Method InitOptions

source/Configuration/PageConfig.cpp:215–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213//
214
215void CPageConfig::InitOptions(HWND hWnd)
216{
217 // Convert Apple2 type to menu item
218 int nCurrentChoice = 0;
219 switch (m_PropertySheetHelper.GetConfigNew().m_Apple2Type)
220 {
221 case A2TYPE_APPLE2: nCurrentChoice = MENUITEM_IIORIGINAL; break;
222 case A2TYPE_APPLE2PLUS: nCurrentChoice = MENUITEM_IIPLUS; break;
223 case A2TYPE_APPLE2JPLUS: nCurrentChoice = MENUITEM_IIJPLUS; break;
224 case A2TYPE_APPLE2E: nCurrentChoice = MENUITEM_IIE; break;
225 case A2TYPE_APPLE2EENHANCED:nCurrentChoice = MENUITEM_ENHANCEDIIE; break;
226 case A2TYPE_PRAVETS82: nCurrentChoice = MENUITEM_CLONE; break;
227 case A2TYPE_PRAVETS8M: nCurrentChoice = MENUITEM_CLONE; break;
228 case A2TYPE_PRAVETS8A: nCurrentChoice = MENUITEM_CLONE; break;
229 case A2TYPE_TK30002E: nCurrentChoice = MENUITEM_CLONE; break;
230 case A2TYPE_BASE64A: nCurrentChoice = MENUITEM_CLONE; break;
231 default: _ASSERT(0); break;
232 }
233
234 m_PropertySheetHelper.FillComboBox(hWnd, IDC_COMPUTER, m_ComputerChoices, nCurrentChoice);
235
236 CheckDlgButton(hWnd, IDC_CHECK_CONFIRM_REBOOT, m_PropertySheetHelper.GetConfigNew().m_confirmReboot ? BST_CHECKED : BST_UNCHECKED);
237
238 // Master Volume
239
240 SendDlgItemMessage(hWnd, IDC_SLIDER_MASTER_VOLUME, TBM_SETRANGE, TRUE, MAKELONG(VOLUME_MIN, VOLUME_MAX));
241 SendDlgItemMessage(hWnd, IDC_SLIDER_MASTER_VOLUME, TBM_SETPAGESIZE, 0, 10);
242 SendDlgItemMessage(hWnd, IDC_SLIDER_MASTER_VOLUME, TBM_SETTICFREQ, 10, 0);
243 SendDlgItemMessage(hWnd, IDC_SLIDER_MASTER_VOLUME, TBM_SETPOS, TRUE, VOLUME_MAX - m_PropertySheetHelper.GetConfigNew().m_masterVolume); // Invert: L=MIN, R=MAX
244
245 // Video
246
247 m_PropertySheetHelper.FillComboBox(hWnd, IDC_VIDEOTYPE, GetVideo().GetVideoChoices(), m_PropertySheetHelper.GetConfigNew().m_videoType);
248 const VideoStyle_e style = m_PropertySheetHelper.GetConfigNew().m_videoStyle;
249 CheckDlgButton(hWnd, IDC_CHECK_HALF_SCAN_LINES, GetVideo().IsVideoStyle(style, VS_HALF_SCANLINES) ? BST_CHECKED : BST_UNCHECKED);
250 CheckDlgButton(hWnd, IDC_CHECK_VERTICAL_BLEND, GetVideo().IsVideoStyle(style, VS_COLOR_VERTICAL_BLEND) ? BST_CHECKED : BST_UNCHECKED);
251 EnableWindow(GetDlgItem(hWnd, IDC_CHECK_VERTICAL_BLEND), (m_PropertySheetHelper.GetConfigNew().m_videoType == VT_COLOR_IDEALIZED) ? TRUE : FALSE);
252 CheckDlgButton(hWnd, IDC_CHECK_50HZ_VIDEO, (m_PropertySheetHelper.GetConfigNew().m_videoRefreshRate == VR_50HZ) ? BST_CHECKED : BST_UNCHECKED);
253
254 CheckDlgButton(hWnd, IDC_CHECK_FS_SHOW_SUBUNIT_STATUS, m_PropertySheetHelper.GetConfigNew().m_fullScreen_ShowSubunitStatus ? BST_CHECKED : BST_UNCHECKED);
255
256 // Emulation Speed
257
258 CheckDlgButton(hWnd, IDC_ENHANCE_DISK_ENABLE, m_PropertySheetHelper.GetConfigNew().m_enhanceDiskAccessSpeed ? BST_CHECKED : BST_UNCHECKED);
259 CheckDlgButton(hWnd, IDC_SCROLLLOCK_TOGGLE, m_PropertySheetHelper.GetConfigNew().m_scrollLockToggle ? BST_CHECKED : BST_UNCHECKED);
260
261 SendDlgItemMessage(hWnd, IDC_SLIDER_CPU_SPEED, TBM_SETRANGE, TRUE, MAKELONG(0, 40));
262 SendDlgItemMessage(hWnd, IDC_SLIDER_CPU_SPEED, TBM_SETPAGESIZE, 0, 5);
263 SendDlgItemMessage(hWnd, IDC_SLIDER_CPU_SPEED, TBM_SETTICFREQ, 10, 0);
264 SendDlgItemMessage(hWnd, IDC_SLIDER_CPU_SPEED, TBM_SETPOS, TRUE, m_PropertySheetHelper.GetConfigNew().m_machineSpeed);
265
266 BOOL bCustom = m_PropertySheetHelper.GetConfigNew().m_machineSpeed != SPEED_NORMAL ? TRUE : FALSE;
267 CheckRadioButton(hWnd, IDC_AUTHENTIC_SPEED, IDC_CUSTOM_SPEED, bCustom ? IDC_CUSTOM_SPEED : IDC_AUTHENTIC_SPEED);
268 SetFocus(GetDlgItem(hWnd, bCustom ? IDC_SLIDER_CPU_SPEED : IDC_AUTHENTIC_SPEED));
269 EnableTrackbar(hWnd, bCustom);
270}
271
272void CPageConfig::DlgOK(HWND hWnd)

Callers

nothing calls this directly

Calls 3

FillComboBoxMethod · 0.80
GetVideoChoicesMethod · 0.80
IsVideoStyleMethod · 0.80

Tested by

no test coverage detected