Commit Graph

20 Commits

Author SHA1 Message Date
Andy McFadden 4235b47748 Save and restore main window placement
Windows' default behavior is apparently to fill the display with the
app window, capped at 1920x1200.  This is annoyingly large for most
situations.

We now save the main window rect (LTRB) and maximization status in
the configuration area of the registry.  The window placement calls
are supposed to do something reasonable when the window would be
completely off-screen (e.g. because a secondary monitor was disabled).
2021-05-10 14:15:49 -07:00
Andy McFadden 9698f46eae Revert "Workaround for egregious window placement behavior"
This reverts commit 0a317cb0e7.
2021-04-24 09:59:35 -07:00
Andy McFadden 0a317cb0e7 Workaround for egregious window placement behavior
Windows is currently creating the main window at near-maximal size.
It used to remember the size and placement, but no longer does.

As a workaround, the initial size is set to 1150x800, which is large
enough to show all columns without scrolling even with very wide
pathnames.  With some effort this could be modified to respect the
maximum size of the monitor on which it will be displayed, so that
anyone still running at 1024x768 won't be in a bad place.

Ideally it would remember the previous size and position.  See
issue #41 for discussion.
2021-04-18 17:06:01 -07:00
Andy McFadden 2adbe9591f Add optional MouseText-to-ASCII conversion
The AWP5 MouseText output is okay for some things but not others.
This adds an ASCII conversion, enabled through a preference.
2017-11-13 14:24:58 -08:00
Andy McFadden a250f6d89a Disable logging in non-debug builds
Ideally there would be a preference that allowed you to enable
logging and specify the file's location.  That could make remote
debugging of certain problems easier.
2015-01-22 10:06:55 -08:00
Andy McFadden 06eeabc8a4 Switch to system font
Switch the remaining dialogs to the system font.  This required
minor adjustments in a couple of places.

Also, remove the remnants of the ChooseDir dialog.
2015-01-15 16:10:08 -08:00
Andy McFadden b3780261c4 Minor tweaks 2015-01-13 13:43:48 -08:00
Andy McFadden fd37bfd261 Reimplement ChooseDirDialog
The previous version was written to work on Win98+, and used the
rather gnarly ShellTree class.  Since we no longer support Win98,
we can now use CShellManager::BrowseForFolder(), which does exactly
what we want without all the ugly code (and it looks nicer, and it
integrates better with the rest of the system).

We can also get rid of NewFolderDialog, which only existed to allow
the user to create a folder when trudging through ShellTree.

This required "upgrading" the main app object from CWinApp to
CWinAppEx, but that appears to be benign.  Tested on WinXP and it
all seems fine.
2015-01-13 13:25:34 -08:00
Andy McFadden 4dd0c9339d Quick stab at Unicode for AWGS/Teach
This tweaks the output for AWGS and Teach Text to convert from Mac
OS Roman to Unicode, rather than Windows code page 1252.

It would be slightly more efficient (and possibly a bit more legible
in the RTF file) if we left the "good" conversions alone, e.g.
continue to use the CP1252 character for "E with acute", instead of
converting to U+00C9.  That might leave us at the mercy of the code
page converter in some random RTF reader, though, so it's probably
best to just use the official Unicode values.
2014-12-18 17:33:09 -08:00
Andy McFadden ef708f563e Move file association handling back into the app
The DeployMaster installer issue prevents the user from seeing more
than nine of the 18 file extensions that CiderPress wants to handle,
and I don't want to go stomping on file associations without some
way to disable the behavior.  So this returns to the previous behavior,
where CiderPress directly manages the file associations.

The CiderPress app is not able to modify HKEY_LOCAL_MACHINE (which
it used to do via HKEY_CLASSES_ROOT) on recent versions of Windows --
tested in Win7, but it probably broke with Vista.  So now we do
everything in HKEY_CURRENT_USER.  This works, more or less.

We're not looking at the Windows shell overrides, which are made
in yet another set of registry entries, so there are multiple
reasons why the values reported by the Edit Associations dialog may
now be inaccurate.  I still favor eliminating the dialog as a
long-term strategy.

I took the opportunity to do some code cleanup in the registry code.
I also added calls to SHChangeNotify() to tell the Windows shell when
file associations change, so Windows Explorer windows get updated
promptly.
2014-12-15 21:57:09 -08:00
Andy McFadden 4638d03d6c Shift responsibility for file associations to the installer
In the past, CiderPress managed its own file associations.  This is
the feature that launches CiderPress when you double-click on a ".shk"
file.  The installer ran "CiderPress -install" and "-uninstall" during
installation and removal to give CP a chance to establish and clean
up the necessary registry entries.

