mirror of
https://github.com/fadden/ciderpress.git
synced 2024-11-27 08:49:20 +00:00
d8223dbcfd
This moves method comments from the .cpp file to the .h file, where users of the methods can find them. This also makes it possible for the IDE to show the comments when you mouse-hover over the method name, though Visual Studio is a bit weak in this regard. Also, added "override" keywords on overridden methods. Reasonably current versions of popular compilers seem to support this. Also, don't have the return type on a separate line in the .cpp file. The motivation for the practice -- quickly finding a method definition with "^name" -- is less useful in C++ than C, and modern IDEs provide more convenient ways to do the same thing. Also, do some more conversion from unsigned types to uintXX_t. This commit is primarily for the "app" directory.
104 lines
3.1 KiB
C++
104 lines
3.1 KiB
C++
/*
|
|
* CiderPress
|
|
* Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved.
|
|
* See the file LICENSE for distribution terms.
|
|
*/
|
|
#ifndef APP_IMAGEFORMATDIALOG_H
|
|
#define APP_IMAGEFORMATDIALOG_H
|
|
|
|
#include "resource.h"
|
|
#include "../diskimg/DiskImg.h"
|
|
using namespace DiskImgLib;
|
|
|
|
/*
|
|
* Dialog asking the user to confirm certain details of a disk image.
|
|
*
|
|
* The default values can be initialized individually or from a prepped
|
|
* DiskImg structure.
|
|
*/
|
|
class ImageFormatDialog : public CDialog {
|
|
public:
|
|
ImageFormatDialog(CWnd* pParentWnd = NULL) :
|
|
CDialog(IDD_DECONF, pParentWnd)
|
|
{
|
|
fInitialized = false;
|
|
fFileSource = L"";
|
|
fAllowUnknown = false;
|
|
fOuterFormat = DiskImg::kOuterFormatUnknown;
|
|
fFileFormat = DiskImg::kFileFormatUnknown;
|
|
fPhysicalFormat = DiskImg::kPhysicalFormatUnknown;
|
|
fSectorOrder = DiskImg::kSectorOrderUnknown;
|
|
fFSFormat = DiskImg::kFormatUnknown;
|
|
fDisplayFormat = kShowAsBlocks;
|
|
|
|
fQueryDisplayFormat = true;
|
|
fAllowGenericFormats = true;
|
|
fHasSectors = fHasBlocks = fHasNibbles = false;
|
|
}
|
|
|
|
/*
|
|
* Initialize our members by querying the associated DiskImg.
|
|
*/
|
|
void InitializeValues(const DiskImg* pImg);
|
|
|
|
bool fInitialized;
|
|
CString fFileSource;
|
|
bool fAllowUnknown; // allow "unknown" choice?
|
|
|
|
DiskImg::OuterFormat fOuterFormat;
|
|
DiskImg::FileFormat fFileFormat;
|
|
DiskImg::PhysicalFormat fPhysicalFormat;
|
|
DiskImg::SectorOrder fSectorOrder;
|
|
DiskImg::FSFormat fFSFormat;
|
|
|
|
enum { kShowAsBlocks=0, kShowAsSectors=1, kShowAsNibbles=2 };
|
|
int fDisplayFormat;
|
|
|
|
void SetQueryDisplayFormat(bool val) { fQueryDisplayFormat = val; }
|
|
void SetAllowGenericFormats(bool val) { fAllowGenericFormats = val; }
|
|
|
|
protected:
|
|
virtual BOOL OnInitDialog(void) override;
|
|
|
|
/*
|
|
* Handle the "OK" button by extracting values from the dialog and
|
|
* verifying that reasonable settings are in place.
|
|
*/
|
|
void OnOK(void) override;
|
|
|
|
afx_msg virtual void OnHelp(void);
|
|
afx_msg virtual BOOL OnHelpInfo(HELPINFO* lpHelpInfo);
|
|
|
|
struct ConvTable;
|
|
|
|
/*
|
|
* Load the combo boxes with every possible entry, and set the current
|
|
* value appropriately.
|
|
*
|
|
* While we're at it, initialize the "source" edit text box and the
|
|
* "show as blocks" checkbox.
|
|
*/
|
|
void LoadComboBoxes(void);
|
|
|
|
/*
|
|
* Load the strings from ConvTable into the combo box, setting the
|
|
* entry matching "default" as the current entry.
|
|
*/
|
|
void LoadComboBox(int boxID, const ConvTable* pTable, int dflt);
|
|
|
|
/*
|
|
* Find the enum value for the specified index.
|
|
*/
|
|
int ConvComboSel(int boxID, const ConvTable* pTable);
|
|
|
|
bool fQueryDisplayFormat;
|
|
bool fAllowGenericFormats;
|
|
bool fHasSectors;
|
|
bool fHasBlocks;
|
|
bool fHasNibbles;
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
};
|
|
|
|
#endif /*APP_IMAGEFORMATDIALOG_H*/
|