wince (from <Someone>)
This is a follow-up patch on view/hide keypad menu option. It fixes some stuff specific to PocketPC menus.
This commit is contained in:
@@ -32,7 +32,7 @@ static void register_main_window_class();
|
||||
static void select_map_mode(int map_mode);
|
||||
static int menuid2mapmode(int menuid);
|
||||
static int mapmode2menuid(int map_mode);
|
||||
static HMENU _get_main_menu();
|
||||
static HMENU _get_main_menu(UINT menu_id);
|
||||
|
||||
HWND mswin_init_main_window () {
|
||||
static int run_once = 0;
|
||||
@@ -184,6 +184,12 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
|
||||
GetNHApp()->hMenuBar, GetNHApp()->hApp,
|
||||
IDC_WINHACK, 0 );
|
||||
#endif
|
||||
CheckMenuItem(
|
||||
_get_main_menu(ID_VIEW),
|
||||
IDM_VIEW_KEYPAD,
|
||||
MF_BYCOMMAND |
|
||||
(GetNHApp()->bCmdPad? MF_CHECKED : MF_UNCHECKED)
|
||||
);
|
||||
|
||||
/* create command pad (keyboard emulator) */
|
||||
data->hCmdWnd = mswin_init_command_window();
|
||||
@@ -735,7 +741,7 @@ LRESULT onWMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_VIEW_KEYPAD:
|
||||
GetNHApp()->bCmdPad = !GetNHApp()->bCmdPad;
|
||||
CheckMenuItem(
|
||||
_get_main_menu(),
|
||||
_get_main_menu(ID_VIEW),
|
||||
IDM_VIEW_KEYPAD,
|
||||
MF_BYCOMMAND |
|
||||
(GetNHApp()->bCmdPad? MF_CHECKED : MF_UNCHECKED)
|
||||
@@ -849,7 +855,7 @@ void mswin_select_map_mode(int mode)
|
||||
|
||||
map_id = WIN_MAP;
|
||||
data = (PNHMainWindow)GetWindowLong(GetNHApp()->hMainWnd, GWL_USERDATA);
|
||||
hmenuMap = _get_main_menu();
|
||||
hmenuMap = _get_main_menu(ID_MAP);
|
||||
|
||||
/* override for Rogue level */
|
||||
#ifdef REINCARNATION
|
||||
@@ -932,7 +938,7 @@ int mapmode2menuid(int map_mode)
|
||||
return -1;
|
||||
}
|
||||
|
||||
HMENU _get_main_menu()
|
||||
HMENU _get_main_menu(UINT menu_id)
|
||||
{
|
||||
HMENU hmenuMap;
|
||||
#ifndef WIN_CE_2xx
|
||||
@@ -942,7 +948,7 @@ HMENU _get_main_menu()
|
||||
#ifndef WIN_CE_2xx
|
||||
tbbi.cbSize = sizeof(tbbi);
|
||||
tbbi.dwMask = TBIF_LPARAM;
|
||||
SendMessage( GetNHApp()->hMenuBar, TB_GETBUTTONINFO, ID_MAP, (LPARAM)&tbbi);
|
||||
SendMessage( GetNHApp()->hMenuBar, TB_GETBUTTONINFO, menu_id, (LPARAM)&tbbi);
|
||||
hmenuMap = (HMENU)tbbi.lParam;
|
||||
#else
|
||||
hmenuMap = CommandBar_GetMenu(GetNHApp()->hMenuBar, 0);
|
||||
|
||||
@@ -138,13 +138,15 @@
|
||||
#define IDS_CAP_AMP 32798
|
||||
#define IDS_CAP_MAP 32799
|
||||
#define IDM_VIEW_KEYPAD 32800
|
||||
#define ID_VIEW 32801
|
||||
#define IDS_CAP_VIEW 32802
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 148
|
||||
#define _APS_NEXT_COMMAND_VALUE 32801
|
||||
#define _APS_NEXT_COMMAND_VALUE 32805
|
||||
#define _APS_NEXT_CONTROL_VALUE 1333
|
||||
#define _APS_NEXT_SYMED_VALUE 110
|
||||
#endif
|
||||
|
||||
@@ -32,7 +32,7 @@ IDI_WINHACK ICON DISCARDABLE "NETHACK.ICO"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
// Menubar
|
||||
//
|
||||
|
||||
IDC_WINHACK MENU DISCARDABLE
|
||||
@@ -261,11 +261,17 @@ END
|
||||
// Data
|
||||
//
|
||||
|
||||
IDC_WINHACK RCDATA DISCARDABLE
|
||||
IDC_WINHACK SHMENUBAR DISCARDABLE
|
||||
BEGIN
|
||||
0x006d, 0x0003, 0xfffe, 0x8018, 0x0004, 0x0018, 0x8019, 0x0000, 0x0000,
|
||||
0xfffe, 0x801d, 0x0004, 0x0018, 0x801f, 0x0000, 0x0001, 0xfffe, 0x801a,
|
||||
0x0004, 0x0018, 0x801b, 0x0000, 0x0002
|
||||
IDC_WINHACK, 4,
|
||||
I_IMAGENONE, ID_FILE, TBSTATE_ENABLED,
|
||||
TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_FILE, 0, 0,
|
||||
I_IMAGENONE, ID_MAP, TBSTATE_ENABLED,
|
||||
TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_MAP, 0, 1,
|
||||
I_IMAGENONE, ID_VIEW, TBSTATE_ENABLED,
|
||||
TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_VIEW, 0, 2,
|
||||
I_IMAGENONE, ID_HELP, TBSTATE_ENABLED,
|
||||
TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_CAP_HELP, 0, 3,
|
||||
END
|
||||
|
||||
|
||||
@@ -336,6 +342,7 @@ END
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDM_VIEW_KEYPAD "Show/Hide keypad."
|
||||
IDS_CAP_VIEW "View"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
|
||||
Reference in New Issue
Block a user