Commit graph

2375 commits

Author SHA1 Message Date
ehouse
e37cfa6ce8 up version to b7 2008-12-06 22:21:38 +00:00
ehouse
c82fb50055 Use SetBkMode to prevent overlapping tile face/value pairs from
erasing each other.
2008-12-06 22:14:40 +00:00
ehouse
57197f8b2c 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
6da758b5fa set text color before drawing star bitmap to make color consistent;
add utility function for setting colors to reduce code size.
2008-12-06 16:22:43 +00:00
ehouse
af1ca9af84 Quash some compile-time warnings. snprintf instead of sprintf. 2008-12-06 15:59:30 +00:00
ehouse
5508ae4593 Add testcases for Treo-sized screens. 2008-12-04 06:17:14 +00:00
ehouse
a9fbd3c027 Ignore bitmap for tiles, using string instead. 2008-12-04 06:16:37 +00:00
ehouse
dbb8dd4713 Fix blank picker on PPC by making dropdown tall enough to drop. 2008-12-04 06:15:57 +00:00
ehouse
d3d3dd561f Pass string for tile even when it has a bitmap. Let platform decide which to use. 2008-12-04 06:13:59 +00:00
ehouse
088ab1451e Use minimum height for tile value; draw bitmaps (clipped) even if too large. 2008-12-03 13:42:30 +00:00
ehouse
62aca48673 Make Show values the left softkey after chosen once. 2008-12-03 13:40:07 +00:00
ehouse
7ae7b91e40 When hideTileValues changes, inval all tray tiles. 2008-12-03 13:38:54 +00:00
ehouse
1c6460f64a Add "Hide tile values" checkbox and support it. 2008-12-03 13:37:55 +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
b3d3f80860 Lots of little tweaks to dialog item locations. Also, don't make
phonies combo/list box sorted since that screws up order of choices.
2008-12-01 13:19:14 +00:00
ehouse
3bb15ab093 add (unused) missing defines for IME stuff, which can't work until I
figure out how to test for presence of qwerty keyboard
2008-12-01 13:16:58 +00:00
ehouse
5c53620470 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
f8870da48f Don't draw hint rect, or start drag to change it, if hints are disallowed. 2008-12-01 13:06:37 +00:00
ehouse
438be9dd2a When tray overlaps board yet is hidden, should not be on top except
when focussed.  Remember state before gained focus, and restore it
when loses.
2008-12-01 13:04:14 +00:00
ehouse
b78a46e110 When tray overlaps board yet is hidden, should not be on top except
when focussed.  Remember state before gained focus, and restore it
when loses.
2008-12-01 13:03:42 +00:00
ehouse
ce2420840d a bit of cleanup 2008-11-22 19:43:47 +00:00
ehouse
6e9f5791d6 Fix bug: when using hint limits to restrict first move on empty board
limits were ignored for the vertical search.  Fix is to make
special-case treatment of first move more integrated so special limits
code isn't needed.
2008-11-22 19:32:42 +00:00
ehouse
b24f3d66a7 fix warning when DEBUG not defined 2008-11-22 17:14:08 +00:00
ehouse
7d9259f16a update readme 2008-11-22 16:49:55 +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
5118e415c7 use a gharish color for focus so doesn't get lost 2008-11-22 16:37:58 +00:00
ehouse
542e441b69 hide focus when pen used, but remember where it was (don't set to
OBJ_NONE) so can replace it when focus keys used again.
2008-11-22 16:37:29 +00:00
ehouse
46b574b4e7 fix inval of focussed tile to take divider into account. 2008-11-20 05:12:48 +00:00
ehouse
68778333a4 finish rem: changes and fix crash: show Remaining tiles dialog and draw focussed 2008-11-19 05:08:57 +00:00
ehouse
5f27b1552c 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
d4e2f5c07a 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
a91aea537a up beta version 2008-11-12 04:55:54 +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
d4bc42b0a1 add getters 2008-11-10 16:01:46 +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
30df2166ab Don't assert when unknown key seen; just ignore. 2008-11-08 16:19:04 +00:00
ehouse
cfc00206c1 fix release build compile error. 2008-11-06 06:30:30 +00:00
ehouse
5cb97bf636 New Ubuntu has a stricter compiler... 2008-11-06 03:16:09 +00:00
ehouse
3958950ad1 When finding font to fit height, optionally force it to fit width as
well.  Mechanism used for Rem only so far, but will work for score too
as long as we don't need it to shrink font as score gets longer.
Current impl worries about height first, then width; would be better
to look at both simultaneously to reach the goal more quickly.
2008-11-02 23:17:38 +00:00
ehouse
e6399c74c1 Fix bug making glyphs from random garbage; when narrowing in on
correct font size, compute based on ratio from what we have rather
than just reducing by one each pass.
2008-11-02 04:17:42 +00:00
ehouse
be3863dd5a For win32 builds, locate files relative to ./ 2008-11-02 04:15:10 +00:00
ehouse
93e615b44c Don't skip over occupied tiles when moving cursor unless alt key is
down.  Smartphone doesn't have an alt key, and this
simplier-to-understand behavior should be the default.
2008-11-02 03:43:33 +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
9e9d8a9d79 show non-dived focus as tray with background and perimeter tiles with
background rather than opaque border.  Looks better on a range of
screen sizes.
2008-10-31 04:33:20 +00:00
ehouse
9cd570f152 add a few new WM_ constants for debugging 2008-10-31 04:31:46 +00:00
ehouse
4ff04dac84 When tray's not revealed, cursor should travel over all tiles to be
consistent with display of 7 tiles even if some are really on board.
2008-10-31 04:30:58 +00:00
ehouse
96d9baaac1 Compress user-visible name so more likely to fit on-device widgets 2008-10-29 08:47:12 +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
91b20350f7 Make much smaller .ico file by hand using GIMP, and check it in. png
files are inputs to that process but not used in the build until I
figure out how to script building the .ico.
2008-10-26 21:05:44 +00:00
ehouse
e30c72c829 make -q option take number of seconds to pause before quitting 2008-10-26 15:33:21 +00:00
ehouse
a59c2456d5 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
b684bb238a Add a 16x16 icon. Remove the .ico file from svn, adding instead the
three .png files from which it's built.  Build now depends on icotool,
which is in Debian and so not a problem.  The resulting .ico is
probably 3x the size built with winders tools, so eventually I should
fix icotool or nag its author.
2008-10-25 21:59:46 +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
9b17c20117 gtk/ncurses support for Rem: focus and showing remaining tiles. Also
rewrite gtkask to use gtk_message_dialog and add sigint handler.
2008-10-24 09:07:30 +00:00
ehouse
3b5337d7d2 wince support for Rem: focus and showing remaining tiles 2008-10-24 09:05:13 +00:00
ehouse
77d14163b1 track focus on Rem: region of scoreboard in addition to players' score
areas, pass into draw whether to show it highlighted, and fire a util
method when it's clicked on.  Intent is that platforms show the
remaining tiles dialog.
2008-10-24 08:56:20 +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
7c5b8d25fd change name of platform in about box 2008-10-24 08:35:50 +00:00
ehouse
944789b14c use three bits for scoreboard cursor in anticipate of making Rem selectable. 2008-10-21 03:19:54 +00:00
ehouse
c48f836fe7 back out 2245: having scrollbar be focusable is a better way of allowing scrolling than overloading cursor movement; scroll cursor onscreen when diving and it is off 2008-10-20 02:23:17 +00:00
ehouse
afbb5ed2fe 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
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
c81e85deef Remove overdesigned edit-control-caching mechanism in favor of just
asking if the current focus owner is an edit control.
2008-10-14 05:25:15 +00:00
ehouse
4dde28bc28 Walk dialog's controls and make a list of Edit controls so that dialog
procs don't have to pass them in.  Compare handles rather than IDs.
2008-10-13 05:46:45 +00:00
ehouse
7281423100 Trapped back key should exit dialog even if it has an edit control if
that control does not have focus.  Do that.  And since I can't figure
out how to use APIs available in CE to find edit controls dynamically
each dialog proc has to pass its IDs in.  May fix that later, in which
case ceDlgSetEdits() should be removed.
2008-10-13 01:26:20 +00:00
ehouse
3992e4299f Remove logging; add WM_ constants for message logging. 2008-10-13 01:22:58 +00:00
ehouse
40e33036db 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
4e07fb053d add 22x22 icon for smartphone 2008-10-13 01:05:42 +00:00
ehouse
097a85d115 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
3e3ff73e52 first cut at script to produce zipfile and readme 2008-10-11 22:59:18 +00:00
ehouse
ac5bbced8f mark debug-only formals and wrap in #defines to fix compile-time
warnings of clean wince build.
2008-10-11 17:58:43 +00:00
ehouse
86fb79d969 Fix to compile and run for IP-direct case, possibly breaking
heartbeats used over bluetooth.
2008-10-11 17:33:07 +00:00
ehouse
a26f6ad658 flag unusued param to fix compile error; move code used only in
multi-device games inside ifdefs.
2008-10-11 17:30:35 +00:00
ehouse
0f3b206371 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
bbe8cceb6e debug changes: change defines to remove gremlin-only code; add missing constants. 2008-10-11 16:46:08 +00:00
ehouse
51a0825b51 Really old change: write struct differently in RFCOMM case 2008-10-11 15:04:11 +00:00
ehouse
018be047ad fix bug: need to reset engine when divider moved via keys as well as
when dragged.
2008-10-10 08:38:23 +00:00
ehouse
37e922e92b 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
5e839d82e4 get rid of excessive logging 2008-10-09 12:07:30 +00:00
ehouse
d7f17ecbe0 add function for logging location reached when debugging 2008-10-09 12:04:57 +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
a8fb37504d Don't choke when words are longer than 15 letters. 2008-10-08 04:37:44 +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
e0d73f4cd4 add width x height to title bar correctly (debug w32 only) 2008-09-29 05:07:35 +00:00
ehouse
8cecbd45c4 put dictionary in place if none there 2008-09-29 05:06:24 +00:00
ehouse
2f618616df Draw divider using player color, not always black. 2008-09-28 17:55:27 +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
ae6610a94f Script for testing a bunch of Wince device resolution under Wine. 2008-09-28 17:38:18 +00:00
ehouse
41e6f4abe2 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
8a6992132b comments and assertions 2008-09-28 16:47:11 +00:00
ehouse
d1603aa543 Fix crash when switching to game with same-language dict: inform draw
even if tile sets the same since old is about to be destroyed.
2008-09-28 16:43:24 +00:00
ehouse
79ec57be8d Bug: tap on hidden tray doesn't reveal it (likely new). Fix by always
reversing hidden tray on giving it focus and by finding tray to be
location of pen even when hidden (but only the part not under the
board.)
2008-09-27 16:59:04 +00:00
ehouse
e84a7c7a2d clean up tile-picker dlg 2008-09-27 15:58:07 +00:00
ehouse
7627672324 Add more WM_ constants 2008-09-27 15:15:14 +00:00
ehouse
df28e86fc8 Improve the font dialog 2008-09-27 15:10:53 +00:00
ehouse
63422f9c1d When moving cursor within board, scroll board if it's possible to do
so, and only if it is not move the cursor (or if needed to keep it
visible after scroll.)  This makes it easier for users to scroll --
but may not be needed if focussing scrolbar works.
2008-09-27 15:07:48 +00:00
ehouse
0fd14dc0b7 {G|S}etWindowLong -> {G|S}etWindowLongPtr as per MSDN docs 2008-09-27 15:05:26 +00:00
ehouse
564b827f6d Make new FAA 4.1 the default Spanish dictionary source; build three
dicts (8, 9 and 15) by default (all: target).
2008-09-18 03:55:04 +00:00
ehouse
eb1f083a19 Require two key events to reveal tray and act on a tile; don't treat
divider as wider (to make it easier to tap on) when keyboard being
used to select.
2008-09-18 03:53:53 +00:00
ehouse
1a1beed2f3 cleanup: name changes; don't measure the same glyph twice. 2008-09-18 03:50:04 +00:00
ehouse
1536a05ac2 bug fix: check which combo is generating events rather than assume all
are meant to change number of players.
2008-09-18 03:48:29 +00:00
ehouse
b3f8902307 Check in files forgotten before: simple font browser. 2008-09-18 03:47:04 +00:00
ehouse
f021964213 fix ncurses version so it can save games and read them back in: make existing gtk code run on both. 2008-09-18 03:46:27 +00:00
ehouse
ac03c4be61 Fix to compile with newer g++; increase size of buffer to handle largest Spanish wordlist. 2008-09-18 03:44:43 +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
82030b5382 plug leak: DeleteObject can't nuke an object CE didn't create 2008-09-14 16:06:18 +00:00
ehouse
4d7a781673 move logLastError 2008-09-14 16:01:28 +00:00
ehouse
e176540b5e remove unused defines 2008-09-14 14:38:16 +00:00
ehouse
93f120e274 Up copyright date. 2008-09-14 14:37:44 +00:00
ehouse
302f7524ef Up beta version; fix sizes to avoid clipping on some CE devices. 2008-09-14 14:36:31 +00:00
ehouse
d27b0d4eed Extend use of fitted fonts to scoreboard, allowing scoreboard to have
non-constant size eventually.
2008-09-13 15:24:23 +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
1825939981 Reduce parameter count. No logic change. 2008-09-10 11:57: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
69f667fba3 logRect utility 2008-09-09 12:20:45 +00:00
ehouse
d2cb36029b Had to comment out BLANKS_FIRST to compile new wince font code, so
assert that blank test catches only one tile per dict.
2008-09-09 12:20:09 +00:00
ehouse
61a3602dc5 Don't save dict as part of model. It's redundant as the platform code
already saves the name and passes the dict in.
2008-09-09 12:18:32 +00:00
ehouse
a1f3e3d174 call draw_dictChanged on load so draw can calc fonts immediately 2008-09-09 12:16:06 +00:00
ehouse
36627fb051 Add listeners to model so board can be notified whenever dictionary
changes.  Pass dict into draw via new API, removing it from the
draw_begin calls.
2008-09-05 12:11:37 +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
cc627f6b6d Shrink scoreboard a bit. Goal's to not needs scrolling on small
screens, but still needs work.
2008-09-01 15:07:46 +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
bd2eff236c catch up with API changes. GTK to use this still needs to be fixed! 2008-08-30 13:54:47 +00:00
ehouse
797b859c8e add pointer support to LIB_NO_UI case 2008-08-30 13:28:53 +00:00
ehouse
4d6aec67fe error message when hit feature is off but you try to use it; clean up memory on way out. 2008-08-30 13:27:27 +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
5e6ba430fe fix newg_attrChanged to exit quickly when there's no change 2008-08-27 12:09:30 +00:00
ehouse
07e7032c16 give serverRole a default value. 2008-08-27 12:08:07 +00:00
ehouse
5588ed30ad Fix cached pen remaining after color preference changed. 2008-08-02 14:35:40 +00:00
ehouse
39eb88b14f Replace dropdowns in limited-hint dialog with spinners. Combine flags
for spinners into a macro to guarantee all same.
2008-08-01 11:13:13 +00:00
ehouse
3859e84c52 fix major leakage by closing one game before opening another. 2008-08-01 10:47:32 +00:00
ehouse
be219b71f2 fix scrollbars now that I finally understand what nPage is supposed to be. 2008-08-01 10:37:52 +00:00
ehouse
691f5fea19 fix drawing on 320x320 devices by forcing Wince to treat them as 320x320. 2008-07-30 04:08:45 +00:00
ehouse
454788ad04 better leak debugging 2008-07-28 05:05:39 +00:00
ehouse
6c5e3b7149 draw divider focussed when all of tray has focus 2008-07-28 05:04:34 +00:00
ehouse
30fcb88e43 fix problems drawing focus so letters still visible on board. 2008-07-28 05:03:37 +00:00
ehouse
925964675a add game names in sorted order 2008-07-28 05:02:39 +00:00
ehouse
da105cfb16 fix typo 2008-07-28 05:02:11 +00:00
ehouse
507c5e87d8 add new warning message 2008-07-28 05:01:03 +00:00
ehouse
0c751cc4d1 Add feature lost when five-way drag of divider became possible: don't
allow focus rect to stop on any empty tray slot but the leftmost.
2008-07-24 12:39:46 +00:00
ehouse
ac0a9f4ac5 Put up dialog when user asks for hint and the feature's disabled. 2008-07-24 12:37:05 +00:00
ehouse
b00a2ac384 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
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
7ded50b908 nuke unused variable 2008-07-20 16:31:50 +00:00
ehouse
8d6ae9424c Draw divider smaller when focussed so color shows. Looks like crap,
but better than having focus disappear when on divider.
2008-07-18 09:20:20 +00:00
ehouse
fd805791e4 Quiet over-enthusiastic logging of state transitions. 2008-07-18 09:06:09 +00:00
ehouse
47088c8030 Return true on preflight for cursor move so will get called again.
Fixes tray nav on Palm.
2008-07-18 09:05:04 +00:00
ehouse
ab89d78ac8 selInfo can't be left null when board created, as selPlayer is 0.
Point at pti[0] to fix crasher.
2008-07-18 09:03:54 +00:00
ehouse
c20e85eccd combine all per-player arrays in board into a single array of structs.
access can then be via a ptr, more effecient and faster.  The change
seems to save 1K of generated code.  No changes to algorithms, only to
field access.
2008-07-18 07:49:00 +00:00
ehouse
5422b82fd3 Implement new model for focus/tray interaction aimed at smartphones
with five-ways and no obvious alt key.  Focus once dived into tray
moves over tiles *and* divider.  Tap of center key toggles
selectedness of object under focus.  Movement of focus when object is
selected drags the object (tile or divider) unless in trade mode.
This is easier to discover and behaves more like drag-and-drop -- and
lets you move the divider.  Works for linux and win32.  Key nav in
tray is broken on palm.
2008-07-17 05:16:09 +00:00
ehouse
e1c7211738 make function signature match param type 2008-07-17 05:07:01 +00:00
ehouse
0d44c26373 break board.c up so isn't too large for 68K on palm when compiled for
debugging.
2008-07-17 05:06:08 +00:00
ehouse
bc05761c4a change API for drawing divider so it can be focussed as well as
selected.  Being using that information in palm and wince.  For GTK,
use color rather than ugly black rects to indicate focus.
2008-07-17 05:03:01 +00:00
ehouse
47b27f0e46 remove unused variable 2008-07-17 05:01:24 +00:00
ehouse
df52f6a47a Accept words that contain no vowels. 2008-07-12 19:37:27 +00:00
ehouse
8e25e205fc update in accordance with current Dutch practice (says an informant) 2008-07-10 03:13:33 +00:00
ehouse
ad52e63ff0 separate UI-specific code so that a non-UI linux library can be compiled, e.g. for use with a toolkit not gtk or ncurses 2008-06-30 03:39:27 +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
2ed08ac7da Fix cosmetic problems when changing focus and board overlaps tray.
The goal is to have the tray drawn on top, even if it's otherwise
hidden, when the whole thing's focussed.  Fix is to inval and
recalculate rects more often as focus changes or tray is hidden.
2008-06-07 23:14:26 +00:00
ehouse
2905af749e Fix crasher: don't start a board-scroll operation and attempt to end
by dropping a tile.  (This part is to detect that no drag actuall happened.)
2008-06-07 23:07:31 +00:00
ehouse
183d5514ca Fix crasher: don't start a board-scroll operation and attempt to end
by dropping a tile.
2008-06-07 23:05:54 +00:00
ehouse
bbfdeb6bf8 Draw tiles hanging a bit below board when hidden to allow testing of
common case on wince devices.
2008-06-07 23:03:47 +00:00
ehouse
6153fc9854 Up version of APIs being used. Using non-hex may have been a mistake
anyway.  Remove locally defined function that's available with higher
version.
2008-06-07 15:59:56 +00:00
ehouse
49a897c0de Remove tabs. Whitespace changes only. 2008-06-07 14:47:55 +00:00
ehouse
80b73824e1 Cleanup: fix for win32; remove constants that belong in cegcc; etc. 2008-06-07 14:42:20 +00:00
ehouse
930ed69d6b Finally fix scroll-follows-focus for color edit dialog (the tallest).
Trick was to add BS_NOTIFY property to dialog controls and look for
the WM_COMMAND->BN_SETFOCUS message.
2008-06-07 14:40:05 +00:00
ehouse
fa1f65283f for win32, look for dicts locally. 2008-06-07 13:46:27 +00:00
ehouse
a29ab639fc 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
3555414ffc 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
f749fdd560 Remove all tabs. No code changes. 2008-05-31 03:26:16 +00:00
ehouse
af089de849 Move to new cegcc, whose tools have slightly different name. 2008-05-26 00:47:40 +00:00
ehouse
bd6aed4b5a Fix so curses-only builds and curses build doesn't segfault. 2008-05-26 00:27:48 +00:00
ehouse
1355b61906 set background color in timer, preventing flash of color when focus on scoreboard. 2008-05-25 15:54:34 +00:00
ehouse
64199cf1ec clip so arrow doesn't overwrite cell border on smartphone with small cells. 2008-05-25 15:31:54 +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
ec8786b2a7 cleanup: remove dead function; move variables closer to where used 2008-05-25 15:08:03 +00:00
ehouse
8fa530303a fix bug: don't advance arrow if unable to move tile to board (introduced with recent tile index changes) 2008-05-24 16:21:03 +00:00
ehouse
c6da605b56 add missing error message 2008-05-24 16:08:13 +00:00
ehouse
4c191e0755 Don't specify g++ version; add some consts to fix warnings with newer g++. 2008-05-21 03:49:11 +00:00
ehouse
6280129788 Fix bug that number key tries to move tile to board even during trade.
Generalize use of number to select tile in tray so that during trade
keys will toggle selected tiles.  Letters too.
2008-05-19 01:18:43 +00:00
ehouse
51d4c608f9 Don't include mingwm10.dll in .cab. Doesn't seem to be needed. 2008-05-12 02:51:22 +00:00
ehouse
5502c3ef8b 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
290f505a98 While tap on draggable tile should not return it to tray, return-key on same tile should.
That's the only way to return a single tile on smartphone.
2008-05-11 16:20:37 +00:00
ehouse
f5b5da9dc5 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
ehouse
1a2ce36bb0 A bit of cleanup; no code change. 2008-05-11 15:23:22 +00:00
ehouse
cf6a3db940 Work around what appears to be smartphone bug where grouped radio
buttons are not kept in sync by manually unchecking one when the
other's selected. Also add terminating WS_GROUP bits; they're supposed
to be there, but did not help.
2008-05-11 13:58:04 +00:00
ehouse
4e9f1c6c2b remove unnecessary memset 2008-05-11 13:55:58 +00:00
ehouse
9617f503a9 Make prefs dialog narrower so fits smartphone screen. 2008-05-10 22:33:07 +00:00
ehouse
bbd9384a9e fix win32 build 2008-05-10 21:11:54 +00:00
ehouse
180de81e58 Fix color edit dialog itself. Shrink to fit smartphone screen. And
use another owner-drawn button for the sample so it can be located in
the resource file.
2008-05-10 21:09:12 +00:00
ehouse
3d6f26cc3d Work around apparent limitation to smartphone/ppc, that ownerdraw
buttons don't generate WM_MESSAGE events and ownerdraw static controls
don't get drawn: have one disabled ownerdraw button as the color
sample and a real button to trigger the edit.
2008-05-10 18:41:16 +00:00
ehouse
e178b7ccf5 Use SHInitDialog on smartphone to create fullscreen dialogs. Move
test for smartphone into util functions so can't forget it.  This
fixes scrolling on smartphone.
2008-05-10 15:42:52 +00:00
ehouse
ebad668227 add some consts. 2008-05-06 12:49:37 +00:00
ehouse
6c81a63fce redraw tray (if dirty) even if hidden. On wince at least this
prevents the bottoms of the tiles from peeking out from under a
partially obscuring board, giving away information.  In cases where
the board completely hides the tray this is unnecessary, but making
that optimiztion can come later.  This is a bug.
2008-04-14 01:31:53 +00:00
ehouse
ac63d5621f Clean up saved games dialogs, and remove (temporarily) controls that
won't do anything for b2.  Rename a couple of structs.
2008-04-13 17:14:16 +00:00
ehouse
63419db11a Put game name in title bar on launch as well as after opening saved
game.  Clear when opening unnamed/defaultnamed game
2008-04-13 17:01:09 +00:00