The code built with VS6 works fine.  The code built with VS2013 fails
with an access denied error.  It appears there have been some access
policy changes, and the older code is getting "grandfathered in".  This
is really something that the installer ought to be handling, though,
so rather than figure out how to fix CiderPress, I'm removing the
file type association code from CiderPress and letting DeployMaster
handle it.

This may be slightly less convenient for anyone who had reason to
change type associations frequently.  Modern versions of Windows have
relatively easy to use control panel UIs for adjusting types, and
the "advanced installation" feature of DeployMaster allows you to
un-check the types that you don't want to have associated with
CiderPress.

(...with one minor hitch: DeployMaster 4.2.2 only shows the first 9
associations, and CiderPress has 18.)

This change renders most of the registry-handling code obsolete, as
well as the "-install" / "-uninstall" handling.  I'm 99% sure I want
to go this way, but I'm keeping things #ifdefed rather than deleted
for the moment.
2014-12-11 14:22:39 -08:00
Andy McFadden 759f0d820f WinHelp to HtmlHelp conversion, part 2
This updates the various dialogs to use the new functions.  The help
system should be fully functional now.
2014-12-09 14:10:52 -08:00
Andy McFadden 250d1043e3 WinHelp to HtmlHelp conversion, part 1
The original version of CiderPress used a WinHelp help file, built
with an application called HelpMatic Pro.  This app used a proprietary
format, and had no facility for exporting to "raw" HPJ + RTF files, so
I decompiled the HLP and imported it into HelpScribble.

Using HelpScribble, I cleaned up the help file formatting a little,
fixed up the table of contents, and exported as "raw" HtmlHelp (HHP,
HHK, HHC, and a whole bunch of HTML).  I also split the pop-up help
text, which isn't supported by HelpScribble, into a separate text file
that Microsoft's HTML Help Workshop understands.

I'm checking in the files that HTML Help Workshop needs to generate a
CHM, so anyone can update the help text.  I'm also checking in the CHM
file, rather than adding the help workshop to the build, so that it's
not necessary to download and configure the help workshop to build
CiderPress.

This change adds all of the updated help, but only updates the Help and
question mark button actions for one specific dialog.  A subsequent
change will update the rest of the dialogs.

This change is essentially upgrading us from a totally obsolete help
system to a nearly-obsolete help system, but the systems are similar
enough to make this a useful half-step on the way to something else.
The code will centralize help activation in a pair of functions in the
main app class, so any future improvements should be more limited in
scope.

This also adds a build step to copy the CHM to the execution directory.
2014-12-08 22:40:56 -08:00
Andy McFadden d8223dbcfd Relocate method comments
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.
2014-11-21 22:33:39 -08:00
Andy McFadden f6647b9978 Convert WSMG to LOG
Mostly a bulk conversion of debug messages, primarily with sed:

 sed -e 's/\(WMSG[0-9]\)\(.*\)\(\\n"\)/LOGI\2"/'

This removes the '\n' from the end of the log messages, and sets
them all to "info" severity.

We want to prefix each line with file/line and/or a timestamp,
so it doesn't make sense to have a partial line, and there's no
value in embedding the '\n' in every string.
2014-11-18 14:16:35 -08:00
Andy McFadden bf5e2bce50 Change "nil" to "NULL" 2014-11-17 21:37:36 -08:00
Andy McFadden d21ba553ab Added new logging macros
Visual Studio figured out variadic macros around 2005, so we can
finally replace the explicit-arg-count debug log macros.

Also, fixed some include guards.

Also, bumped version to 4.0.0d1.
2014-11-17 18:07:07 -08:00
Andy McFadden 51b5f00f5c 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-16 21:01:53 -08:00
Andy McFadden 63b9996009 Normalize indentation and EOL
This updates all source files to use spaces instead of tabs for
indentation.  It also normalizes the end-of-line markers to be
Windows-style CRLF, and ensures that all files end with EOL.

No substantive changes were made; "diff -w" is empty.
2014-11-03 16:26:53 -08:00
Andy McFadden 0d7d1b67e0 initial import 2007-03-27 17:47:10 +00:00