]> granicus.if.org Git - nethack/commitdiff
(from <Someone>)
authornethack.allison <nethack.allison>
Sun, 25 Aug 2002 12:29:35 +0000 (12:29 +0000)
committernethack.allison <nethack.allison>
Sun, 25 Aug 2002 12:29:35 +0000 (12:29 +0000)
> Questions are being appended in the message window, some showing
> up on the same line. This is really noticeable with the
> end-of-game disclosure questions. Questions should always be
> presented on a new line.

At end of game is probably the only place, since then more than one
question is asked in the same turn. Anyhow, here's the patch, in
mswproc.c  [...]

- No checkboxes in menu if menu is PICK_NONE. mhmenu.c

- About box changed to splash screen. This last thing is open
for discussion, as the splash screen currently does not give
exactly the ame information as the about box (or the v command).
Maybe the splash should be enhanced? Anyway, it looks better than
the About-box. I didn't remove the About-box code and resource yet
until this discussion is had. mhmain.c

<Someone>

win/win32/mhmain.c
win/win32/mhmenu.c
win/win32/mswproc.c

index 92b10bfea0b71c4f393b2f23ed3176a8cf121796..6f0d04007fcb8186ef9fa5b9a625e00b44126756 100644 (file)
@@ -18,6 +18,7 @@ typedef struct mswin_nethack_main_window {
 
 static TCHAR szMainWindowClass[] = TEXT("MSNHMainWndClass");
 static TCHAR szTitle[MAX_LOADSTRING];
+extern void mswin_display_splash_window(void);
 
 LRESULT CALLBACK       MainWndProc(HWND, UINT, WPARAM, LPARAM);
 LRESULT CALLBACK       About(HWND, UINT, WPARAM, LPARAM);
@@ -701,7 +702,7 @@ LRESULT onWMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
        switch (wmId)
        {
                case IDM_ABOUT:
-                  DialogBox(GetNHApp()->hApp, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
+                  mswin_display_splash_window();
                   break;
 
                case IDM_EXIT:
index f003142e181f7878ded2b78a5081b6c9ea278a9f..b562645629b9da36f0c243353fc76733325fb1ec 100644 (file)
@@ -821,11 +821,12 @@ BOOL onDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
 
        x = lpdis->rcItem.left + 1;
 
-       /* print check mark */
+    /* print check mark and letter */
        if( NHMENU_IS_SELECTABLE(*item) ) {
+ char buf[2];
+ if (data->how != PICK_NONE) {
                HGDIOBJ saveBrush;
                HBRUSH  hbrCheckMark;
-               char buf[2];
 
                switch(item->count) {
                case -1: hbrCheckMark = CreatePatternBrush(data->bmpChecked); break;
@@ -840,8 +841,8 @@ BOOL onDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
                SelectObject(lpdis->hDC, saveBrush);
                DeleteObject(hbrCheckMark);
 
+ }
                x += TILE_X + 5;
-
                if(item->accelerator!=0) {
                        buf[0] = item->accelerator;
                        buf[1] = '\x0';
index a1c0ab24e2ab9f0233f2fec201a77fafef363ae9..e146334684b8441d53df30b5101e17313d0a861f 100644 (file)
@@ -1427,6 +1427,7 @@ char mswin_yn_function(const char *question, const char *choices,
     SendMessage(mswin_hwnd_from_winid(WIN_MESSAGE), 
         WM_MSNH_COMMAND, (WPARAM)MSNH_MSG_CARET, (LPARAM)&createcaret );
 
+    mswin_clear_nhwindow(WIN_MESSAGE);
     mswin_putstr(WIN_MESSAGE, ATR_BOLD, message);
 
     /* Only here if main window is not present */
@@ -1490,6 +1491,7 @@ void mswin_getlin(const char *question, char *input)
         SendMessage(mswin_hwnd_from_winid(WIN_MESSAGE), 
             WM_MSNH_COMMAND, (WPARAM)MSNH_MSG_CARET, (LPARAM)&createcaret );
 
+ mswin_clear_nhwindow(WIN_MESSAGE);
         mswin_putstr_ex(WIN_MESSAGE, ATR_BOLD, question, 0);
         mswin_putstr_ex(WIN_MESSAGE, ATR_BOLD, " ", 1);
         input[0] = '\0';
@@ -1562,6 +1564,7 @@ int mswin_get_ext_cmd()
 
         cmd[0] = '\0';
         i = -2;
+ mswin_clear_nhwindow(WIN_MESSAGE);
         mswin_putstr_ex(WIN_MESSAGE, ATR_BOLD, "#", 0);
         len = 0;
         ShowCaret(mswin_hwnd_from_winid(WIN_MESSAGE));