ce changes (from <Someone>)
The following files are gone (sys\wince):
- stat.h (moved to ceinc\sys\stat.h)
- fcntl.h (moved to ceinc\fcntl.h)
- errno.h (moved to ceinc\errno.h)
- assert.h (moved to ceinc\assert.h)
The following files were added:
- mhtxtbuf.c
- mhtxtbuf.h
- menubar.uu
- ceinc
- ceinc\sys
- ceinc\fcntl.h
- ceinc\errno.h
- ceinc\assert.h
- ceinc\sys\stat.h
CE notes:
Fixes:
- added new options "wraptext", "fullscreen" and "softkeyboard"
- CE341-1 fix ("wraptext" option)
- hide map scrollbars on Smartphone
- added View->Options menu
- PocketPC: added "Fit to screen" and "Show/Hide keypad" icons
on the menu bar
- Smartphone: '<', '>' keys were mapped incorrectly
- build: use source files directly from <buildroot>\sys\wince instead of
copying them to <buildroot>\wince\
This commit is contained in:
29
Files
29
Files
@@ -175,17 +175,24 @@ vmsmisc.c vmstty.c vmsunix.c
|
||||
|
||||
sys/wince:
|
||||
(files for Windows CE and PocketPC)
|
||||
Install.ce assert.h bootstrp.mak celib.c cesetup.bat
|
||||
cesound.c defaults.nh errno.h fcntl.h hpc.vcp
|
||||
keypad.uu mhaskyn.c mhaskyn.h mhcmd.c mhcmd.h
|
||||
mhcolor.c mhcolor.h mhdlg.c mhdlg.h mhfont.c
|
||||
mhfont.h mhinput.c mhinput.h mhmain.c mhmain.h
|
||||
mhmap.c mhmap.h mhmenu.c mhmenu.h mhmsg.h
|
||||
mhmsgwnd.c mhmsgwnd.h mhrip.c mhrip.h mhstatus.c
|
||||
mhstatus.h mhtext.c mhtext.h mswproc.c newres.h
|
||||
palmpc.vcp pocketpc.vcp resource.h smartphn.vcp stat.h
|
||||
winMS.h wince.vcw winhack.c winhack.rc winhcksp.rc
|
||||
winmain.c
|
||||
Install.ce bootstrp.mak celib.c cesetup.bat cesound.c
|
||||
defaults.nh hpc.vcp menubar.uu keypad.uu mhaskyn.c
|
||||
mhaskyn.h mhcmd.c mhcmd.h mhcolor.c mhcolor.h
|
||||
mhdlg.c mhdlg.h mhfont.c mhfont.h mhinput.c
|
||||
mhinput.h mhmain.c mhmain.h mhmap.c mhmap.h
|
||||
mhmenu.c mhmenu.h mhmsg.h mhmsgwnd.c mhmsgwnd.h
|
||||
mhrip.c mhrip.h mhstatus.c mhstatus.h mhtext.c
|
||||
mhtext.h mhtxtbuf.c mhtxtbuf.h mswproc.c newres.h
|
||||
palmpc.vcp pocketpc.vcp resource.h smartphn.vcp winMS.h
|
||||
wince.vcw winhack.c winhack.rc winhcksp.rc winmain.c
|
||||
|
||||
sys/wince/ceinc:
|
||||
(header files for Windows CE and PocketPC)
|
||||
assert.h errno.h fcntl.h
|
||||
|
||||
sys/wince/ceinc/sys:
|
||||
(sys/stat.h for Windows CE and PocketPC)
|
||||
stat.h
|
||||
|
||||
sys/winnt:
|
||||
(files for Windows 9x, NT and Windows2000 version)
|
||||
|
||||
@@ -254,8 +254,8 @@ struct tm {
|
||||
#define _TM_DEFINED
|
||||
#endif
|
||||
|
||||
struct tm * __cdecl localtime(const time_t *);
|
||||
time_t __cdecl time(time_t *);
|
||||
extern struct tm * __cdecl localtime(const time_t *);
|
||||
extern time_t __cdecl time(time_t *);
|
||||
|
||||
/* __stdio.h__ */
|
||||
#ifndef BUFSIZ
|
||||
@@ -267,16 +267,16 @@ time_t __cdecl time(time_t *);
|
||||
/* __io.h__ */
|
||||
typedef long off_t;
|
||||
|
||||
int __cdecl close(int);
|
||||
int __cdecl creat(const char *, int);
|
||||
int __cdecl eof(int);
|
||||
long __cdecl lseek(int, long, int);
|
||||
int __cdecl open(const char *, int, ...);
|
||||
int __cdecl read(int, void *, unsigned int);
|
||||
int __cdecl unlink(const char *);
|
||||
int __cdecl write(int, const void *, unsigned int);
|
||||
int __cdecl rename(const char *, const char *);
|
||||
int __cdecl access(const char *, int);
|
||||
extern int __cdecl close(int);
|
||||
extern int __cdecl creat(const char *, int);
|
||||
extern int __cdecl eof(int);
|
||||
extern long __cdecl lseek(int, long, int);
|
||||
extern int __cdecl open(const char *, int, ...);
|
||||
extern int __cdecl read(int, void *, unsigned int);
|
||||
extern int __cdecl unlink(const char *);
|
||||
extern int __cdecl write(int, const void *, unsigned int);
|
||||
extern int __cdecl rename(const char *, const char *);
|
||||
extern int __cdecl access(const char *, int);
|
||||
|
||||
#ifdef DeleteFile
|
||||
#undef DeleteFile
|
||||
@@ -284,7 +284,7 @@ int __cdecl access(const char *, int);
|
||||
#define DeleteFile(a) unlink(a)
|
||||
|
||||
int chdir( const char *dirname );
|
||||
char *getcwd( char *buffer, int maxlen );
|
||||
extern char *getcwd( char *buffer, int maxlen );
|
||||
|
||||
/* __stdlib.h__ */
|
||||
#define abort() (void)TerminateProcess(GetCurrentProcess(), 0)
|
||||
@@ -301,14 +301,33 @@ char *getcwd( char *buffer, int maxlen );
|
||||
#if defined(WIN_CE_PS2xx) || defined(WIN32_PLATFORM_HPCPRO)
|
||||
#define ZeroMemory(p, s) memset((p), 0, (s))
|
||||
|
||||
int __cdecl isupper(int c);
|
||||
int __cdecl isdigit(int c);
|
||||
int __cdecl isspace(int c);
|
||||
int __cdecl isprint(int c);
|
||||
extern int __cdecl isupper(int c);
|
||||
extern int __cdecl isdigit(int c);
|
||||
extern int __cdecl isspace(int c);
|
||||
extern int __cdecl isprint(int c);
|
||||
|
||||
extern char* __cdecl _strdup(const char* s);
|
||||
extern char* __cdecl strrchr( const char *string, int c );
|
||||
extern int __cdecl _stricmp(const char* a, const char* b);
|
||||
|
||||
extern FILE * __cdecl fopen(const char* filename, const char *mode);
|
||||
extern int __cdecl fscanf(FILE *f , const char *format, ...);
|
||||
extern int __cdecl fprintf(FILE *f , const char *format, ...);
|
||||
extern int __cdecl vfprintf(FILE* f, const char *format, va_list args);
|
||||
extern int __cdecl fgetc(FILE * f);
|
||||
extern char * __cdecl fgets(char *s, int size, FILE *f);
|
||||
extern int __cdecl printf(const char *format, ...);
|
||||
extern int __cdecl vprintf(const char *format, va_list args);
|
||||
extern int __cdecl puts(const char * s);
|
||||
extern FILE* __cdecl _getstdfilex(int desc);
|
||||
extern int __cdecl fclose(FILE * f);
|
||||
extern size_t __cdecl fread(void *p, size_t size, size_t count, FILE *f);
|
||||
extern size_t __cdecl fwrite(const void *p, size_t size, size_t count, FILE * f);
|
||||
extern int __cdecl fflush(FILE *f);
|
||||
extern int __cdecl feof(FILE *f);
|
||||
extern int __cdecl fseek(FILE *f, long offset, int from);
|
||||
extern long __cdecl ftell(FILE * f);
|
||||
|
||||
char* __cdecl _strdup(const char* s);
|
||||
char* __cdecl strrchr( const char *string, int c );
|
||||
int __cdecl _stricmp(const char* a, const char* b);
|
||||
#endif
|
||||
|
||||
/* ARM - the processor; avoids conflict with ARM in hack.h */
|
||||
|
||||
@@ -31,8 +31,7 @@ From a Windows explorer window:
|
||||
|
||||
A "wince" directory will be created off the top of the NetHack source
|
||||
tree, and a Microsoft embedded C workspace file will be placed in the
|
||||
top of the NetHack source tree. The "wince" directory will also have
|
||||
the subdirectories wince\ceinc and wince\ceinc\sys.
|
||||
top of the NetHack source tree.
|
||||
|
||||
------------
|
||||
| BUILDING |
|
||||
|
||||
@@ -234,7 +234,7 @@ all : $(INCL)\date.h $(INCL)\onames.h $(INCL)\pm.h \
|
||||
$(DAT)\oracles $(DAT)\quest.dat $(O)sp_lev.tag $(DLB) $(SRC)\tile.c \
|
||||
$(SWINCE)\nethack.ico $(SWINCE)\tiles.bmp $(SWINCE)\mnsel.bmp \
|
||||
$(SWINCE)\mnunsel.bmp $(SWINCE)\petmark.bmp $(SWINCE)\mnselcnt.bmp \
|
||||
$(SWINCE)\keypad.bmp
|
||||
$(SWINCE)\keypad.bmp $(SWINCE)\menubar.bmp
|
||||
@echo Done!
|
||||
|
||||
$(O)sp_lev.tag: $(DAT)\bigroom.des $(DAT)\castle.des \
|
||||
@@ -372,6 +372,11 @@ $(SWINCE)\keypad.bmp: $(U)uudecode.exe $(SWINCE)\keypad.uu
|
||||
..\util\uudecode.exe keypad.uu
|
||||
chdir $(WINCE)
|
||||
|
||||
$(SWINCE)\menubar.bmp: $(U)uudecode.exe $(SWINCE)\menubar.uu
|
||||
chdir $(SWINCE)
|
||||
..\util\uudecode.exe menubar.uu
|
||||
chdir $(WINCE)
|
||||
|
||||
#==========================================
|
||||
# Level Compiler Stuff
|
||||
#==========================================
|
||||
|
||||
@@ -8,8 +8,6 @@ REM
|
||||
REM Make sure directories necessary for build exist
|
||||
REM
|
||||
if NOT exist ..\..\wince\*.* mkdir ..\..\wince
|
||||
if NOT exist ..\..\wince\ceinc\*.* mkdir ..\..\wince\ceinc
|
||||
if NOT exist ..\..\wince\ceinc\sys\*.* mkdir ..\..\wince\ceinc\sys
|
||||
REM
|
||||
REM Get these files from the win\win32 port
|
||||
REM
|
||||
@@ -18,58 +16,16 @@ copy ..\..\win\win32\mnselcnt.uu ..\..\wince\mnselcnt.uu
|
||||
copy ..\..\win\win32\mnunsel.uu ..\..\wince\mnunsel.uu
|
||||
copy ..\..\win\win32\petmark.uu ..\..\wince\petmark.uu
|
||||
copy ..\..\sys\winnt\nhico.uu ..\..\wince\nhico.uu
|
||||
copy ..\..\sys\wince\menubar.uu ..\..\wince\menubar.uu
|
||||
REM
|
||||
REM Get these files from sys\wince
|
||||
REM
|
||||
copy bootstrp.mak ..\..\wince\bootstrp.mak
|
||||
copy wince.vcw ..\..\wince.vcw
|
||||
copy keypad.uu ..\..\wince\keypad.uu
|
||||
copy assert.h ..\..\wince\assert.h
|
||||
copy assert.h ..\..\wince\ceinc\assert.h
|
||||
copy errno.h ..\..\wince\ceinc\errno.h
|
||||
copy fcntl.h ..\..\wince\ceinc\fcntl.h
|
||||
copy stat.h ..\..\wince\ceinc\sys\stat.h
|
||||
copy celib.c ..\..\wince\celib.c
|
||||
copy mhaskyn.c ..\..\wince\mhaskyn.c
|
||||
copy mhaskyn.h ..\..\wince\mhaskyn.h
|
||||
copy mhcmd.c ..\..\wince\mhcmd.c
|
||||
copy mhcmd.h ..\..\wince\mhcmd.h
|
||||
copy mhcolor.c ..\..\wince\mhcolor.c
|
||||
copy mhcolor.h ..\..\wince\mhcolor.h
|
||||
copy mhdlg.c ..\..\wince\mhdlg.c
|
||||
copy mhdlg.h ..\..\wince\mhdlg.h
|
||||
copy mhfont.c ..\..\wince\mhfont.c
|
||||
copy mhfont.h ..\..\wince\mhfont.h
|
||||
copy mhinput.c ..\..\wince\mhinput.c
|
||||
copy mhinput.h ..\..\wince\mhinput.h
|
||||
copy mhmain.c ..\..\wince\mhmain.c
|
||||
copy mhmain.h ..\..\wince\mhmain.h
|
||||
copy mhmap.c ..\..\wince\mhmap.c
|
||||
copy mhmap.h ..\..\wince\mhmap.h
|
||||
copy mhmenu.c ..\..\wince\mhmenu.c
|
||||
copy mhmenu.h ..\..\wince\mhmenu.h
|
||||
copy mhmsg.h ..\..\wince\mhmsg.h
|
||||
copy mhmsgwnd.c ..\..\wince\mhmsgwnd.c
|
||||
copy mhmsgwnd.h ..\..\wince\mhmsgwnd.h
|
||||
copy mhrip.c ..\..\wince\mhrip.c
|
||||
copy mhrip.h ..\..\wince\mhrip.h
|
||||
copy mhstatus.c ..\..\wince\mhstatus.c
|
||||
copy mhstatus.h ..\..\wince\mhstatus.h
|
||||
copy mhtext.c ..\..\wince\mhtext.c
|
||||
copy mhtext.h ..\..\wince\mhtext.h
|
||||
copy mswproc.c ..\..\wince\mswproc.c
|
||||
copy newres.h ..\..\wince\newres.h
|
||||
copy resource.h ..\..\wince\resource.h
|
||||
copy hpc.vcp ..\..\wince\wince_hpc.vcp
|
||||
copy palmpc.vcp ..\..\wince\wince_palm_pc.vcp
|
||||
copy pocketpc.vcp ..\..\wince\wince_pocket_pc.vcp
|
||||
copy smartphn.vcp ..\..\wince\wince_smartphone.vcp
|
||||
copy winhack.c ..\..\wince\winhack.c
|
||||
copy winhack.rc ..\..\wince\winhack.rc
|
||||
copy winhcksp.rc ..\..\wince\winhack_sp.rc
|
||||
copy winmain.c ..\..\wince\winmain.c
|
||||
copy winMS.h ..\..\wince\winMS.h
|
||||
copy cesound.c ..\..\wince\cesound.c
|
||||
echo.
|
||||
echo Proceed with the following steps:
|
||||
echo.
|
||||
|
||||
@@ -43,7 +43,7 @@ OPTIONS=time,noshowexp,number_pad,lit_corridor,rest_on_space
|
||||
# possible map_mode options include: tiles|ascii4x6|ascii6x8|ascii8x8|ascii16x8|
|
||||
# ascii7x12|ascii8x12|ascii16x12|ascii12x16|
|
||||
# ascii10x18|fit_to_screen
|
||||
OPTIONS=map_mode:tiles,scroll_margin:3
|
||||
OPTIONS=map_mode:tiles,scroll_margin:4
|
||||
|
||||
# Menu settings
|
||||
# OPTIONS=font_menu:Arial
|
||||
@@ -51,7 +51,8 @@ OPTIONS=map_mode:tiles,scroll_margin:3
|
||||
# Other
|
||||
OPTIONS=hilite_pet,!toptenwin
|
||||
OPTIONS=!splash_screen,player_selection:prompts
|
||||
OPTIONS=vary_msgcount:4
|
||||
OPTIONS=vary_msgcount:3
|
||||
OPTIONS=fullscreen,wraptext,softkeyboard
|
||||
|
||||
# Status/message window colors
|
||||
# Possible color options include:
|
||||
|
||||
48147
sys/wince/hpc.vcp
48147
sys/wince/hpc.vcp
File diff suppressed because it is too large
Load Diff
12
sys/wince/menubar.uu
Normal file
12
sys/wince/menubar.uu
Normal file
@@ -0,0 +1,12 @@
|
||||
begin 600 menubar.bmp
|
||||
M0DUV`0```````'8````H````(````!`````!``0````````!````````````
|
||||
M````````````````````@```@````("``(````"``(``@(```,#`P`"`@(``
|
||||
M``#_``#_````__\`_P```/\`_P#__P``____`'=W=W=W=W=W=W=W=W=W=W=W
|
||||
M=W=W=W=W=W=W=W=W=W=W=$1$1$1$1'=W=W=W=W=W=W1$_T1/]$1W=W=W=W=W
|
||||
M=W=T1/_T__1$=W=W=W=W=W=W=/______]'=W=P<'!P=W=W3_______1W=W#P
|
||||
M\/#P=W=T3__T__]$=W</#P\/#P=W=$3_1$_T1'=P\/#P\/#P=W1/__3__T1W
|
||||
M=P\/#P\/!W=T_______T=W#P\/#P\/!W=/______]'=W!P<'!P<'=W1$__3_
|
||||
M]$1W=W=W=W=W=W=T1/]$3_1$=W=W=W=W=W=W=$1$1$1$1'=W=W=W=W=W=W=W
|
||||
.=W=W=W=W=W=W=W=W=W=$
|
||||
`
|
||||
end
|
||||
@@ -185,8 +185,8 @@ NHCmdPadCell cells_layout_movement[NH_CMDPAD_CELLNUM] =
|
||||
{ -1, "1", "1", 7, NH_CELL_REG, 1, (void*)-1 },
|
||||
{ -1, "2", "2", 8, NH_CELL_REG, 1, (void*)-1 },
|
||||
{ -1, "3", "3", 9, NH_CELL_REG, 1, (void*)-1 },
|
||||
{ -1, ">", ">", 10, NH_CELL_REG, 1, (void*)-1 },
|
||||
{ -1, "<", "<", 12, NH_CELL_REG, 1, (void*)-1 },
|
||||
{ -1, "<", "<", 10, NH_CELL_REG, 1, (void*)-1 },
|
||||
{ -1, ">", ">", 12, NH_CELL_REG, 1, (void*)-1 },
|
||||
{ -1, "X", "X", 13, NH_CELL_LAYOUT_MENU, 1, 0 }
|
||||
};
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ LRESULT CALLBACK GetlinDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lP
|
||||
TRUE );
|
||||
|
||||
#if defined(WIN_CE_SMARTPHONE)
|
||||
NHSPhoneDialogSetup(hWnd, TRUE);
|
||||
NHSPhoneDialogSetup(hWnd, TRUE, FALSE);
|
||||
#endif
|
||||
|
||||
/* set focus to the edit control */
|
||||
@@ -240,7 +240,7 @@ LRESULT CALLBACK ExtCmdDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lP
|
||||
}
|
||||
|
||||
#if defined(WIN_CE_SMARTPHONE)
|
||||
NHSPhoneDialogSetup(hWnd, FALSE);
|
||||
NHSPhoneDialogSetup(hWnd, FALSE, FALSE);
|
||||
|
||||
GetClientRect(hWnd, &dlg_rt);
|
||||
MoveWindow(GetDlgItem(hWnd, IDC_EXTCMD_LIST),
|
||||
@@ -362,7 +362,7 @@ BOOL CALLBACK PlayerSelectorDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
|
||||
plselInitDialog(hWnd);
|
||||
|
||||
#if defined(WIN_CE_SMARTPHONE)
|
||||
NHSPhoneDialogSetup(hWnd, FALSE);
|
||||
NHSPhoneDialogSetup(hWnd, FALSE, FALSE);
|
||||
#endif
|
||||
/* set focus on the role checkbox (random) field */
|
||||
SetFocus(GetDlgItem(hWnd, IDC_PLSEL_ROLE_RANDOM));
|
||||
@@ -472,6 +472,22 @@ void plselInitDialog(HWND hWnd)
|
||||
/* set player name */
|
||||
SetDlgItemText(hWnd, IDC_PLSEL_NAME, NH_A2W(plname, wbuf, sizeof(wbuf)));
|
||||
|
||||
/* check flags for consistency */
|
||||
if( flags.initrole>=0 ) {
|
||||
if (flags.initrace>=0 && !validrace(flags.initrole, flags.initrace)) {
|
||||
flags.initrace = ROLE_NONE;
|
||||
}
|
||||
|
||||
if (flags.initgend>=0 && !validgend(flags.initrole, flags.initrace, flags.initgend)) {
|
||||
flags.initgend = ROLE_NONE;
|
||||
}
|
||||
|
||||
if (flags.initalign>=0 && !validalign(flags.initrole, flags.initrace, flags.initalign)) {
|
||||
flags.initalign = ROLE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
/* populate select boxes */
|
||||
plselAdjustLists(hWnd, -1);
|
||||
|
||||
/* intialize roles list */
|
||||
@@ -537,16 +553,16 @@ void plselAdjustLists(HWND hWnd, int changed_sel)
|
||||
|
||||
/* get current selections */
|
||||
ind = SendMessage(control_role, CB_GETCURSEL, 0, 0);
|
||||
initrole = (ind==LB_ERR)? ROLE_NONE : SendMessage(control_role, CB_GETITEMDATA, ind, 0);
|
||||
initrole = (ind==LB_ERR)? flags.initrole : SendMessage(control_role, CB_GETITEMDATA, ind, 0);
|
||||
|
||||
ind = SendMessage(control_race, CB_GETCURSEL, 0, 0);
|
||||
initrace = (ind==LB_ERR)? ROLE_NONE : SendMessage(control_race, CB_GETITEMDATA, ind, 0);
|
||||
initrace = (ind==LB_ERR)? flags.initrace : SendMessage(control_race, CB_GETITEMDATA, ind, 0);
|
||||
|
||||
ind = SendMessage(control_gender, CB_GETCURSEL, 0, 0);
|
||||
initgend = (ind==LB_ERR)? ROLE_NONE : SendMessage(control_gender, CB_GETITEMDATA, ind, 0);
|
||||
initgend = (ind==LB_ERR)? flags.initgend : SendMessage(control_gender, CB_GETITEMDATA, ind, 0);
|
||||
|
||||
ind = SendMessage(control_align, CB_GETCURSEL, 0, 0);
|
||||
initalign = (ind==LB_ERR)? ROLE_NONE : SendMessage(control_align, CB_GETITEMDATA, ind, 0);
|
||||
initalign = (ind==LB_ERR)? flags.initalign : SendMessage(control_align, CB_GETITEMDATA, ind, 0);
|
||||
|
||||
/* intialize roles list */
|
||||
if( changed_sel==-1 ) {
|
||||
@@ -624,6 +640,7 @@ void plselAdjustLists(HWND hWnd, int changed_sel)
|
||||
SendMessage(control_gender, CB_SETITEMDATA, (WPARAM)ind, (LPARAM)i );
|
||||
if( i==initgend ) {
|
||||
SendMessage(control_gender, CB_SETCURSEL, (WPARAM)ind, (LPARAM)0 );
|
||||
valid_opt = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -174,8 +174,13 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
|
||||
menubar.dwFlags = 0;
|
||||
menubar.nToolBarId = IDC_WINHACK;
|
||||
menubar.hInstRes = GetNHApp()->hApp;
|
||||
# if defined(WIN_CE_POCKETPC)
|
||||
menubar.nBmpId = IDB_MENUBAR;
|
||||
menubar.cBmpImages = 2;
|
||||
# else
|
||||
menubar.nBmpId = 0;
|
||||
menubar.cBmpImages = 0;
|
||||
# endif
|
||||
if( !SHCreateMenuBar(&menubar) ) panic("cannot create menu");
|
||||
GetNHApp()->hMenuBar = menubar.hwndMB;
|
||||
#else
|
||||
@@ -435,10 +440,30 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
|
||||
/*-----------------------------------------------------------------------*/
|
||||
|
||||
case WM_ACTIVATE:
|
||||
if( LOWORD(wParam)!=WA_INACTIVE ) {
|
||||
#if defined(WIN_CE_POCKETPC) || defined(WIN_CE_SMARTPHONE)
|
||||
if( GetNHApp()->bFullScreen )
|
||||
SHFullScreen(GetNHApp()->hMainWnd, SHFS_HIDETASKBAR | SHFS_HIDESTARTICON);
|
||||
else
|
||||
SHFullScreen(GetNHApp()->hMainWnd, SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON);
|
||||
#endif
|
||||
mswin_layout_main_window(NULL);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_SETTINGCHANGE:
|
||||
#if defined(WIN_CE_POCKETPC) || defined(WIN_CE_SMARTPHONE)
|
||||
if( GetNHApp()->bFullScreen )
|
||||
SHFullScreen(GetNHApp()->hMainWnd, SHFS_HIDETASKBAR | SHFS_HIDESTARTICON);
|
||||
else
|
||||
SHFullScreen(GetNHApp()->hMainWnd, SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON);
|
||||
#endif
|
||||
mswin_layout_main_window(NULL);
|
||||
break;
|
||||
|
||||
case WM_SIZE:
|
||||
mswin_layout_main_window(NULL);
|
||||
break;
|
||||
break;
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
|
||||
@@ -540,6 +565,7 @@ void mswin_layout_main_window(HWND changed_child)
|
||||
ZeroMemory(&sip, sizeof(sip));
|
||||
sip.cbSize = sizeof(sip);
|
||||
SHSipInfo(SPI_GETSIPINFO, 0, &sip, 0);
|
||||
if( GetNHApp()->bFullScreen ) sip.rcVisibleDesktop.top = 0;
|
||||
|
||||
/* adjust client rectangle size */
|
||||
GetWindowRect(GetNHApp()->hMenuBar, &menu_bar);
|
||||
@@ -558,6 +584,13 @@ void mswin_layout_main_window(HWND changed_child)
|
||||
#else
|
||||
# if !defined(WIN_CE_SMARTPHONE)
|
||||
client_rt.top += CommandBar_Height(GetNHApp()->hMenuBar);
|
||||
# else
|
||||
/* Smartphone only */
|
||||
if( GetNHApp()->bFullScreen ) {
|
||||
RECT menu_bar;
|
||||
GetWindowRect(GetNHApp()->hMenuBar, &menu_bar);
|
||||
client_rt.bottom -= menu_bar.bottom-menu_bar.top;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -866,6 +899,10 @@ LRESULT onWMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
mswin_layout_main_window(GetNHApp()->hCmdWnd);
|
||||
break;
|
||||
|
||||
case IDM_VIEW_OPTIONS:
|
||||
doset();
|
||||
break;
|
||||
|
||||
case IDM_HELP_LONG:
|
||||
display_file(HELP, TRUE);
|
||||
break;
|
||||
|
||||
@@ -47,16 +47,19 @@ static COLORREF nhcolor_to_RGB(int c);
|
||||
HWND mswin_init_map_window () {
|
||||
static int run_once = 0;
|
||||
HWND ret;
|
||||
DWORD styles;
|
||||
|
||||
if( !run_once ) {
|
||||
register_map_window_class();
|
||||
run_once = 1;
|
||||
}
|
||||
|
||||
styles = WS_CHILD | WS_CLIPSIBLINGS;
|
||||
if( !GetNHApp()->bHideScrollBars ) styles |= WS_HSCROLL | WS_VSCROLL;
|
||||
ret = CreateWindow(
|
||||
szNHMapWindowClass, /* registered class name */
|
||||
NULL, /* window name */
|
||||
WS_CHILD | WS_HSCROLL | WS_VSCROLL | WS_CLIPSIBLINGS, /* window style */
|
||||
styles, /* window style */
|
||||
0, /* horizontal position of window - set it later */
|
||||
0, /* vertical position of window - set it later */
|
||||
0, /* window width - set it later */
|
||||
@@ -118,13 +121,15 @@ void mswin_map_stretch(HWND hWnd, LPSIZE lpsz, BOOL redraw)
|
||||
data->xPos = max(0, min(COLNO-data->xPageSize+1, u.ux - data->xPageSize/2));
|
||||
}
|
||||
|
||||
si.cbSize = sizeof(si);
|
||||
si.fMask = SIF_RANGE | SIF_PAGE | SIF_POS;
|
||||
si.nMin = 0;
|
||||
si.nMax = COLNO;
|
||||
si.nPage = data->xPageSize;
|
||||
si.nPos = data->xPos;
|
||||
SetScrollInfo(hWnd, SB_HORZ, &si, TRUE);
|
||||
if( !GetNHApp()->bHideScrollBars ) {
|
||||
si.cbSize = sizeof(si);
|
||||
si.fMask = SIF_RANGE | SIF_PAGE | SIF_POS;
|
||||
si.nMin = 0;
|
||||
si.nMax = COLNO;
|
||||
si.nPage = data->xPageSize;
|
||||
si.nPos = data->xPos;
|
||||
SetScrollInfo(hWnd, SB_HORZ, &si, TRUE);
|
||||
}
|
||||
|
||||
/* adjust vertical scroll bar */
|
||||
if( data->bFitToScreenMode )
|
||||
@@ -140,13 +145,15 @@ void mswin_map_stretch(HWND hWnd, LPSIZE lpsz, BOOL redraw)
|
||||
data->yPos = max(0, min(ROWNO-data->yPageSize+1, u.uy - data->yPageSize/2));
|
||||
}
|
||||
|
||||
si.cbSize = sizeof(si);
|
||||
si.fMask = SIF_RANGE | SIF_PAGE | SIF_POS;
|
||||
si.nMin = 0;
|
||||
si.nMax = ROWNO;
|
||||
si.nPage = data->yPageSize;
|
||||
si.nPos = data->yPos;
|
||||
SetScrollInfo(hWnd, SB_VERT, &si, TRUE);
|
||||
if( !GetNHApp()->bHideScrollBars ) {
|
||||
si.cbSize = sizeof(si);
|
||||
si.fMask = SIF_RANGE | SIF_PAGE | SIF_POS;
|
||||
si.nMin = 0;
|
||||
si.nMax = ROWNO;
|
||||
si.nPage = data->yPageSize;
|
||||
si.nPos = data->yPos;
|
||||
SetScrollInfo(hWnd, SB_VERT, &si, TRUE);
|
||||
}
|
||||
|
||||
/* create font */
|
||||
if( data->hMapFont ) DeleteObject(data->hMapFont);
|
||||
@@ -733,10 +740,12 @@ void onMSNH_VScroll(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
(CONST RECT *) NULL, (CONST RECT *) NULL,
|
||||
(HRGN) NULL, (LPRECT) NULL, SW_INVALIDATE | SW_ERASE);
|
||||
|
||||
si.cbSize = sizeof(si);
|
||||
si.fMask = SIF_POS;
|
||||
si.nPos = data->yPos;
|
||||
SetScrollInfo(hWnd, SB_VERT, &si, TRUE);
|
||||
if( !GetNHApp()->bHideScrollBars ) {
|
||||
si.cbSize = sizeof(si);
|
||||
si.fMask = SIF_POS;
|
||||
si.nPos = data->yPos;
|
||||
SetScrollInfo(hWnd, SB_VERT, &si, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
/* on WM_HSCROLL */
|
||||
@@ -791,11 +800,12 @@ void onMSNH_HScroll(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
(CONST RECT *) NULL, (CONST RECT *) NULL,
|
||||
(HRGN) NULL, (LPRECT) NULL, SW_INVALIDATE | SW_ERASE);
|
||||
|
||||
|
||||
si.cbSize = sizeof(si);
|
||||
si.fMask = SIF_POS;
|
||||
si.nPos = data->xPos;
|
||||
SetScrollInfo(hWnd, SB_HORZ, &si, TRUE);
|
||||
if( !GetNHApp()->bHideScrollBars ) {
|
||||
si.cbSize = sizeof(si);
|
||||
si.fMask = SIF_POS;
|
||||
si.nPos = data->xPos;
|
||||
SetScrollInfo(hWnd, SB_HORZ, &si, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
/* map nethack map coordinates to the screen location */
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "mhinput.h"
|
||||
#include "mhfont.h"
|
||||
#include "mhcolor.h"
|
||||
#include "mhtxtbuf.h"
|
||||
|
||||
#define MENU_MARGIN 0
|
||||
#define NHMENU_STR_SIZE BUFSZ
|
||||
@@ -45,7 +46,7 @@ typedef struct mswin_nethack_menu_window {
|
||||
} menu;
|
||||
|
||||
struct menu_text {
|
||||
TCHAR* text;
|
||||
PNHTextBuffer text;
|
||||
} text;
|
||||
};
|
||||
int result;
|
||||
@@ -237,7 +238,12 @@ LRESULT CALLBACK MenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
|
||||
data = (PNHMenuWindow)GetWindowLong(hWnd, GWL_USERDATA);
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
case WM_INITDIALOG: {
|
||||
HWND text_control;
|
||||
HDC hDC;
|
||||
|
||||
text_control = GetDlgItem(hWnd, IDC_MENU_TEXT);
|
||||
|
||||
data = (PNHMenuWindow)malloc(sizeof(NHMenuWindow));
|
||||
ZeroMemory(data, sizeof(NHMenuWindow));
|
||||
data->type = MENU_TYPE_TEXT;
|
||||
@@ -250,14 +256,24 @@ LRESULT CALLBACK MenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
|
||||
SetWindowLong(hWnd, GWL_USERDATA, (LONG)data);
|
||||
|
||||
/* subclass edit control */
|
||||
editControlWndProc = (WNDPROC)GetWindowLong(GetDlgItem(hWnd, IDC_MENU_TEXT), GWL_WNDPROC);
|
||||
SetWindowLong(GetDlgItem(hWnd, IDC_MENU_TEXT), GWL_WNDPROC, (LONG)NHMenuTextWndProc);
|
||||
editControlWndProc = (WNDPROC)GetWindowLong(text_control, GWL_WNDPROC);
|
||||
SetWindowLong(text_control, GWL_WNDPROC, (LONG)NHMenuTextWndProc);
|
||||
|
||||
/* set text window font */
|
||||
hDC = GetDC(text_control);
|
||||
SendMessage(
|
||||
text_control,
|
||||
WM_SETFONT,
|
||||
(WPARAM)mswin_get_font(NHW_TEXT, ATR_NONE, hDC, FALSE),
|
||||
(LPARAM)0
|
||||
);
|
||||
ReleaseDC(text_control, hDC);
|
||||
|
||||
#if defined(WIN_CE_SMARTPHONE)
|
||||
/* special initialization for SmartPhone dialogs */
|
||||
NHSPhoneDialogSetup(hWnd, FALSE);
|
||||
NHSPhoneDialogSetup(hWnd, FALSE, GetNHApp()->bFullScreen);
|
||||
#endif
|
||||
break;
|
||||
} break;
|
||||
|
||||
case WM_MSNH_COMMAND:
|
||||
onMSNHCommand(hWnd, wParam, lParam);
|
||||
@@ -424,7 +440,10 @@ LRESULT CALLBACK MenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
|
||||
DeleteObject(data->bmpCheckedCount);
|
||||
DeleteObject(data->bmpNotChecked);
|
||||
if( data->type == MENU_TYPE_TEXT ) {
|
||||
if( data->text.text ) free(data->text.text);
|
||||
if( data->text.text ) {
|
||||
mswin_free_text_buffer(data->text.text);
|
||||
data->text.text = NULL;
|
||||
}
|
||||
}
|
||||
free(data);
|
||||
SetWindowLong(hWnd, GWL_USERDATA, (LONG)0);
|
||||
@@ -447,12 +466,12 @@ void CheckInputDialog(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
switch(message) {
|
||||
case WM_SETFOCUS:
|
||||
SHSipPreference(hWnd, SIP_UP);
|
||||
if( GetNHApp()->bUseSIP ) SHSipPreference(hWnd, SIP_UP);
|
||||
return;
|
||||
|
||||
case WM_DESTROY:
|
||||
case WM_KILLFOCUS:
|
||||
SHSipPreference(hWnd, SIP_DOWN);
|
||||
if( GetNHApp()->bUseSIP ) SHSipPreference(hWnd, SIP_DOWN);
|
||||
return;
|
||||
|
||||
case WM_NOTIFY:
|
||||
@@ -460,10 +479,10 @@ void CheckInputDialog(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
LPNMHDR lpnmhdr = (LPNMHDR)lParam;
|
||||
switch(lpnmhdr->code) {
|
||||
case NM_SETFOCUS:
|
||||
SHSipPreference(hWnd, SIP_UP);
|
||||
if( GetNHApp()->bUseSIP ) SHSipPreference(hWnd, SIP_UP);
|
||||
break;
|
||||
case NM_KILLFOCUS:
|
||||
SHSipPreference(hWnd, SIP_DOWN);
|
||||
if( GetNHApp()->bUseSIP ) SHSipPreference(hWnd, SIP_DOWN);
|
||||
break;
|
||||
}
|
||||
} return;
|
||||
@@ -471,10 +490,10 @@ void CheckInputDialog(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
case WM_COMMAND:
|
||||
switch(HIWORD(wParam)) {
|
||||
case BN_SETFOCUS:
|
||||
SHSipPreference(hWnd, SIP_UP);
|
||||
if( GetNHApp()->bUseSIP ) SHSipPreference(hWnd, SIP_UP);
|
||||
break;
|
||||
case BN_KILLFOCUS:
|
||||
SHSipPreference(hWnd, SIP_DOWN);
|
||||
if( GetNHApp()->bUseSIP ) SHSipPreference(hWnd, SIP_DOWN);
|
||||
break;
|
||||
}
|
||||
return;
|
||||
@@ -493,28 +512,22 @@ void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
PMSNHMsgPutstr msg_data = (PMSNHMsgPutstr)lParam;
|
||||
HWND text_view;
|
||||
TCHAR wbuf[BUFSZ];
|
||||
size_t text_size;
|
||||
|
||||
if( data->type!=MENU_TYPE_TEXT )
|
||||
SetMenuType(hWnd, MENU_TYPE_TEXT);
|
||||
|
||||
if( !data->text.text ) {
|
||||
text_size = strlen(msg_data->text) + 4;
|
||||
data->text.text = (TCHAR*)malloc(text_size*sizeof(data->text.text[0]));
|
||||
ZeroMemory(data->text.text, text_size*sizeof(data->text.text[0]));
|
||||
} else {
|
||||
text_size = _tcslen(data->text.text) + strlen(msg_data->text) + 4;
|
||||
data->text.text = (TCHAR*)realloc(data->text.text, text_size*sizeof(data->text.text[0]));
|
||||
data->text.text = mswin_init_text_buffer(
|
||||
program_state.gameover? FALSE : GetNHApp()->bWrapText
|
||||
);
|
||||
if( !data->text.text ) break;
|
||||
}
|
||||
if( !data->text.text ) break;
|
||||
|
||||
_tcscat(data->text.text, NH_A2W(msg_data->text, wbuf, BUFSZ));
|
||||
_tcscat(data->text.text, TEXT("\r\n"));
|
||||
mswin_add_text(data->text.text, msg_data->attr, msg_data->text);
|
||||
|
||||
text_view = GetDlgItem(hWnd, IDC_MENU_TEXT);
|
||||
if( !text_view ) panic("cannot get text view window");
|
||||
SetWindowText(text_view, data->text.text);
|
||||
mswin_render_text(data->text.text, text_view);
|
||||
} break;
|
||||
|
||||
case MSNH_MSG_STARTMENU:
|
||||
@@ -661,6 +674,12 @@ void LayoutMenu(HWND hWnd)
|
||||
sz_elem.cx = (clrt.right - clrt.left) - 2*MENU_MARGIN;
|
||||
sz_elem.cy = min(pt_cancel.y, pt_ok.y) - MENU_MARGIN - pt_elem.y;
|
||||
MoveWindow(GetMenuControl(hWnd), pt_elem.x, pt_elem.y, sz_elem.cx, sz_elem.cy, TRUE );
|
||||
|
||||
/* reformat text for the text menu */
|
||||
if( data &&
|
||||
data->type==MENU_TYPE_TEXT &&
|
||||
data->text.text )
|
||||
mswin_render_text(data->text.text, GetMenuControl(hWnd));
|
||||
}
|
||||
|
||||
void SetMenuType(HWND hWnd, int type)
|
||||
@@ -1136,10 +1155,12 @@ BOOL onListChar(HWND hWnd, HWND hwndList, WORD ch)
|
||||
case MENU_SEARCH:
|
||||
if( data->how==PICK_ANY || data->how==PICK_ONE ) {
|
||||
char buf[BUFSZ];
|
||||
int selected_item;
|
||||
|
||||
reset_menu_count(hwndList, data);
|
||||
mswin_getlin("Search for:", buf);
|
||||
if (!*buf || *buf == '\033') return -2;
|
||||
selected_item = -1;
|
||||
for(i=0; i<data->menu.size; i++ ) {
|
||||
if( NHMENU_IS_SELECTABLE(data->menu.items[i])
|
||||
&& strstr(data->menu.items[i].str, buf) ) {
|
||||
@@ -1150,6 +1171,8 @@ BOOL onListChar(HWND hWnd, HWND hwndList, WORD ch)
|
||||
i,
|
||||
NHMENU_IS_SELECTED(data->menu.items[i])? 0 : -1
|
||||
);
|
||||
/* save the first item - we will move focus to it */
|
||||
if( selected_item == -1 ) selected_item = i;
|
||||
} else if( data->how == PICK_ONE ) {
|
||||
SelectMenuItem(
|
||||
hwndList,
|
||||
@@ -1157,12 +1180,16 @@ BOOL onListChar(HWND hWnd, HWND hwndList, WORD ch)
|
||||
i,
|
||||
-1
|
||||
);
|
||||
ListView_SetItemState(hwndList, i, LVIS_FOCUSED, LVIS_FOCUSED);
|
||||
ListView_EnsureVisible(hwndList, i, FALSE);
|
||||
selected_item = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( selected_item>0 ) {
|
||||
ListView_SetItemState(hwndList, selected_item, LVIS_FOCUSED, LVIS_FOCUSED);
|
||||
ListView_EnsureVisible(hwndList, selected_item, FALSE);
|
||||
}
|
||||
} else {
|
||||
mswin_nhbell();
|
||||
}
|
||||
@@ -1353,14 +1380,8 @@ void mswin_menu_window_size (HWND hWnd, LPSIZE sz)
|
||||
}
|
||||
SelectObject(hdc, saveFont);
|
||||
} else {
|
||||
/* Calculate the width of the text box. */
|
||||
RECT text_rt;
|
||||
saveFont = SelectObject(hdc, mswin_get_font(NHW_MENU, ATR_NONE, hdc, FALSE));
|
||||
GetTextMetrics(hdc, &tm);
|
||||
SetRect(&text_rt, 0, 0, sz->cx, sz->cy);
|
||||
DrawText(hdc, data->text.text, _tcslen(data->text.text), &text_rt, DT_CALCRECT | DT_TOP | DT_LEFT | DT_NOPREFIX);
|
||||
sz->cx = max(sz->cx, text_rt.right - text_rt.left + 5*tm.tmAveCharWidth + tm.tmOverhang);
|
||||
SelectObject(hdc, saveFont);
|
||||
/* do not change size for text output - the text will be formatted to
|
||||
fit any window */
|
||||
}
|
||||
sz->cx += extra_cx;
|
||||
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
#include "mhmsg.h"
|
||||
#include "mhfont.h"
|
||||
#include "mhcolor.h"
|
||||
#include "mhtxtbuf.h"
|
||||
|
||||
typedef struct mswin_nethack_text_window {
|
||||
TCHAR* window_text;
|
||||
PNHTextBuffer window_text;
|
||||
int done;
|
||||
} NHTextWindow, *PNHTextWindow;
|
||||
|
||||
@@ -35,6 +36,9 @@ HWND mswin_init_text_window () {
|
||||
if( !data ) panic("out of memory");
|
||||
|
||||
ZeroMemory(data, sizeof(NHTextWindow));
|
||||
data->window_text = mswin_init_text_buffer(
|
||||
program_state.gameover? FALSE : GetNHApp()->bWrapText
|
||||
);
|
||||
SetWindowLong(ret, GWL_USERDATA, (LONG)data);
|
||||
return ret;
|
||||
}
|
||||
@@ -44,11 +48,11 @@ void mswin_display_text_window (HWND hWnd)
|
||||
PNHTextWindow data;
|
||||
|
||||
data = (PNHTextWindow)GetWindowLong(hWnd, GWL_USERDATA);
|
||||
if( data && data->window_text ) {
|
||||
if( data ) {
|
||||
HWND control;
|
||||
control = GetDlgItem(hWnd, IDC_TEXT_CONTROL);
|
||||
SendMessage(control, EM_FMTLINES, 1, 0 );
|
||||
SetWindowText(GetDlgItem(hWnd, IDC_TEXT_CONTROL), data->window_text);
|
||||
mswin_render_text(data->window_text, GetDlgItem(hWnd, IDC_TEXT_CONTROL));
|
||||
|
||||
data->done = 0;
|
||||
mswin_popup_display(hWnd, &data->done);
|
||||
@@ -78,12 +82,22 @@ LRESULT CALLBACK TextWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
|
||||
|
||||
#if defined(WIN_CE_SMARTPHONE)
|
||||
/* special initialization for SmartPhone dialogs */
|
||||
NHSPhoneDialogSetup(hWnd, FALSE);
|
||||
NHSPhoneDialogSetup(hWnd, FALSE, GetNHApp()->bFullScreen);
|
||||
#endif
|
||||
/* subclass edit control */
|
||||
editControlWndProc = (WNDPROC)GetWindowLong(control, GWL_WNDPROC);
|
||||
SetWindowLong(control, GWL_WNDPROC, (LONG)NHTextControlWndProc);
|
||||
|
||||
if( !program_state.gameover && GetNHApp()->bWrapText ) {
|
||||
DWORD styles;
|
||||
styles = GetWindowLong(control, GWL_STYLE);
|
||||
if( styles ) {
|
||||
SetWindowLong(control, GWL_STYLE, styles & (~WS_HSCROLL));
|
||||
SetWindowPos(control, NULL, 0, 0, 0, 0,
|
||||
SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE );
|
||||
}
|
||||
}
|
||||
|
||||
SetFocus(control);
|
||||
return FALSE;
|
||||
|
||||
@@ -119,7 +133,7 @@ LRESULT CALLBACK TextWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
|
||||
|
||||
case WM_DESTROY:
|
||||
if( data ) {
|
||||
if( data->window_text ) free(data->window_text);
|
||||
mswin_free_text_buffer(data->window_text);
|
||||
free(data);
|
||||
SetWindowLong(hWnd, GWL_USERDATA, (LONG)0);
|
||||
}
|
||||
@@ -137,21 +151,7 @@ void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
switch( wParam ) {
|
||||
case MSNH_MSG_PUTSTR: {
|
||||
PMSNHMsgPutstr msg_data = (PMSNHMsgPutstr)lParam;
|
||||
TCHAR wbuf[NHSTR_BUFSIZE];
|
||||
size_t text_size;
|
||||
|
||||
if( !data->window_text ) {
|
||||
text_size = strlen(msg_data->text) + 4;
|
||||
data->window_text = (TCHAR*)malloc(text_size*sizeof(data->window_text[0]));
|
||||
ZeroMemory(data->window_text, text_size*sizeof(data->window_text[0]));
|
||||
} else {
|
||||
text_size = _tcslen(data->window_text) + strlen(msg_data->text) + 4;
|
||||
data->window_text = (TCHAR*)realloc(data->window_text, text_size*sizeof(data->window_text[0]));
|
||||
}
|
||||
if( !data->window_text ) break;
|
||||
|
||||
_tcscat(data->window_text, NH_A2W(msg_data->text, wbuf, NHSTR_BUFSIZE));
|
||||
_tcscat(data->window_text, TEXT("\r\n"));
|
||||
mswin_add_text(data->window_text, msg_data->attr, msg_data->text);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
237
sys/wince/mhtxtbuf.c
Normal file
237
sys/wince/mhtxtbuf.c
Normal file
@@ -0,0 +1,237 @@
|
||||
/* Copyright (C) 2003 by Alex Kompel <shurikk@pacbell.net> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#include "mhtxtbuf.h"
|
||||
|
||||
/* Collect Nethack text messages and render text into edit box.
|
||||
Wrap text if necessary.
|
||||
Recognize formatted lines as having more that 4 consecutive.
|
||||
spaces inside the string.
|
||||
Strip leading and trailing spaces.
|
||||
Always break at the original line end (do not merge text that comes
|
||||
from NetHack engine)
|
||||
*/
|
||||
|
||||
/*----------------------------------------------------------------*/
|
||||
#define NHTEXT_BUFFER_INCREMENT 10
|
||||
/*----------------------------------------------------------------*/
|
||||
struct text_buffer_line {
|
||||
int attr;
|
||||
short beg_padding;
|
||||
short end_padding;
|
||||
BOOL formatted;
|
||||
char* text;
|
||||
};
|
||||
/*----------------------------------------------------------------*/
|
||||
typedef struct mswin_nethack_text_buffer {
|
||||
BOOL b_wrap_text;
|
||||
int n_size;
|
||||
int n_used;
|
||||
struct text_buffer_line *text_buffer_line;
|
||||
} NHTextBuffer, *PNHTextBuffer;
|
||||
/*----------------------------------------------------------------*/
|
||||
#define NHTextLine(pb,i) ((pb)->text_buffer_line[(i)])
|
||||
static TCHAR* nh_append( TCHAR* s, int* size, const char* ap );
|
||||
/*----------------------------------------------------------------*/
|
||||
PNHTextBuffer mswin_init_text_buffer(BOOL wrap_text)
|
||||
{
|
||||
PNHTextBuffer pb = (PNHTextBuffer)malloc(sizeof(NHTextBuffer));
|
||||
if( !pb ) panic("Out of memory");
|
||||
|
||||
ZeroMemory(pb, sizeof(NHTextBuffer));
|
||||
pb->b_wrap_text = wrap_text;
|
||||
pb->n_size = 0;
|
||||
pb->n_used = 0;
|
||||
pb->text_buffer_line = NULL;
|
||||
return pb;
|
||||
}
|
||||
/*----------------------------------------------------------------*/
|
||||
void mswin_free_text_buffer(PNHTextBuffer pb)
|
||||
{
|
||||
int i;
|
||||
|
||||
if( !pb ) return;
|
||||
|
||||
for(i=0; i<pb->n_used; i++ ) {
|
||||
free(pb->text_buffer_line[i].text);
|
||||
}
|
||||
free( pb->text_buffer_line );
|
||||
free( pb );
|
||||
}
|
||||
/*----------------------------------------------------------------*/
|
||||
void mswin_add_text(PNHTextBuffer pb, int attr, const char* text)
|
||||
{
|
||||
char* p;
|
||||
struct text_buffer_line* new_line;
|
||||
|
||||
/* grow buffer */
|
||||
if( pb->n_used >= pb->n_size ) {
|
||||
pb->n_size += NHTEXT_BUFFER_INCREMENT;
|
||||
pb->text_buffer_line =
|
||||
(struct text_buffer_line*)realloc( pb->text_buffer_line, pb->n_size*sizeof(struct text_buffer_line) );
|
||||
if( !pb->text_buffer_line ) panic("Memory allocation error");
|
||||
}
|
||||
|
||||
/* analyze the new line of text */
|
||||
new_line = &NHTextLine(pb, pb->n_used);
|
||||
new_line->attr = attr;
|
||||
new_line->beg_padding = 0;
|
||||
new_line->text = strdup(text);
|
||||
for( p = new_line->text; *p && isspace(*p); p++ ) {
|
||||
new_line->beg_padding++;
|
||||
}
|
||||
if( *p ) {
|
||||
memmove(new_line->text,
|
||||
new_line->text + new_line->beg_padding,
|
||||
strlen(new_line->text) - new_line->beg_padding + 1
|
||||
);
|
||||
for( p = new_line->text+strlen(new_line->text);
|
||||
p>=new_line->text && isspace(*p);
|
||||
p-- ) {
|
||||
new_line->end_padding++;
|
||||
*p = 0;
|
||||
}
|
||||
|
||||
/* if there are 3 (or more) consecutive spaces inside the string
|
||||
consider it formatted */
|
||||
new_line->formatted = (strstr(new_line->text, " ")!=NULL);
|
||||
} else {
|
||||
new_line->end_padding = 0;
|
||||
new_line->text[0] = 0;
|
||||
new_line->formatted = FALSE;
|
||||
}
|
||||
pb->n_used++;
|
||||
}
|
||||
/*----------------------------------------------------------------*/
|
||||
static TCHAR* nh_append( TCHAR* s, int* size, const char* ap )
|
||||
{
|
||||
int tlen, tnewlen;
|
||||
|
||||
if( !(ap && *ap) ) return s;
|
||||
|
||||
/* append the calculated line to the text buffer */
|
||||
tlen = s? _tcslen(s) : 0;
|
||||
tnewlen = tlen+strlen(ap);
|
||||
if( tnewlen>=*size ) {
|
||||
*size = max(tnewlen, *size + BUFSZ);
|
||||
s = (TCHAR*)realloc(s, *size * sizeof(TCHAR));
|
||||
if( !s ) panic("Out of memory");
|
||||
ZeroMemory(s+tlen, (*size-tlen)*sizeof(TCHAR));
|
||||
}
|
||||
if( strcmp(ap, "\r\n")==0 ) {
|
||||
_tcscat(s, TEXT("\r\n"));
|
||||
} else {
|
||||
NH_A2W(ap, s+tlen, strlen(ap));
|
||||
s[tnewlen] = 0;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
/*----------------------------------------------------------------*/
|
||||
void mswin_render_text(PNHTextBuffer pb, HWND edit_control)
|
||||
{
|
||||
RECT rt_client; /* boundaries of the client area of the edit control */
|
||||
SIZE size_text; /* size of the edit control */
|
||||
RECT rt_text; /* calculated text rectangle for the visible line */
|
||||
char buf[BUFSZ]; /* buffer for the visible line */
|
||||
TCHAR tbuf[BUFSZ]; /* temp buffer for DrawText */
|
||||
TCHAR* pText = NULL; /* resulting text (formatted) */
|
||||
int pTextSize = 0; /* resulting text size */
|
||||
char* p_cur = NULL; /* current position in the NHTextBuffer->text_buffer_line->text */
|
||||
char* p_buf_cur = NULL; /* current position in the visible line buffer */
|
||||
int i;
|
||||
HDC hdcEdit; /* device context for the edit control */
|
||||
HFONT hFont, hOldFont; /* edit control font */
|
||||
|
||||
GetClientRect(edit_control, &rt_client );
|
||||
size_text.cx = rt_client.right - rt_client.left;
|
||||
size_text.cy = rt_client.bottom - rt_client.top;
|
||||
size_text.cx -= GetSystemMetrics(SM_CXVSCROLL); /* add a slight right margin - the text looks better that way */
|
||||
hdcEdit = GetDC(edit_control);
|
||||
hFont = (HFONT)SendMessage(edit_control, WM_GETFONT, 0, 0);
|
||||
if( hFont ) hOldFont = SelectObject(hdcEdit, hFont);
|
||||
|
||||
/* loop through each line (outer loop) and wrap it around (inner loop) */
|
||||
ZeroMemory(buf, sizeof(buf));
|
||||
p_buf_cur = buf;
|
||||
for( i=0; i<pb->n_used; i++ ) {
|
||||
if( pb->b_wrap_text ) {
|
||||
p_cur = NHTextLine(pb,i).text;
|
||||
|
||||
/* insert an line break for the empty string */
|
||||
if( !NHTextLine(pb,i).text[0] ) {
|
||||
pText = nh_append(pText, &pTextSize, "\r\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
/* add margin to the "formatted" line of text */
|
||||
if( NHTextLine(pb,i).formatted ) {
|
||||
strcpy(buf, " ");
|
||||
p_buf_cur += 3;
|
||||
}
|
||||
|
||||
/* scroll thourgh the current line of text and wrap it
|
||||
so it fits to width of the edit control */
|
||||
while( *p_cur ) {
|
||||
char *p_word_pos = p_buf_cur;
|
||||
|
||||
/* copy one word into the buffer */
|
||||
while( *p_cur && isspace(*p_cur) )
|
||||
if( p_buf_cur!=buf ) *p_buf_cur++ = *p_cur++;
|
||||
else p_cur++;
|
||||
|
||||
while( *p_cur && !isspace(*p_cur) )
|
||||
*p_buf_cur++ = *p_cur++;
|
||||
|
||||
/* check if it fits */
|
||||
SetRect( &rt_text, 0, 0, size_text.cx, size_text.cy );
|
||||
DrawText(hdcEdit, NH_A2W(buf, tbuf, p_buf_cur-buf), p_buf_cur-buf, &rt_text, DT_CALCRECT | DT_LEFT | DT_SINGLELINE | DT_NOCLIP);
|
||||
if( (rt_text.right - rt_text.left)>=size_text.cx ) {
|
||||
/* Backtrack.
|
||||
Only backtrack if the last word caused the overflow -
|
||||
do not backtrack if the entire current line does not fit the visible area.
|
||||
Otherwise it is a infinite loop.
|
||||
*/
|
||||
if( p_word_pos>buf ) {
|
||||
p_cur -= (p_buf_cur-p_word_pos);
|
||||
p_buf_cur = p_word_pos;
|
||||
}
|
||||
*p_buf_cur = 0; /* break the line */
|
||||
|
||||
/* append the calculated line to the text buffer */
|
||||
pText = nh_append(pText, &pTextSize, buf);
|
||||
pText = nh_append(pText, &pTextSize, "\r\n");
|
||||
ZeroMemory(buf, sizeof(buf));
|
||||
p_buf_cur = buf;
|
||||
}
|
||||
}
|
||||
|
||||
/* always break the line at the end of the buffer text */
|
||||
if( p_buf_cur != buf ) {
|
||||
/* flush the current buffrer */
|
||||
*p_buf_cur = 0; /* break the line */
|
||||
pText = nh_append(pText, &pTextSize, buf);
|
||||
pText = nh_append(pText, &pTextSize, "\r\n");
|
||||
ZeroMemory(buf, sizeof(buf));
|
||||
p_buf_cur = buf;
|
||||
}
|
||||
} else { /* do not wrap text */
|
||||
int j;
|
||||
for( j=0; j<NHTextLine(pb,i).beg_padding; j++ )
|
||||
pText = nh_append(pText, &pTextSize, " ");
|
||||
pText = nh_append(pText, &pTextSize, NHTextLine(pb,i).text);
|
||||
pText = nh_append(pText, &pTextSize, "\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* cleanup */
|
||||
if( hFont ) SelectObject(hdcEdit, hOldFont);
|
||||
ReleaseDC(edit_control, hdcEdit);
|
||||
|
||||
/* update edit control text */
|
||||
if( pText ) {
|
||||
SendMessage(edit_control, EM_FMTLINES, 1, 0 );
|
||||
SetWindowText(edit_control, pText);
|
||||
free(pText);
|
||||
}
|
||||
}
|
||||
/*----------------------------------------------------------------*/
|
||||
15
sys/wince/mhtxtbuf.h
Normal file
15
sys/wince/mhtxtbuf.h
Normal file
@@ -0,0 +1,15 @@
|
||||
/* Copyright (C) 2001 by Alex Kompel <shurikk@pacbell.net> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef MSWINTextBuffer_h
|
||||
#define MSWINTextBuffer_h
|
||||
|
||||
#include "winMS.h"
|
||||
|
||||
typedef struct mswin_nethack_text_buffer* PNHTextBuffer;
|
||||
PNHTextBuffer mswin_init_text_buffer(BOOL wrap_text);
|
||||
void mswin_free_text_buffer(PNHTextBuffer pb);
|
||||
void mswin_add_text(PNHTextBuffer pb, int attr, const char* text);
|
||||
void mswin_render_text(PNHTextBuffer pb, HWND edit_control);
|
||||
|
||||
#endif /* MSWINTextBuffer_h */
|
||||
@@ -45,7 +45,7 @@ struct window_procs mswin_procs = {
|
||||
WC_FONTSIZ_MESSAGE|WC_FONTSIZ_STATUS|WC_FONTSIZ_MENU|WC_FONTSIZ_TEXT|
|
||||
WC_TILE_WIDTH|WC_TILE_HEIGHT|WC_TILE_FILE|WC_VARY_MSGCOUNT|
|
||||
WC_WINDOWCOLORS|WC_PLAYER_SELECTION,
|
||||
0L,
|
||||
WC2_FULLSCREEN|WC2_SOFTKEYBOARD|WC2_WRAPTEXT,
|
||||
mswin_init_nhwindows,
|
||||
mswin_player_selection,
|
||||
mswin_askname,
|
||||
@@ -127,6 +127,9 @@ void mswin_init_nhwindows(int* argc, char** argv)
|
||||
/* intialize input subsystem */
|
||||
mswin_nh_input_init();
|
||||
|
||||
/* read registry settings */
|
||||
mswin_read_reg();
|
||||
|
||||
/* set it to WIN_ERR so we can detect attempts to
|
||||
use this ID before it is inialized */
|
||||
WIN_MAP = WIN_ERR;
|
||||
@@ -196,6 +199,21 @@ void mswin_init_nhwindows(int* argc, char** argv)
|
||||
SET_IN_GAME
|
||||
);
|
||||
|
||||
/* WC2 options */
|
||||
set_wc2_option_mod_status(
|
||||
WC2_FULLSCREEN|
|
||||
WC2_SOFTKEYBOARD,
|
||||
SET_IN_FILE
|
||||
);
|
||||
GetNHApp()->bFullScreen = iflags.wc2_fullscreen;
|
||||
GetNHApp()->bUseSIP = iflags.wc2_softkeyboard;
|
||||
|
||||
set_wc2_option_mod_status(
|
||||
WC2_WRAPTEXT,
|
||||
SET_IN_GAME
|
||||
);
|
||||
GetNHApp()->bWrapText = iflags.wc2_wraptext;
|
||||
|
||||
/* create the main nethack window */
|
||||
hWnd = mswin_init_main_window();
|
||||
if (!hWnd) panic( "Cannot create the main window." );
|
||||
@@ -203,6 +221,9 @@ void mswin_init_nhwindows(int* argc, char** argv)
|
||||
UpdateWindow(hWnd);
|
||||
GetNHApp()->hMainWnd = hWnd;
|
||||
|
||||
/* set Full screen if requested */
|
||||
mswin_set_fullscreen(GetNHApp()->bFullScreen);
|
||||
|
||||
/* let nethack code know that the window subsystem is ready */
|
||||
iflags.window_inited = TRUE;
|
||||
}
|
||||
@@ -654,6 +675,9 @@ void mswin_exit_nhwindows(const char *str)
|
||||
{
|
||||
logDebug("mswin_exit_nhwindows(%s)\n", str);
|
||||
|
||||
/* Write Window settings to the registry */
|
||||
mswin_write_reg();
|
||||
|
||||
// Don't do any of this (?) - exit_nhwindows does not terminate
|
||||
// the application
|
||||
// DestroyWindow(GetNHApp()->hMainWnd);
|
||||
@@ -1650,6 +1674,22 @@ void mswin_preference_update(const char *pref)
|
||||
mswin_layout_main_window(NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if( _stricmp( pref, "fullscreen")==0 ) {
|
||||
mswin_set_fullscreen(iflags.wc2_fullscreen);
|
||||
return;
|
||||
}
|
||||
|
||||
if( _stricmp( pref, "softkeyboard")==0 ) {
|
||||
GetNHApp()->bUseSIP = iflags.wc2_softkeyboard;
|
||||
return;
|
||||
}
|
||||
|
||||
if( _stricmp( pref, "wraptext")==0 ) {
|
||||
GetNHApp()->bWrapText = iflags.wc2_wraptext;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void mswin_main_loop()
|
||||
@@ -1800,8 +1840,41 @@ void mswin_popup_destroy(HWND hWnd)
|
||||
SetFocus(GetNHApp()->hMainWnd );
|
||||
}
|
||||
|
||||
void mswin_set_fullscreen(BOOL is_fullscreen)
|
||||
{
|
||||
#if defined(WIN_CE_POCKETPC) || defined(WIN_CE_SMARTPHONE)
|
||||
SetForegroundWindow(GetNHApp()->hMainWnd);
|
||||
if( is_fullscreen ) {
|
||||
SHFullScreen(GetNHApp()->hMainWnd, SHFS_HIDETASKBAR | SHFS_HIDESTARTICON);
|
||||
MoveWindow(
|
||||
GetNHApp()->hMainWnd,
|
||||
0,
|
||||
0,
|
||||
GetSystemMetrics(SM_CXSCREEN),
|
||||
GetSystemMetrics(SM_CYSCREEN),
|
||||
FALSE
|
||||
);
|
||||
} else {
|
||||
RECT rc;
|
||||
SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, 0);
|
||||
SHFullScreen(GetNHApp()->hMainWnd, SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON);
|
||||
MoveWindow(
|
||||
GetNHApp()->hMainWnd,
|
||||
rc.left,
|
||||
rc.top,
|
||||
rc.right - rc.left,
|
||||
rc.bottom - rc.top,
|
||||
FALSE
|
||||
);
|
||||
}
|
||||
GetNHApp()->bFullScreen = is_fullscreen;
|
||||
#else
|
||||
GetNHApp()->bFullScreen = FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(WIN_CE_SMARTPHONE)
|
||||
void NHSPhoneDialogSetup(HWND hDlg, BOOL is_edit)
|
||||
void NHSPhoneDialogSetup(HWND hDlg, BOOL is_edit, BOOL is_fullscreen)
|
||||
{
|
||||
SHMENUBARINFO mbi;
|
||||
HWND hOK, hCancel;
|
||||
@@ -1817,6 +1890,25 @@ void NHSPhoneDialogSetup(HWND hDlg, BOOL is_edit)
|
||||
error("cannot create dialog menu");
|
||||
}
|
||||
|
||||
if(is_fullscreen) {
|
||||
SHINITDLGINFO shidi;
|
||||
RECT main_wnd_rect;
|
||||
shidi.dwMask = SHIDIM_FLAGS;
|
||||
shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;
|
||||
shidi.hDlg = hDlg;
|
||||
SHInitDialog(&shidi);
|
||||
|
||||
GetWindowRect(GetNHApp()->hMainWnd, &main_wnd_rect);
|
||||
MoveWindow(
|
||||
hDlg,
|
||||
main_wnd_rect.left,
|
||||
main_wnd_rect.top,
|
||||
main_wnd_rect.right - main_wnd_rect.left,
|
||||
main_wnd_rect.bottom - main_wnd_rect.top,
|
||||
FALSE
|
||||
);
|
||||
}
|
||||
|
||||
/* hide OK and CANCEL buttons */
|
||||
hOK = GetDlgItem(hDlg, IDOK);
|
||||
hCancel = GetDlgItem(hDlg, IDCANCEL);
|
||||
@@ -1840,6 +1932,17 @@ void NHSPhoneDialogSetup(HWND hDlg, BOOL is_edit)
|
||||
}
|
||||
#endif /* defined(WIN_CE_SMARTPHONE) */
|
||||
|
||||
void mswin_read_reg(void)
|
||||
{
|
||||
}
|
||||
|
||||
void mswin_destroy_reg(void)
|
||||
{
|
||||
}
|
||||
|
||||
void mswin_write_reg(void)
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
#include <stdarg.h>
|
||||
|
||||
32579
sys/wince/palmpc.vcp
32579
sys/wince/palmpc.vcp
File diff suppressed because it is too large
Load Diff
40191
sys/wince/pocketpc.vcp
40191
sys/wince/pocketpc.vcp
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by winhack_sp.rc
|
||||
// Used by winhack.rc
|
||||
//
|
||||
#define IDC_MYICON 2
|
||||
#define IDD_WINHACK_DIALOG 102
|
||||
@@ -26,6 +26,7 @@
|
||||
#define IDB_PETMARK 145
|
||||
#define IDB_MENU_SEL_COUNT 146
|
||||
#define IDB_KEYPAD 147
|
||||
#define IDB_MENUBAR 154
|
||||
#define IDC_TEXT_VIEW 1001
|
||||
#define IDC_CMD_MOVE_NW 1001
|
||||
#define IDC_CMD_MOVE_N 1002
|
||||
@@ -144,13 +145,14 @@
|
||||
#define IDS_CAP_ENTIREMAP 32826
|
||||
#define IDS_CAP_NORMALMAP 32827
|
||||
#define IDM_HELP_MENU 32828
|
||||
#define IDM_VIEW_OPTIONS 32829
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 153
|
||||
#define _APS_NEXT_COMMAND_VALUE 32829
|
||||
#define _APS_NEXT_RESOURCE_VALUE 155
|
||||
#define _APS_NEXT_COMMAND_VALUE 32830
|
||||
#define _APS_NEXT_CONTROL_VALUE 1334
|
||||
#define _APS_NEXT_SYMED_VALUE 110
|
||||
#endif
|
||||
|
||||
17126
sys/wince/smartphn.vcp
17126
sys/wince/smartphn.vcp
File diff suppressed because it is too large
Load Diff
@@ -33,6 +33,9 @@
|
||||
#include <sipapi.h>
|
||||
#endif
|
||||
|
||||
/* Taskbar Menu height */
|
||||
#define MENU_HEIGHT 26
|
||||
|
||||
/* Create an array to keep track of the various windows */
|
||||
|
||||
#ifndef MAXWINDOWS
|
||||
@@ -92,6 +95,12 @@ typedef struct mswin_nhwindow_app {
|
||||
|
||||
int bCmdPad; /* command pad - on-screen keyboard */
|
||||
HWND hCmdWnd; /* handle of on-screen keyboard window */
|
||||
|
||||
/* options */
|
||||
boolean bWrapText; /* format text to fit the window */
|
||||
boolean bFullScreen;/* run nethack in full-screen mode */
|
||||
boolean bHideScrollBars; /* hide scroll bars */
|
||||
boolean bUseSIP; /* use SIP (built-in software keyboard) for menus (PocketPC only) */
|
||||
} NHWinApp, *PNHWinApp;
|
||||
extern PNHWinApp GetNHApp();
|
||||
|
||||
@@ -162,7 +171,12 @@ void mswin_popup_display(HWND popup, int* done_indicator);
|
||||
void mswin_popup_destroy(HWND popup);
|
||||
|
||||
#if defined(WIN_CE_SMARTPHONE)
|
||||
void NHSPhoneDialogSetup(HWND hDlg, BOOL is_edit);
|
||||
void NHSPhoneDialogSetup(HWND hDlg, BOOL is_edit, BOOL is_fullscreen);
|
||||
#endif
|
||||
|
||||
void mswin_read_reg(void);
|
||||
void mswin_destroy_reg(void);
|
||||
void mswin_write_reg(void);
|
||||
|
||||
void mswin_set_fullscreen(BOOL is_fullscreen);
|
||||
#endif /* WINmswin_H */
|
||||
|
||||
@@ -68,12 +68,24 @@ int APIENTRY WinMain(HINSTANCE hInstance,
|
||||
_nethack_app.mapTilesPerLine = TILES_PER_LINE;
|
||||
_nethack_app.bNoHScroll = FALSE;
|
||||
_nethack_app.bNoVScroll = FALSE;
|
||||
|
||||
#if defined(WIN_CE_PS2xx) || defined(WIN_CE_POCKETPC) || defined(WIN_CE_SMARTPHONE)
|
||||
_nethack_app.bCmdPad = TRUE;
|
||||
#else
|
||||
_nethack_app.bCmdPad = FALSE;
|
||||
#endif
|
||||
|
||||
_nethack_app.bWrapText = TRUE;
|
||||
_nethack_app.bFullScreen = TRUE;
|
||||
|
||||
#if defined(WIN_CE_SMARTPHONE)
|
||||
_nethack_app.bHideScrollBars = TRUE;
|
||||
#else
|
||||
_nethack_app.bHideScrollBars = FALSE;
|
||||
#endif
|
||||
|
||||
_nethack_app.bUseSIP = TRUE;
|
||||
|
||||
// check for running nethack programs
|
||||
nethackWnd = FindWindow(szMainWindowClass, NULL);
|
||||
if( nethackWnd ) {
|
||||
|
||||
@@ -28,7 +28,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_WINHACK ICON DISCARDABLE "NETHACK.ICO"
|
||||
IDI_WINHACK ICON DISCARDABLE "..\\..\\wince\\NETHACK.ICO"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -61,6 +61,7 @@ BEGIN
|
||||
POPUP "View"
|
||||
BEGIN
|
||||
MENUITEM "&Keypad", IDM_VIEW_KEYPAD
|
||||
MENUITEM "&Options", IDM_VIEW_OPTIONS
|
||||
END
|
||||
POPUP "Help"
|
||||
BEGIN
|
||||
@@ -211,12 +212,13 @@ END
|
||||
// Bitmap
|
||||
//
|
||||
|
||||
IDB_TILES BITMAP DISCARDABLE "tiles.bmp"
|
||||
IDB_MENU_SEL BITMAP DISCARDABLE "mnsel.bmp"
|
||||
IDB_MENU_UNSEL BITMAP DISCARDABLE "mnunsel.bmp"
|
||||
IDB_PETMARK BITMAP DISCARDABLE "petmark.bmp"
|
||||
IDB_MENU_SEL_COUNT BITMAP DISCARDABLE "mnselcnt.bmp"
|
||||
IDB_KEYPAD BITMAP DISCARDABLE "keypad.bmp"
|
||||
IDB_TILES BITMAP DISCARDABLE "..\\..\\wince\\tiles.bmp"
|
||||
IDB_MENU_SEL BITMAP DISCARDABLE "..\\..\\wince\\mnsel.bmp"
|
||||
IDB_MENU_UNSEL BITMAP DISCARDABLE "..\\..\\wince\\mnunsel.bmp"
|
||||
IDB_PETMARK BITMAP DISCARDABLE "..\\..\\wince\\petmark.bmp"
|
||||
IDB_MENU_SEL_COUNT BITMAP DISCARDABLE "..\\..\\wince\\mnselcnt.bmp"
|
||||
IDB_KEYPAD BITMAP DISCARDABLE "..\\..\\wince\\keypad.bmp"
|
||||
IDB_MENUBAR BITMAP DISCARDABLE "..\\..\\wince\\menubar.bmp"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -247,7 +249,6 @@ BEGIN
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 107
|
||||
END
|
||||
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
@@ -259,7 +260,7 @@ END
|
||||
|
||||
IDC_WINHACK SHMENUBAR DISCARDABLE
|
||||
BEGIN
|
||||
IDC_WINHACK, 4,
|
||||
IDC_WINHACK, 6,
|
||||
I_IMAGENONE, ID_FILE, TBSTATE_ENABLED,
|
||||
TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_FILE, 0, 0,
|
||||
I_IMAGENONE, ID_MAP, TBSTATE_ENABLED,
|
||||
@@ -268,8 +269,13 @@ BEGIN
|
||||
TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_VIEW, 0, 2,
|
||||
I_IMAGENONE, ID_HELP, TBSTATE_ENABLED,
|
||||
TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_HELP, 0, 3,
|
||||
0, IDM_MAP_FIT_TO_SCREEN, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE, 0,
|
||||
IDM_MAP_FIT_TO_SCREEN, NOMENU,
|
||||
1, IDM_VIEW_KEYPAD, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE, 0,
|
||||
IDM_VIEW_KEYPAD, NOMENU,
|
||||
END
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -329,6 +335,7 @@ END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDM_MAP_FIT_TO_SCREEN "Fit to Screen"
|
||||
IDS_CAP_FILE "File"
|
||||
IDS_CAP_HELP "Help"
|
||||
IDS_CAP_MAP "Map"
|
||||
|
||||
@@ -28,7 +28,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_WINHACK ICON DISCARDABLE "NETHACK.ICO"
|
||||
IDI_WINHACK ICON DISCARDABLE "..\\..\\wince\\NETHACK.ICO"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -40,6 +40,7 @@ BEGIN
|
||||
MENUITEM "Entire Map", IDM_MAP_FIT_TO_SCREEN
|
||||
POPUP "Menu"
|
||||
BEGIN
|
||||
MENUITEM "Options", IDM_VIEW_OPTIONS
|
||||
MENUITEM "Keypad", IDM_VIEW_KEYPAD
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "ASCII", IDM_MAP_ASCII8X8
|
||||
@@ -184,12 +185,12 @@ END
|
||||
// Bitmap
|
||||
//
|
||||
|
||||
IDB_TILES BITMAP DISCARDABLE "tiles.bmp"
|
||||
IDB_MENU_SEL BITMAP DISCARDABLE "mnsel.bmp"
|
||||
IDB_MENU_UNSEL BITMAP DISCARDABLE "mnunsel.bmp"
|
||||
IDB_PETMARK BITMAP DISCARDABLE "petmark.bmp"
|
||||
IDB_MENU_SEL_COUNT BITMAP DISCARDABLE "mnselcnt.bmp"
|
||||
IDB_KEYPAD BITMAP DISCARDABLE "keypad.bmp"
|
||||
IDB_TILES BITMAP DISCARDABLE "..\\..\\wince\\tiles.bmp"
|
||||
IDB_MENU_SEL BITMAP DISCARDABLE "..\\..\\wince\\mnsel.bmp"
|
||||
IDB_MENU_UNSEL BITMAP DISCARDABLE "..\\..\\wince\\mnunsel.bmp"
|
||||
IDB_PETMARK BITMAP DISCARDABLE "..\\..\\wince\\petmark.bmp"
|
||||
IDB_MENU_SEL_COUNT BITMAP DISCARDABLE "..\\..\\wince\\mnselcnt.bmp"
|
||||
IDB_KEYPAD BITMAP DISCARDABLE "..\\..\\wince\\keypad.bmp"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -231,7 +232,7 @@ END
|
||||
IDC_WINHACK SHMENUBAR DISCARDABLE
|
||||
BEGIN
|
||||
IDC_WINHACK, 2,
|
||||
I_IMAGENONE, IDM_MAP_FIT_TO_SCREEN, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE, IDM_MAP_FIT_TO_SCREEN, 0, NOMENU,
|
||||
I_IMAGENONE, IDM_MAP_FIT_TO_SCREEN, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE, IDM_MAP_FIT_TO_SCREEN, 0, NOMENU,
|
||||
I_IMAGENONE, ID_VIEW, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_VIEW, 0, 1,
|
||||
END
|
||||
|
||||
|
||||
Reference in New Issue
Block a user