Commit graph

175 commits

Author SHA1 Message Date
ehouse
d0222385fb Warn when unable to open a saved game (generally when an older version
of the app tries to open game saved by newer version.)
2008-12-11 13:48:59 +00:00
ehouse
4baa620298 Don't open saved games dialog unless current game has a name:
cancelling name request cancels saved games dlg too.
2008-12-08 05:51:21 +00:00
ehouse
ad459c8a0a Add appropriate icon flags to all uses of MessageBox; remove a couple
of unnecessary Cancel buttons.
2008-12-07 16:24:26 +00:00
ehouse
ae9c6f1fe3 Fix other sites putting up dialogs claiming main window as parent when
it isn't.
2008-12-07 05:21:13 +00:00
ehouse
670d0be212 Don't let smartphone users set hintlimits checkbox, and explain
why. Fix bug calling MessageBox with main window ptr from dialog.
Include name of preexisting file when warning user who enters it while
saving/renaming.
2008-12-07 01:30:18 +00:00
ehouse
4748e0dc9f Use SetBkMode to prevent overlapping tile face/value pairs from
erasing each other.
2008-12-06 22:14:40 +00:00
ehouse
fb9ea8b64f Mods to saved games dialog: allow to rename the current game; after
renaming or duplicating a game, make that new name the one initially
selected in the listbox; remove sorting code relying on OS to sort
when CBS_SORT set.
2008-12-06 20:28:01 +00:00
ehouse
ca53a3a74c Make Show values the left softkey after chosen once. 2008-12-03 13:40:07 +00:00
ehouse
9bb510bfd7 draw bitmaps larger when will fit; draw hint region border thicker and
in player color; rename constants.
2008-12-02 13:47:18 +00:00
ehouse
1fb1c28ed8 if scrollbar has focus when removed due to screen resize, don't
continue to draw indicator rects in focus color
2008-12-01 13:11:58 +00:00
ehouse
7125fb097c remove redundant set of #defines for whether we're compiling for desktop or wince 2008-11-22 16:43:55 +00:00
ehouse
0652a85acd When fewer than 4 players shown in game info dialog, move controls
higher that are below player rows. On some screen sizes this prevents
those items from being off-screen. Note that this requires use of
DM_RESETSCROLL message to get Smartphone to recalc scroll info and
that DM_RESETSCROLL is not yet defined in cegcc.
2008-11-18 12:36:27 +00:00
ehouse
2a517c3d32 Fix timer positioning; provide default values for w32 height & width;
put up dialog on assertion failures now that they're uncommon.
2008-11-13 05:46:21 +00:00
ehouse
17b139b2c7 Add checkmarks to four menuitems to show state; add fullScreen
menuitem to w32 version and give it something to do.
2008-11-10 18:49:26 +00:00
ehouse
7d3048bb55 Speed up font calculation by interleaving width and height
constraints; simplify pending score display by using %dp rather than
trying to fit two strings in the many possible sizes of tiles.
2008-11-08 16:25:49 +00:00
ehouse
ff2bef6711 bug: choosing hint menu also chooses commit-turn if focus happens to
be on 7th tile.  Problem is that OS sends key up after handling menu.
Fix is to track when we've seen a keyDown, and drop keyUp events when
we haven't.
2008-10-31 04:36:44 +00:00
ehouse
3771b0a4e6 Use SHGetSpecialFolderPath to locate dicts in /Document Files/Crosswords; reserve 1-pixel space around Rem: text 2008-10-29 08:46:02 +00:00
ehouse
9ac6b1be7a Tray cannot be exactly same height as cells as it has thicker borders.
Reserve that difference from calculation of cell height so tray will
pick it up later.
2008-10-26 15:01:05 +00:00
ehouse
552a6a5560 Get rid of string constants referencing \My Documents, using instead
SHGetSpecialFolderPath.  Cache the result of calling it.  Note that
mingw SHGetSpecialFolderPath headers define SHGetSpecialFolderPath as
SHGetSpecialFolderPathW which isn't in the library; hack around that.
2008-10-25 18:08:36 +00:00
ehouse
a4eb339c59 wince support for Rem: focus and showing remaining tiles 2008-10-24 09:05:13 +00:00
ehouse
f1a975c106 Save games in different directory for debug version to prevent
crashing when opening wrong-format files.
2008-10-24 08:36:44 +00:00
ehouse
76688cd706 Fix bug: tray too short on large screen. Always make tray a multiple
of cell size when possible, using minimum when needed.
2008-10-20 01:24:59 +00:00
ehouse
1bb0217785 Send message on back key only when coming up, not going down, to
prevent double-dismiss of dialogs.
2008-10-18 19:38:31 +00:00
ehouse
cfb42822e4 Test (including a hack on undocumented bits in WM_HOTKEY's lParam)
whether back key resulted in a focus undive, and if it didn't, quit
the app.  Not quitting would best be done using SHNavigateBack, but
cegcc doesn't seem to have that.  And even the default behavior,
without messing with back keys at all, is to minimize, which means you
can't delete the .exe later without soft reset.  That may be my bug,
but for now we're exiting.
2008-10-13 01:17:13 +00:00
ehouse
3bbf428485 Fix bug: don't delete current game name when user might still cancel
new game creation.
2008-10-11 23:56:04 +00:00
ehouse
4f11e4270e inval font cache when new dict has different chars; use cell size as a
minimum font heigth for tray; darken default player 4 color for better
contrast.
2008-10-11 16:53:22 +00:00
ehouse
373a931b3e drawing tweaks: better test for wide short tray tile; don't inval
scroll rects unless focus shifting.
2008-10-09 12:12:25 +00:00
ehouse
8c9cfc358a Modify layout code to keep cells close to square when possible,
leaving significant border space on highly rectangular screens.
2008-10-08 04:42:16 +00:00
ehouse
ab1cc03e41 Draw focussed scrollbar using WM_CTLCOLORSCROLLBAR. Onlyworks on
Win32, so keep old method for Wince.
2008-10-07 04:00:37 +00:00
ehouse
2bc132627f Set aside portion of scrollbar rect above and below it and color that
with focus color when the scrollbar has keyboard focus.  This should
help users figure out how one-handed nav works.  Better would be to
override background color of the scrollbar and draw it full-sized, but
I havne't figured out how.  This is good enough for beta.
2008-10-01 08:31:43 +00:00
ehouse
9289df31a0 add width x height to title bar correctly (debug w32 only) 2008-09-29 05:07:35 +00:00
ehouse
79bb886495 Two large changes. First, layout board etc. based only on screen
dimensions and one constant giving the minimum height of a cell.
Replaces a bunch of constants that didn't scale to different sized
screens well.  Second, add the vertical scrollbar into the focus
rotation.  Once I have it showing that it's focussed it'll be easier
to figure out how to scroll the screen.
2008-09-28 17:50:04 +00:00
ehouse
d2afc68ba8 Fix nasty crashers: restore previous game when unable to open new,
e.g. because it was created with a dict that's no longer available (in
which case warn to that effect.)
2008-09-28 16:48:30 +00:00
ehouse
a9d255592a cleanup: name changes; don't measure the same glyph twice. 2008-09-18 03:50:04 +00:00
ehouse
783b3a2860 move logLastError 2008-09-14 16:01:28 +00:00
ehouse
25c59a25e7 Pass streams to cedraw on save and restore, adding version flag for
backward compatibility.  Within cedraw, save cached font info to
remove the visible delay on startup.
2008-09-10 12:18:30 +00:00
ehouse
7299675adc In case where board can't fully fill screen, track the rects on either
side and erase them when they're invalidated.  When seeking best-fit
font, pull glyphs to measure from dictionary rather than assuming
A-Z. Speed font measuring code by passing over all glyphs only once,
noting tallest and lowest-extending then measuring only those two as
smaller sizes are tried.  This *may* make the process fast enough that
I don't need to cache the information across boots: need to try on
real hardware.
2008-09-09 12:31:02 +00:00
ehouse
9be9842e48 Make CEDrawCtx def private; erase background when OS invalidates it.
This gets rid of what's visible behind the board when it's not
full-screen width, but causes a lot of flashing.  Better will be to
make board.c own an entire rectangle and to decide board dimensions
itself.
2008-09-01 15:10:28 +00:00
ehouse
84758c8be2 Go back to using combobox on PPC but keep spinners on Smartphone.
Meaning: both exist in the resource, and at runtime we disable the
unwanted one and lookup IDs and sometimes window messages in order to
operate on 'em.  Also, spinners send WM_NOTIFY messages, so handle
that.  Current implementation is a bit of a hack but works.
2008-08-27 12:16:33 +00:00
ehouse
6a6ce44a59 fix major leakage by closing one game before opening another. 2008-08-01 10:47:32 +00:00
ehouse
38314f2a2e fix scrollbars now that I finally understand what nPage is supposed to be. 2008-08-01 10:37:52 +00:00
ehouse
d61b63986b fix typo 2008-07-28 05:02:11 +00:00
ehouse
bff4b573c9 Fix drawing of divider -- is too narrow to shrink horizontally so do so vertically; implement warnf with a dialog. 2008-07-24 04:16:48 +00:00
ehouse
b265e3fa18 Implement dup, delete and rename buttons in saved games dialog.
Differs from Palm in having no edit field.  Rather, a separate dialog
comes up to get the new name.  Rather than reload the spinbox with a
new set of saved games after an action, just close and reopen the
dialog.
2008-06-26 04:17:14 +00:00
ehouse
9ca72bd61a Use GetModuleFileName to find dictionaries in same directory as executable. Replace cute attempt to cons up list of possible dict locations with a string in a resource. Get rid of two-year-old code explaining a change in where dicts live. Fix typo putting 4K buffer on stack. 2008-06-13 05:25:20 +00:00
ehouse
588c16d45f rename and reorganize/simplify dialog-handling code common to all
dialogs, handling scrolling and backspace key (smartphone only) and
scroll-by-focus in a single place.
2008-06-05 04:29:28 +00:00
ehouse
7da66696ed Fix dictionary-search code to look in top-level temporary directories
rather than hard-coded "SD Card" etc. to work in non-English cases;
fix password dialog to fit, and simplify it; fix backspace on
smartphone for all dialogs with EDIT fields to actually backspace
rather than exiting app; and in main window have it raise focus.  This
change requires SHSendBackToFocusWindow(), which is not yet in cegcc.
Until I get a patch accepted this breaks wince builds.
2008-05-31 22:07:29 +00:00
ehouse
41192e60a0 cleanup: remove dead function; move variables closer to where used 2008-05-25 15:08:03 +00:00
ehouse
1d5446bfdf Trying to give smartphone users way to use keypad to move tiles to
board.  Enabling key-to-text works, but constants to turn it off
aren't in cegcc.  So for b2 add a quick hack where 1 means first tile
in tray, 7 means last (rightmost).  Enable and test on gtk.
2008-05-11 20:29:43 +00:00
ehouse
90a10345b8 Fix trade window draw and timer draw by setting clip rect. Change
softkey to turnDone when trading.  Tweak trade-related user messages.
2008-05-11 15:25:04 +00:00