2014-11-04 00:26:53 +00:00
|
|
|
/*
|
|
|
|
* CiderPress
|
|
|
|
* Copyright (C) 2007, 2008 by faddenSoft, LLC. All Rights Reserved.
|
|
|
|
* See the file LICENSE for distribution terms.
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* Classes to support the Preferences property pages.
|
|
|
|
*/
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
#ifndef APP_PREFSDIALOG_H
|
|
|
|
#define APP_PREFSDIALOG_H
|
2014-11-04 00:26:53 +00:00
|
|
|
|
|
|
|
#include "Preferences.h"
|
|
|
|
#include "../util/UtilLib.h"
|
|
|
|
#include "resource.h"
|
2014-12-09 22:10:52 +00:00
|
|
|
#include "HelpTopics.h"
|
2014-11-04 00:26:53 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The "general" page, which controls how we display information to the user.
|
|
|
|
*/
|
|
|
|
class PrefsGeneralPage : public CPropertyPage
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
PrefsGeneralPage(void) :
|
|
|
|
CPropertyPage(IDD_PREF_GENERAL),
|
|
|
|
fReady(false),
|
2021-04-24 20:43:04 +00:00
|
|
|
fColumn(),
|
2014-11-04 00:26:53 +00:00
|
|
|
fMimicShrinkIt(FALSE),
|
|
|
|
fBadMacSHK(FALSE),
|
|
|
|
fReduceSHKErrorChecks(FALSE),
|
|
|
|
fCoerceDOSFilenames(FALSE),
|
|
|
|
fSpacesToUnder(FALSE),
|
2021-04-24 20:43:04 +00:00
|
|
|
fPasteJunkPaths(FALSE),
|
|
|
|
fBeepOnSuccess(FALSE),
|
2014-11-04 00:26:53 +00:00
|
|
|
fDefaultsPushed(FALSE),
|
2014-11-18 05:13:13 +00:00
|
|
|
fOurAssociations(NULL)
|
2014-11-04 00:26:53 +00:00
|
|
|
{}
|
|
|
|
virtual ~PrefsGeneralPage(void) {
|
|
|
|
delete[] fOurAssociations;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool fReady;
|
|
|
|
|
|
|
|
// fields on this page
|
|
|
|
BOOL fColumn[kNumVisibleColumns];
|
|
|
|
BOOL fMimicShrinkIt;
|
|
|
|
BOOL fBadMacSHK;
|
|
|
|
BOOL fReduceSHKErrorChecks;
|
|
|
|
BOOL fCoerceDOSFilenames;
|
|
|
|
BOOL fSpacesToUnder;
|
|
|
|
BOOL fPasteJunkPaths;
|
|
|
|
BOOL fBeepOnSuccess;
|
|
|
|
BOOL fDefaultsPushed;
|
|
|
|
|
|
|
|
// initialized if we opened the file associations edit page
|
|
|
|
bool* fOurAssociations;
|
|
|
|
|
|
|
|
protected:
|
2014-11-21 21:18:20 +00:00
|
|
|
virtual void DoDataExchange(CDataExchange* pDX) override;
|
2014-11-04 00:26:53 +00:00
|
|
|
|
|
|
|
afx_msg void OnChange(void);
|
|
|
|
afx_msg void OnChangeRange(UINT);
|
|
|
|
afx_msg void OnDefaults(void);
|
2014-12-11 21:53:02 +00:00
|
|
|
#ifdef CAN_UPDATE_FILE_ASSOC
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnAssociations(void);
|
2014-12-11 21:53:02 +00:00
|
|
|
#endif
|
2014-12-09 22:10:52 +00:00
|
|
|
afx_msg LONG OnHelpInfo(UINT wParam, LONG lParam) {
|
|
|
|
return MyApp::HandleHelpInfo((HELPINFO*) lParam);
|
|
|
|
}
|
|
|
|
afx_msg LONG OnCommandHelp(UINT wParam, LONG lParam) {
|
|
|
|
MyApp::HandleHelp(this, HELP_TOPIC_PREFS_GENERAL);
|
|
|
|
return TRUE;
|
|
|
|
}
|
2014-11-04 00:26:53 +00:00
|
|
|
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The "disk image" page, for selecting disk image preferences.
|
|
|
|
*/
|
|
|
|
class PrefsDiskImagePage : public CPropertyPage
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
PrefsDiskImagePage(void) :
|
|
|
|
CPropertyPage(IDD_PREF_DISKIMAGE),
|
|
|
|
fReady(false),
|
|
|
|
fQueryImageFormat(FALSE),
|
|
|
|
fOpenVolumeRO(FALSE),
|
2021-04-24 20:43:04 +00:00
|
|
|
fOpenVolumePhys0(FALSE),
|
2014-11-04 00:26:53 +00:00
|
|
|
fProDOSAllowLower(FALSE),
|
|
|
|
fProDOSUseSparse(FALSE)
|
|
|
|
{}
|
|
|
|
|
|
|
|
bool fReady;
|
|
|
|
|
|
|
|
BOOL fQueryImageFormat;
|
|
|
|
BOOL fOpenVolumeRO;
|
|
|
|
BOOL fOpenVolumePhys0;
|
|
|
|
BOOL fProDOSAllowLower;
|
|
|
|
BOOL fProDOSUseSparse;
|
|
|
|
|
|
|
|
protected:
|
2014-11-21 21:18:20 +00:00
|
|
|
virtual BOOL OnInitDialog(void) override;
|
|
|
|
virtual void DoDataExchange(CDataExchange* pDX) override;
|
2014-11-04 00:26:53 +00:00
|
|
|
|
|
|
|
afx_msg void OnChange(void);
|
|
|
|
//afx_msg void OnChangeRange(UINT);
|
2014-12-09 22:10:52 +00:00
|
|
|
afx_msg LONG OnHelpInfo(UINT wParam, LONG lParam) {
|
|
|
|
return MyApp::HandleHelpInfo((HELPINFO*) lParam);
|
|
|
|
}
|
|
|
|
afx_msg LONG OnCommandHelp(UINT wParam, LONG lParam) {
|
|
|
|
MyApp::HandleHelp(this, HELP_TOPIC_PREFS_DISK_IMAGE);
|
|
|
|
return TRUE;
|
|
|
|
}
|
2014-11-04 00:26:53 +00:00
|
|
|
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The "compression" page, which lets the user choose a default compression
|
|
|
|
* method.
|
|
|
|
*/
|
|
|
|
class PrefsCompressionPage : public CPropertyPage
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
PrefsCompressionPage(void) :
|
2021-04-24 20:43:04 +00:00
|
|
|
CPropertyPage(IDD_PREF_COMPRESSION),
|
|
|
|
fReady(false),
|
|
|
|
fCompressType(-1)
|
2014-11-04 00:26:53 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
bool fReady;
|
|
|
|
|
|
|
|
int fCompressType; // radio button index
|
|
|
|
|
|
|
|
protected:
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Disable compression types not supported by the NufxLib DLL.
|
|
|
|
*/
|
|
|
|
virtual BOOL OnInitDialog(void) override;
|
|
|
|
|
|
|
|
virtual void DoDataExchange(CDataExchange* pDX) override;
|
2014-11-04 00:26:53 +00:00
|
|
|
|
|
|
|
afx_msg void OnChangeRange(UINT);
|
2014-12-09 22:10:52 +00:00
|
|
|
afx_msg LONG OnHelpInfo(UINT wParam, LONG lParam) {
|
|
|
|
return MyApp::HandleHelpInfo((HELPINFO*) lParam);
|
|
|
|
}
|
|
|
|
afx_msg LONG OnCommandHelp(UINT wParam, LONG lParam) {
|
|
|
|
MyApp::HandleHelp(this, HELP_TOPIC_PREFS_COMPRESSION);
|
|
|
|
return TRUE;
|
|
|
|
}
|
2014-11-04 00:26:53 +00:00
|
|
|
|
|
|
|
private:
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Disable a window in our dialog.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
void DisableWnd(int id);
|
|
|
|
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The "fview" page, for selecting preferences for the internal file viewer.
|
|
|
|
*/
|
|
|
|
class PrefsFviewPage : public CPropertyPage
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
PrefsFviewPage(void) :
|
2021-04-24 20:43:04 +00:00
|
|
|
CPropertyPage(IDD_PREF_FVIEW),
|
|
|
|
fReady(false),
|
|
|
|
fEOLConvRaw(FALSE),
|
|
|
|
fNoWrapText(FALSE),
|
|
|
|
fHighlightHexDump(FALSE),
|
|
|
|
fHighlightBASIC(FALSE),
|
|
|
|
fConvDisasmOneByteBrkCop(FALSE),
|
|
|
|
fConvMouseTextToASCII(FALSE),
|
|
|
|
fConvHiResBlackWhite(FALSE),
|
|
|
|
fConvDHRAlgorithm(-1),
|
|
|
|
fConvTextEOL_HA(FALSE),
|
|
|
|
fConvCPMText(FALSE),
|
|
|
|
fConvPascalText(FALSE),
|
|
|
|
fConvPascalCode(FALSE),
|
|
|
|
fConvApplesoft(FALSE),
|
|
|
|
fConvInteger(FALSE),
|
|
|
|
fConvBusiness(FALSE),
|
|
|
|
fConvGWP(FALSE),
|
|
|
|
fConvText8(FALSE),
|
|
|
|
fConvAWP(FALSE),
|
|
|
|
fConvADB(FALSE),
|
|
|
|
fConvASP(FALSE),
|
|
|
|
fConvSCAssem(FALSE),
|
|
|
|
fConvDisasm(FALSE),
|
|
|
|
fConvHiRes(FALSE),
|
|
|
|
fConvDHR(FALSE),
|
|
|
|
fConvSHR(FALSE),
|
|
|
|
fConvPrintShop(FALSE),
|
|
|
|
fConvMacPaint(FALSE),
|
|
|
|
fConvProDOSFolder(FALSE),
|
|
|
|
fConvResources(FALSE),
|
|
|
|
fRelaxGfxTypeCheck(FALSE),
|
|
|
|
fMaxViewFileSizeKB(0)
|
2014-11-04 00:26:53 +00:00
|
|
|
{}
|
|
|
|
bool fReady;
|
|
|
|
|
|
|
|
BOOL fEOLConvRaw;
|
|
|
|
BOOL fNoWrapText;
|
|
|
|
BOOL fHighlightHexDump;
|
|
|
|
BOOL fHighlightBASIC;
|
|
|
|
BOOL fConvDisasmOneByteBrkCop;
|
2017-11-13 22:24:58 +00:00
|
|
|
BOOL fConvMouseTextToASCII;
|
2014-11-04 00:26:53 +00:00
|
|
|
BOOL fConvHiResBlackWhite;
|
|
|
|
int fConvDHRAlgorithm; // drop list
|
|
|
|
|
|
|
|
BOOL fConvTextEOL_HA;
|
|
|
|
BOOL fConvCPMText;
|
|
|
|
BOOL fConvPascalText;
|
|
|
|
BOOL fConvPascalCode;
|
|
|
|
BOOL fConvApplesoft;
|
|
|
|
BOOL fConvInteger;
|
|
|
|
BOOL fConvBusiness;
|
|
|
|
BOOL fConvGWP;
|
|
|
|
BOOL fConvText8;
|
|
|
|
BOOL fConvAWP;
|
|
|
|
BOOL fConvADB;
|
|
|
|
BOOL fConvASP;
|
|
|
|
BOOL fConvSCAssem;
|
|
|
|
BOOL fConvDisasm;
|
|
|
|
|
|
|
|
BOOL fConvHiRes;
|
|
|
|
BOOL fConvDHR;
|
|
|
|
BOOL fConvSHR;
|
|
|
|
BOOL fConvPrintShop;
|
|
|
|
BOOL fConvMacPaint;
|
|
|
|
BOOL fConvProDOSFolder;
|
|
|
|
BOOL fConvResources;
|
|
|
|
BOOL fRelaxGfxTypeCheck;
|
|
|
|
|
|
|
|
UINT fMaxViewFileSizeKB;
|
|
|
|
|
|
|
|
protected:
|
2014-11-21 21:18:20 +00:00
|
|
|
virtual BOOL OnInitDialog(void) override;
|
|
|
|
virtual void DoDataExchange(CDataExchange* pDX) override;
|
2014-11-04 00:26:53 +00:00
|
|
|
|
|
|
|
afx_msg void OnChange(void);
|
|
|
|
afx_msg void OnChangeRange(UINT);
|
2014-12-09 22:10:52 +00:00
|
|
|
afx_msg LONG OnHelpInfo(UINT wParam, LONG lParam) {
|
|
|
|
return MyApp::HandleHelpInfo((HELPINFO*) lParam);
|
|
|
|
}
|
|
|
|
afx_msg LONG OnCommandHelp(UINT wParam, LONG lParam) {
|
|
|
|
MyApp::HandleHelp(this, HELP_TOPIC_PREFS_FVIEW);
|
|
|
|
return TRUE;
|
|
|
|
}
|
2014-11-04 00:26:53 +00:00
|
|
|
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The "compression" page, which lets the user choose a default compression
|
|
|
|
* method for NuFX archives.
|
|
|
|
*/
|
|
|
|
class PrefsFilesPage : public CPropertyPage
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
PrefsFilesPage(void) :
|
|
|
|
CPropertyPage(IDD_PREF_FILES), fReady(false)
|
|
|
|
{}
|
|
|
|
|
|
|
|
bool fReady;
|
|
|
|
|
|
|
|
CString fTempPath;
|
|
|
|
CString fExtViewerExts;
|
|
|
|
|
|
|
|
protected:
|
2014-11-21 21:18:20 +00:00
|
|
|
virtual BOOL OnInitDialog(void) override;
|
|
|
|
virtual void DoDataExchange(CDataExchange* pDX) override;
|
2014-11-04 00:26:53 +00:00
|
|
|
|
|
|
|
afx_msg void OnChange(void);
|
|
|
|
afx_msg void OnChooseFolder(void);
|
2014-12-09 22:10:52 +00:00
|
|
|
afx_msg LONG OnHelpInfo(UINT wParam, LONG lParam) {
|
|
|
|
return MyApp::HandleHelpInfo((HELPINFO*) lParam);
|
|
|
|
}
|
|
|
|
afx_msg LONG OnCommandHelp(UINT wParam, LONG lParam) {
|
|
|
|
MyApp::HandleHelp(this, HELP_TOPIC_PREFS_FILES);
|
|
|
|
return TRUE;
|
|
|
|
}
|
2014-11-04 00:26:53 +00:00
|
|
|
|
|
|
|
MyBitmapButton fChooseFolderButton;
|
|
|
|
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Property sheet that wraps around the preferences pages.
|
|
|
|
*/
|
|
|
|
class PrefsSheet : public CPropertySheet
|
|
|
|
{
|
|
|
|
public:
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Construct the preferences dialog from the individual pages.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
PrefsSheet(CWnd* pParentWnd = NULL);
|
|
|
|
|
|
|
|
PrefsGeneralPage fGeneralPage;
|
|
|
|
PrefsDiskImagePage fDiskImagePage;
|
|
|
|
PrefsCompressionPage fCompressionPage;
|
|
|
|
PrefsFviewPage fFviewPage;
|
|
|
|
PrefsFilesPage fFilesPage;
|
|
|
|
|
|
|
|
protected:
|
2014-11-21 21:18:20 +00:00
|
|
|
/*
|
|
|
|
* Enables the context help button.
|
|
|
|
*
|
|
|
|
* We don't seem to get a PreCreateWindow or OnInitDialog, but we can
|
|
|
|
* intercept the WM_NCCREATE message and override the default behavior.
|
|
|
|
*/
|
|
|
|
afx_msg BOOL OnNcCreate(LPCREATESTRUCT cs);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Handle the "apply" button. We only want to process updates for property
|
|
|
|
* pages that have been constructed, and they only get constructed when
|
|
|
|
* the user clicks on them.
|
|
|
|
*
|
|
|
|
* We also have to watch out for DDV tests that should prevent the "apply"
|
|
|
|
* from succeeding, e.g. the file viewer size limit.
|
|
|
|
*/
|
2014-11-04 00:26:53 +00:00
|
|
|
afx_msg void OnApplyNow();
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Handle a press of the "Help" button by redirecting it back to ourselves
|
|
|
|
* as a WM_COMMANDHELP message. If we don't do this, the main window ends
|
|
|
|
* up getting our WM_COMMAND(ID_HELP) message.
|
|
|
|
*
|
|
|
|
* We still need to define an ID_HELP WM_COMMAND handler in the main window,
|
|
|
|
* or the CPropertySheet code refuses to believe that help is enabled for
|
|
|
|
* the application as a whole.
|
|
|
|
*
|
|
|
|
* The PropertySheet object handles the WM_COMMANDHELP message and redirects
|
|
|
|
* it to the active PropertyPage. Each page must handle WM_COMMANDHELP by
|
|
|
|
* opening an appropriate chapter in the help file.
|
|
|
|
*/
|
2014-12-09 22:10:52 +00:00
|
|
|
afx_msg void OnIDHelp(void);
|
2014-11-21 21:18:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Context help request (question mark button) on something outside of the
|
|
|
|
* property page, most likely the Apply or Cancel button.
|
|
|
|
*/
|
2014-12-09 22:10:52 +00:00
|
|
|
afx_msg LONG OnHelpInfo(UINT wParam, LONG lParam) {
|
|
|
|
return MyApp::HandleHelpInfo((HELPINFO*) lParam);
|
|
|
|
}
|
2014-11-04 00:26:53 +00:00
|
|
|
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
|
|
};
|
|
|
|
|
Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.
* Switch from MBCS to UNICODE APIs
Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out. So it's
time to switch to wide strings.
This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode). The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.
There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion. These currently have fixed
place-holder "xyzzy" strings.
All UI strings are now wide.
Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow. This doesn't play well with gcc, so
only the Windows-specific parts use those.
* Various updates to vcxproj files
The project-file conversion had some cruft that is now largely
gone. The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.
* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots
The old "prebuilts" directory is now gone. The libraries are now
built as part of building the apps.
I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).
* Replace symbols used for include guards
Symbols with a leading "__" are reserved.
2014-11-10 23:32:55 +00:00
|
|
|
#endif /*APP_PREFSDIALOG_H*/
|