2012-03-27 21:20:36 +00:00
|
|
|
/*
|
|
|
|
AppleWin : An Apple //e emulator for Windows
|
|
|
|
|
|
|
|
Copyright (C) 1994-1996, Michael O'Brien
|
|
|
|
Copyright (C) 1999-2001, Oliver Schmidt
|
|
|
|
Copyright (C) 2002-2005, Tom Charlesworth
|
2012-05-06 22:14:03 +00:00
|
|
|
Copyright (C) 2006-2012, Tom Charlesworth, Michael Pohoreski
|
2012-03-27 21:20:36 +00:00
|
|
|
|
|
|
|
AppleWin is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
AppleWin is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with AppleWin; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Description: Property Sheet Pages
|
|
|
|
*
|
|
|
|
* Author: Tom Charlesworth
|
|
|
|
* Spiro Trikaliotis <Spiro.Trikaliotis@gmx.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "StdAfx.h"
|
2014-08-13 20:30:35 +00:00
|
|
|
|
2020-11-11 21:15:27 +00:00
|
|
|
#include "PropertySheet.h"
|
|
|
|
|
2020-12-20 15:32:51 +00:00
|
|
|
#include "../Interface.h"
|
2020-11-26 21:50:06 +00:00
|
|
|
#include "../Windows/AppleWin.h"
|
2018-02-24 15:12:40 +00:00
|
|
|
#include "../resource/resource.h"
|
2012-03-27 21:20:36 +00:00
|
|
|
|
|
|
|
void CPropertySheet::Init(void)
|
|
|
|
{
|
|
|
|
PROPSHEETPAGE PropSheetPages[PG_NUM_SHEETS];
|
|
|
|
|
|
|
|
PropSheetPages[PG_CONFIG].dwSize = sizeof(PROPSHEETPAGE);
|
|
|
|
PropSheetPages[PG_CONFIG].dwFlags = PSP_DEFAULT;
|
2020-12-24 15:08:50 +00:00
|
|
|
PropSheetPages[PG_CONFIG].hInstance = GetFrame().g_hInstance;
|
2012-03-27 21:20:36 +00:00
|
|
|
PropSheetPages[PG_CONFIG].pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_CONFIG);
|
2021-01-01 12:57:40 +00:00
|
|
|
PropSheetPages[PG_CONFIG].pfnDlgProc = CPageConfig::DlgProc;
|
2012-03-27 21:20:36 +00:00
|
|
|
|
|
|
|
PropSheetPages[PG_INPUT].dwSize = sizeof(PROPSHEETPAGE);
|
|
|
|
PropSheetPages[PG_INPUT].dwFlags = PSP_DEFAULT;
|
2020-12-24 15:08:50 +00:00
|
|
|
PropSheetPages[PG_INPUT].hInstance = GetFrame().g_hInstance;
|
2012-03-27 21:20:36 +00:00
|
|
|
PropSheetPages[PG_INPUT].pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_INPUT);
|
2021-01-01 12:57:40 +00:00
|
|
|
PropSheetPages[PG_INPUT].pfnDlgProc = CPageInput::DlgProc;
|
2012-03-27 21:20:36 +00:00
|
|
|
|
|
|
|
PropSheetPages[PG_SOUND].dwSize = sizeof(PROPSHEETPAGE);
|
|
|
|
PropSheetPages[PG_SOUND].dwFlags = PSP_DEFAULT;
|
2020-12-24 15:08:50 +00:00
|
|
|
PropSheetPages[PG_SOUND].hInstance = GetFrame().g_hInstance;
|
2012-03-27 21:20:36 +00:00
|
|
|
PropSheetPages[PG_SOUND].pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_SOUND);
|
2021-01-01 12:57:40 +00:00
|
|
|
PropSheetPages[PG_SOUND].pfnDlgProc = CPageSound::DlgProc;
|
2012-03-27 21:20:36 +00:00
|
|
|
|
|
|
|
PropSheetPages[PG_DISK].dwSize = sizeof(PROPSHEETPAGE);
|
|
|
|
PropSheetPages[PG_DISK].dwFlags = PSP_DEFAULT;
|
2020-12-24 15:08:50 +00:00
|
|
|
PropSheetPages[PG_DISK].hInstance = GetFrame().g_hInstance;
|
2012-03-27 21:20:36 +00:00
|
|
|
PropSheetPages[PG_DISK].pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_DISK);
|
2021-01-01 12:57:40 +00:00
|
|
|
PropSheetPages[PG_DISK].pfnDlgProc = CPageDisk::DlgProc;
|
2012-03-27 21:20:36 +00:00
|
|
|
|
|
|
|
PropSheetPages[PG_ADVANCED].dwSize = sizeof(PROPSHEETPAGE);
|
|
|
|
PropSheetPages[PG_ADVANCED].dwFlags = PSP_DEFAULT;
|
2020-12-24 15:08:50 +00:00
|
|
|
PropSheetPages[PG_ADVANCED].hInstance = GetFrame().g_hInstance;
|
2012-03-27 21:20:36 +00:00
|
|
|
PropSheetPages[PG_ADVANCED].pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_ADVANCED);
|
2021-01-01 12:57:40 +00:00
|
|
|
PropSheetPages[PG_ADVANCED].pfnDlgProc = CPageAdvanced::DlgProc;
|
2012-03-27 21:20:36 +00:00
|
|
|
|
|
|
|
PROPSHEETHEADER PropSheetHeader;
|
|
|
|
|
|
|
|
PropSheetHeader.dwSize = sizeof(PROPSHEETHEADER);
|
|
|
|
PropSheetHeader.dwFlags = PSH_NOAPPLYNOW | /* PSH_NOCONTEXTHELP | */ PSH_PROPSHEETPAGE;
|
2020-12-24 15:08:50 +00:00
|
|
|
PropSheetHeader.hwndParent = GetFrame().g_hFrameWindow;
|
2012-03-27 21:20:36 +00:00
|
|
|
PropSheetHeader.pszCaption = "AppleWin Configuration";
|
|
|
|
PropSheetHeader.nPages = PG_NUM_SHEETS;
|
2012-05-06 22:14:03 +00:00
|
|
|
PropSheetHeader.nStartPage = m_PropertySheetHelper.GetLastPage();
|
2012-03-27 21:20:36 +00:00
|
|
|
PropSheetHeader.ppsp = PropSheetPages;
|
|
|
|
|
2012-05-06 22:14:03 +00:00
|
|
|
m_PropertySheetHelper.ResetPageMask();
|
|
|
|
m_PropertySheetHelper.SaveCurrentConfig();
|
|
|
|
|
|
|
|
INT_PTR nRes = PropertySheet(&PropSheetHeader); // Result: 0=Cancel, 1=OK
|
2012-03-27 21:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DWORD CPropertySheet::GetVolumeMax()
|
|
|
|
{
|
2012-05-06 22:14:03 +00:00
|
|
|
return m_PageSound.GetVolumeMax();
|
2012-03-27 21:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Called when F11/F12 is pressed
|
|
|
|
bool CPropertySheet::SaveStateSelectImage(HWND hWindow, bool bSave)
|
|
|
|
{
|
2012-05-06 22:14:03 +00:00
|
|
|
if(m_PropertySheetHelper.SaveStateSelectImage(hWindow, bSave ? TEXT("Select Save State file")
|
2012-03-27 21:20:36 +00:00
|
|
|
: TEXT("Select Load State file"), bSave))
|
|
|
|
{
|
2012-05-06 22:14:03 +00:00
|
|
|
m_PropertySheetHelper.SaveStateUpdate();
|
2012-03-27 21:20:36 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return false; // Cancelled
|
|
|
|
}
|
|
|
|
}
|