Commit graph

83 commits

Author SHA1 Message Date
ehouse
4425eaa99e move showColors into CommonPrefs, removing separate storage in linux
and wince and removing setter from board and jni APIs.  Palm change
pending.
2010-01-26 04:14:18 +00:00
ehouse
d5e641ee52 Add the ALL_HERE alert to the set not duplicated. 2009-12-27 19:04:29 +00:00
ehouse
37b80527e6 Don't put certain alerts up more than once at a time -- to prevent a
huge number of stacking up when networked device is unattended or in
background.  Same infrastructure should support a checkbox in some
dialogs by which users say "Don't show me this again."
2009-12-27 02:54:30 +00:00
ehouse
3ae0df2764 Add ifdefs to work with and without cegcc support for ConnMgr (which
for now seems to lack ability to link so I'm still loading procs by
name); don't close ConnMgr connection when phone stopped so can get
notified of further changes and needn't restart; on WM_ACTIVATE, put
full-screen mode in sync with prefs setting to fix crash where app is
launched while running and yields to prev running copy which then crashes
on exit on Treo700w (see recent checkin 2853).
2009-12-23 06:01:26 +00:00
ehouse
098cd1b297 Implement enough connmgr support, loading the dll and getting proc
addresses by name, to successfully bring up cellular connection for
rest of networking to use when it's down.  This is a start: eventually
the stuff in connmgr.h (being added here) should be replaced by
support added to cegcc (including link info so the proc ptrs go away.)
Still to do: figure out how to detect when phone is turned on so can
try again without user needing to restart the app.
2009-12-21 06:43:21 +00:00
ehouse
638337384b set flag on exit and don't allocate anything or try to send via
network; clear globals var after freeing it.
2009-12-18 04:24:55 +00:00
ehouse
0a381b5a44 Implement callback for connect-to-relay success and new error message
for provinding too many players.
2009-12-14 04:12:20 +00:00
ehouse
07be694df6 Respond to disconnect error from comms with new error message then new
game dialog with conns already open on top.  It's opened as soon as
new game gets its first WM_PAINT message, which may not be best.
Tested only on win32 so far.
2009-12-04 09:09:07 +00:00
ehouse
91ccf3bac5 Replace four bitmaps with one drawn on top of background of green and
red based on connection progress.  Store the bitmap as a pgm, and
generate the .bmp from it at build time.
2009-09-24 04:26:28 +00:00
ehouse
a13e1d6488 add util_clearTimer, implement on all platforms, and call when closing
comms to fix crash on Wince when timer fired after comms had been
deleted.  The closure stored and passed in was no longer a valid ptr.
2009-09-21 12:49:08 +00:00
ehouse
4ce9a87be5 Use new relay status callback, and similar callback added to socket
read/writer, to provide connection status beside scoreboard (in area
outside that managed by code in common/).  Simple letters now, it'll
be icons eventually.
2009-09-15 13:04:34 +00:00
ehouse
51b0fd5e4e Changes to use .dll on wince: create window, which creates its menu,
after loading prefs since that's where language pref will be stored.
But for now, hard-code to load French so translator can see it
immediately.  Also, create l10n directory in which localized .rc files
will live and modify Make file to .dlls from all.
2009-04-14 03:33:46 +00:00
ehouse
d19f052503 Track HINSTANCE of localization .dll separately, passing it where
appropriate; move rest (I think) of strings into resource; load menu
for win32 app after loading localization .dll.
2009-04-11 15:45:59 +00:00
ehouse
2727cacae0 Start factoring out strings for localization: move most to resource,
add new file that loads resources (working around LoadString not
working as docs say it should).  Add all-caps version for testing and
not-yet-working cmdline change to use it.
2009-04-09 13:48:38 +00:00
ehouse
1a99dc7e1c Beginning of rewrite of socket code for communication with relay,
replacing dedicated threads for read and write with non-blocking
sockets driven from the main window proc.  So far it can do a
round-trip against the relay on win32, and compiles but isn't tested
on wince.
2009-01-31 18:06:09 +00:00
ehouse
ac8c06d9cf Turn on and enable UI for relay and sms transport. relay doensn't
work, at least on win32 where threading code is broken, and former is
completely stubbed out.
2009-01-05 14:13:40 +00:00
ehouse
c38297711e Fix other sites putting up dialogs claiming main window as parent when
it isn't.
2008-12-07 05:21:13 +00:00
ehouse
c791010603 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
de6f6dcdef 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
44ae99a075 remove redundant set of #defines for whether we're compiling for desktop or wince 2008-11-22 16:43:55 +00:00
ehouse
ce82507db0 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
e2cd0b5807 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
661a12ae5c 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
cbdf8edcf5 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
3c8f9d7049 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
3b5337d7d2 wince support for Rem: focus and showing remaining tiles 2008-10-24 09:05:13 +00:00
ehouse
56cc76b913 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
bff5f9b7c9 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
190c0aca88 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
a4f27e5525 Draw focussed scrollbar using WM_CTLCOLORSCROLLBAR. Onlyworks on
Win32, so keep old method for Wince.
2008-10-07 04:00:37 +00:00
ehouse
5ba97223f8 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
f8bb0ae202 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
33c99a2371 cleanup; to get better idea of what fonts are available on smartphone
add rough font chooser dialog.  Is commented out and not meant to
ship.
2008-09-17 04:19:20 +00:00
ehouse
fd6345c1cb move logLastError 2008-09-14 16:06:51 +00:00
ehouse
720160e7de 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
34c4bdab9a 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
36213460e0 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
2daf7d503a Pick fonts based on actual size of the subset of glyphs we'll use.
This allows a better fit without hard-coding offsets.  It also takes
considerable time at startup, so either the algorithm has to be
improved or I need to cache the data as part of prefs (and delete it
when switching between landscape and portrait on devices that allow
that.)
2008-08-30 18:55:20 +00:00
ehouse
1384be6895 Get rid of cute-but-confusing feature whereby the menuitem to which
the left softkey is set is removed from the right key's menu.  More
important is that menu-9-6 always mean "exit".
2008-08-27 12:38:01 +00:00
ehouse
bf505d1a62 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
5588ed30ad Fix cached pen remaining after color preference changed. 2008-08-02 14:35:40 +00:00
ehouse
925964675a add game names in sorted order 2008-07-28 05:02:39 +00:00
ehouse
9f82df49f6 Draw top-level board and tray focus as rect (like palm) rather than by
shading certain tiles/cells.  Up version number.  Change capitalization.
2008-07-20 16:33:19 +00:00
ehouse
ebc481ddc0 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
951d7e1c7e 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
556e947cad Prevent Pts in temp score display from overwriting number: draw it
first, and use a font the right size.
2008-05-25 15:08:59 +00:00
ehouse
ff254fcef4 add ability to scroll the board by dragging it. add new method
util_altKeyDown to allow user to choose between scrolling board and
dragging the hint rect when both are possible.  add adjustYOffset;
make it and board_setYOffset more tolerant of out-of-bounds inputs and
use that to simplify calling code.
2008-04-08 03:55:53 +00:00
ehouse
a6dda53907 Use new APIs to scroll dialogs; use new saved games dialogs. 2008-03-24 12:41:12 +00:00
ehouse
996e88a575 Pick fonts for tray and board based on sizes at runtime; bury tile
values menuitem.
2008-03-16 14:23:57 +00:00
ehouse
f0658b3b20 Use MessageBox instead of my StrBox on Smarthphone; do away with
scrollbar on Smarthphone since there's no touchscreen and I want the
space.  Still need to find a way to scroll screen.
2008-03-15 21:56:37 +00:00