Commit graph

143 commits

Author SHA1 Message Date
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
ehouse
255592ddec remove unnecessary memset 2008-05-11 13:55:58 +00:00
ehouse
8a6df572ae add some consts. 2008-05-06 12:49:37 +00:00
ehouse
536de24e1d 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
ehouse
f1ec47aa93 force miniwindow entirely onto board even if natural position is on
tray; fix overdrawing onto miniwindow by making timer proc return a
boolean and only redrawing (on wince) when it's true.
2008-04-12 15:36:31 +00:00
ehouse
72457bf28c 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
120592324a remove excessive logging 2008-04-02 03:50:55 +00:00
ehouse
4518bbdc05 Force redraw after timer fires. This allows scrolling to happen
during drag, but isn't the right fix.  The timerProc should probably
return a boolean indicating whether redraw is needed.
2008-03-31 00:25:18 +00:00
ehouse
63c0cd8aee Use new APIs to scroll dialogs; use new saved games dialogs. 2008-03-24 12:41:12 +00:00
ehouse
c42e76af5b 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
ehouse
243c645c20 Change About box implementation from separate dialog to str resource
passed to MessageBox
2008-03-15 19:24:59 +00:00
ehouse
ef5e20d708 Don't subtract command bar height from client rect height on
smartphone.  This prevents windows from being too small in
non-fullscreen mode.  Make ceSizeIfFullscreen work based on state
rather than assuming it's toggling.
2008-03-15 18:32:22 +00:00
ehouse
c9101ec801 Rework dialogs to fit or (eventually) scroll on small screen; put
dialogs in fullscreen mode; switch from dropdowns to spinbuttons on
CE; grab OS version on startup (not yet used.)
2008-03-15 15:39:58 +00:00
ehouse
2c3b7b23db Work on soft key and menu: derive text from menu item being moved so
that we can pull out and later replace any item by id alone.  Do
something similar on Win32 to ease development.  Remove '&' from
menuitem text, allowing winders to assign command keys, so that we
don't have to pull it before assigning text to softkey.
2008-03-10 01:47:46 +00:00
ehouse
78dfed6c59 Put back "turn done" menu, and add call to change the left softkey.
Call it when turn changes, new game is begun, and hint feature has
been used.  Currently menuitem is duplicated.  Goal is to remove the
item being attached to the left button and to replace it when another
is chosen.
2008-02-26 13:49:41 +00:00
ehouse
7da5ce74f4 Convert prefs in old format to new when encountered so that users
don't lose settings on upgrading.
2008-02-23 22:06:05 +00:00
ehouse
0b5a14c424 Add ENABLE_LOGGING define so logging can be used on non-debug builds, e.g. to trace opening of non-debug saved games and prefs files. 2008-02-17 21:48:48 +00:00
ehouse
25b568d22e Fix timers to work even when message queue is full; make fullScreen
choice persistent; clean up resource file and add missing strings.
2008-02-16 17:36:46 +00:00
ehouse
642e6611db Mark params unused in compiles for standalone; remove unused param. 2008-02-16 16:02:49 +00:00
ehouse
145e55c7f0 Add resource for two-soft-key commandbar and put it up. The single item is "Done" for now. 2008-02-05 04:57:58 +00:00
ehouse
2386ab6b31 Add full-screen mode and menu to get to it (leaving the cmdbar/softkey
area in place until I figure out how to work a UI without a visible
menu); rework menu to launch new-style from a single softkey; remove
cmdbuttons and associated resources; limited progress on handling
return key/timeouts for keyboard navigation.
2008-01-20 15:36:17 +00:00
ehouse
a9d1697c7b Update to use modified newg_store 2008-01-05 16:37:49 +00:00
ehouse
e894a44b61 Fix compilation errors. Not tested. 2007-12-03 01:18:13 +00:00
ehouse
b527110379 replace all __FUNCTION__ with __func__ 2007-12-02 19:13:25 +00:00
ehouse
5878ea6018 type name change only 2007-05-26 14:14:01 +00:00
ehouse
e891a26756 substitute macro for common sizeof(x)/sizeof(x[0]) pattern; no generated code change 2007-05-26 14:03:07 +00:00
ehouse
6dc75914a6 turn stringFromStream into macro to aid logging for leak detection. Debug builds only effected. 2007-03-18 23:31:51 +00:00
ehouse
2fe75a19a2 add const to a bunch of char* decls in APIs and variables; no code change 2007-02-03 17:54:20 +00:00
ehouse
b4d01f15f2 preliminary addition of xplatform-only focus, esp drawing of cursor
and handling of arrow keys via WM_KEYUP; added focus/cursor color to
prefs and color edit dialog.  Tested only on win32 (WINE), and not
integrated with platform nav/focus model.
2007-01-19 08:24:02 +00:00
ehouse
3a0b5af472 change constant names. No change to code compiled. 2007-01-19 06:43:52 +00:00
ehouse
40832e6ea5 reintroduce board_handleKey 2007-01-18 02:42:37 +00:00
ehouse
4646ac5711 Clean up for non-keyboard and non-keyboard-nav cases. Wince is the
latter: make it compile again.
2007-01-07 01:01:20 +00:00
ehouse
e5e36f0fa4 Use new XP_TriEnable type; begin work to support bluetooth by tracking
connType and adding choice how to connect.  Bt connect dialog is
invoked, but the fields won't be populated.  Pass conn type into
socket constructor, assuming socket code doesn't change much to use BT
rather than TCP.
2006-10-28 14:56:04 +00:00