Commit graph

109 commits

Author SHA1 Message Date
ehouse
d5cede0150 Add enum to debug-only logging. 2009-02-14 16:24:06 +00:00
ehouse
1a78d73208 Turn off SMS by default (pending confirming a way to use the apis in unsigned app); add commented-out NO_DRAW option. 2009-01-31 18:02:02 +00:00
ehouse
09cc644a4c If smallest bitmap is too big, use it anyway at full size. 2009-01-18 19:52:46 +00:00
ehouse
ff89bee6e8 Pick largest possible bitmap; fix inconsistency between cedict's idea
of bitmap format and cedraw's: rows are padded to 8-bit boundary, not
necessarily 16-bit.
2009-01-18 18:29:27 +00:00
ehouse
40fcb03441 In tray, when values are hidden draw letters instead of bitmap if
they'll fit.
2009-01-17 20:30:49 +00:00
ehouse
ed434c1c67 Scale bitmaps for specials to the size of an M so they look right next
to other letters.
2009-01-17 18:49:35 +00:00
ehouse
56039c7438 bug fix: fix reversed width and height params to StretchBlt 2009-01-17 15:45:24 +00:00
ehouse
b77f9c437c Fix size test for bitmap caching 2009-01-14 13:27:56 +00:00
ehouse
140ac0a597 Use new api. Use small for cell and large for tile still, but now
create and cache an actual HBITMAP, and prefer it to letters.  This is
needed for Catalan where "L-L" will never fit.  Still to be done:
prefer letters to bitmap where they'll actually fit (devices where
tiles drawn wider), and position better in tray.  May also want to
allow scaling.
2009-01-13 13:11:05 +00:00
ehouse
227a58d115 Since there's now a flag indicating whether to show the value of a
tile, make value unsigned.  Adjust/fix platforms.  Add cmdline flag to
linux apps for hiding values.
2008-12-29 03:09:35 +00:00
ehouse
8e2e71a3b7 When values are hidden, draw letters as large as possible in the tile. 2008-12-13 07:34:16 +00:00
ehouse
08cf93d526 Make tray tiles one pixel taller, extending all the way to bottom of
screen.
2008-12-12 13:40:41 +00:00
ehouse
6693565ad5 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
8f3da7e899 Ignore bitmap for tiles, using string instead. 2008-12-04 06:16:37 +00:00
ehouse
1dd8363c3f Use minimum height for tile value; draw bitmaps (clipped) even if too large. 2008-12-03 13:42:30 +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
7125fb097c remove redundant set of #defines for whether we're compiling for desktop or wince 2008-11-22 16:43:55 +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
0ba1e3b122 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
fb61cb7ea0 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
288e58373d 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
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
a4eb339c59 wince support for Rem: focus and showing remaining tiles 2008-10-24 09:05:13 +00:00
ehouse
6b6d5d79d0 Remove logging; add WM_ constants for message logging. 2008-10-13 01:22:58 +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
658a8f91fa Draw divider using player color, not always black. 2008-09-28 17:55:27 +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
a72e4d0c13 comments and assertions 2008-09-28 16:47:11 +00:00
ehouse
a9d255592a cleanup: name changes; don't measure the same glyph twice. 2008-09-18 03:50:04 +00:00
ehouse
299beddc77 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
234c2971a1 Extend use of fitted fonts to scoreboard, allowing scoreboard to have
non-constant size eventually.
2008-09-13 15:24:23 +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
87ce5f06d4 Reduce parameter count. No logic change. 2008-09-10 11:57: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
181e880d8d 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
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
a5c0509b38 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
11ca0d54d0 Fix cached pen remaining after color preference changed. 2008-08-02 14:35:40 +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
0e31d4d33c 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
89edef9c18 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
c521195554 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
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
7b781b9ff1 set background color in timer, preventing flash of color when focus on scoreboard. 2008-05-25 15:54:34 +00:00
ehouse
3d7595fb2c clip so arrow doesn't overwrite cell border on smartphone with small cells. 2008-05-25 15:31:54 +00:00
ehouse
7821a4c5e5 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