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

Method ProcessDiskPopupMenu

source/Windows/WinFrame.cpp:2154–2708  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2152// http://www.codeproject.com/menu/MenusForBeginners.asp?df=100&forumid=67645&exp=0&select=903061
2153
2154void Win32Frame::ProcessDiskPopupMenu(HWND hwnd, POINT pt, const int iDrive)
2155{
2156 if (GetCardMgr().QuerySlot(SLOT6) != CT_Disk2)
2157 return;
2158
2159 SoundCore_SetFade(FADE_OUT);
2160
2161 Disk2InterfaceCard& disk2Card = dynamic_cast<Disk2InterfaceCard&>(GetCardMgr().GetRef(SLOT6));
2162
2163 // This is the default installation path of CiderPress.
2164 // It shall not be left blank, otherwise an explorer window will be open.
2165 char PathToCiderPress[MAX_PATH];
2166 RegLoadString(
2167 "Configuration",
2168 REGVALUE_CIDERPRESSLOC,
2169 1,
2170 PathToCiderPress,
2171 MAX_PATH,
2172 "C:\\Program Files\\faddenSoft\\CiderPress\\CiderPress.exe");
2173 //TODO: A directory is open if an empty path to CiderPress is set. This has to be fixed.
2174
2175 static uint32_t bNewDiskCopyBASIC = true;
2176 static uint32_t bNewDiskCopyBitsyBoot = true;
2177 static uint32_t bNewDiskCopyBitsyBye = true;
2178 static uint32_t bNewDiskCopyProDOS = true;
2179
2180 const char REG_KEY_DISK_PREFRENCES[] = "Preferences"; // NOTE: Keep in sync with REG_KEY_DISK_PREFRENCES and UtilPopup_Toggle
2181
2182 RegLoadValue( REG_KEY_DISK_PREFRENCES, REGVALUE_PREF_NEW_DISK_COPY_BASIC , TRUE, &bNewDiskCopyBASIC );
2183 RegLoadValue( REG_KEY_DISK_PREFRENCES, REGVALUE_PREF_NEW_DISK_COPY_BITSY_BOOT, TRUE, &bNewDiskCopyBitsyBoot );
2184 RegLoadValue( REG_KEY_DISK_PREFRENCES, REGVALUE_PREF_NEW_DISK_COPY_BITSY_BYE , TRUE, &bNewDiskCopyBitsyBye );
2185 RegLoadValue( REG_KEY_DISK_PREFRENCES, REGVALUE_PREF_NEW_DISK_COPY_PRODOS_SYS, TRUE, &bNewDiskCopyProDOS );
2186
2187 class UtilPopup_Toggle
2188 {
2189 public:
2190 UtilPopup_Toggle( HMENU hMenu, int iCommand, const char *pKey, uint32_t *pVal )
2191 {
2192 *pVal = ! *pVal;
2193 int bChecked = *pVal ? MF_CHECKED : MF_UNCHECKED;
2194 CheckMenuItem(hMenu,iCommand, bChecked);
2195
2196 RegSaveValue(
2197 "Preferences", // NOTE: Keep in sync with REG_KEY_DISK_PREFRENCES and UtilPopup_Toggle
2198 pKey,
2199 TRUE,
2200 *pVal
2201 );
2202 }
2203 };
2204
2205 class UtilPopup_CheckMenu
2206 {
2207 public:
2208 UtilPopup_CheckMenu( HMENU hMenu, int iMenuItem, uint32_t bIsChecked )
2209 {
2210 if (bIsChecked)
2211 {

Callers

nothing calls this directly

Calls 15

SoundCore_SetFadeFunction · 0.85
RegLoadStringFunction · 0.85
RegLoadValueFunction · 0.85
UtilPopup_CheckMenuClass · 0.85
KeybGetShiftStatusFunction · 0.85
FileExistsFunction · 0.85
StrFormatFunction · 0.85
Util_SelectDiskImageFunction · 0.85
New_DOSProDOS_DiskFunction · 0.85
New_Blank_DiskFunction · 0.85
Format_ProDOS_DiskFunction · 0.85
Format_DOS33_DiskFunction · 0.85

Tested by

no test coverage detected