win32 (from <Someone>)

This patch is an improvement for menu/text dialogs.
This is a code carried over from Windows CE port. It changes
text and menu windows from "system popup" to plain "child"
windows of the main nethack window. Nethack main window can
now be resized/moved/minimized when menu/text window is up.
Menu/text windows will always stay inside the main window and
move along with it.

<Someone>
This commit is contained in:
nethack.allison
2002-08-28 04:53:50 +00:00
parent 081edea253
commit 71eb636e14
6 changed files with 93 additions and 66 deletions

View File

@@ -44,10 +44,7 @@ HWND mswin_init_text_window () {
void mswin_display_text_window (HWND hWnd)
{
MSG msg;
RECT rt;
PNHTextWindow data;
HWND mapWnd;
data = (PNHTextWindow)GetWindowLong(hWnd, GWL_USERDATA);
if( data && data->window_text ) {
@@ -57,22 +54,8 @@ void mswin_display_text_window (HWND hWnd)
SetWindowText(GetDlgItem(hWnd, IDC_TEXT_CONTROL), data->window_text);
}
GetNHApp()->hPopupWnd = hWnd;
mapWnd = mswin_hwnd_from_winid(WIN_MAP);
if( !IsWindow(mapWnd) ) mapWnd = GetNHApp()->hMainWnd;
GetWindowRect(mapWnd, &rt);
MoveWindow(hWnd, rt.left, rt.top, rt.right-rt.left, rt.bottom-rt.top, TRUE);
ShowWindow(hWnd, SW_SHOW);
while( IsWindow(hWnd) &&
GetMessage(&msg, NULL, 0, 0)!=0 ) {
if( !IsDialogMessage(hWnd, &msg) ) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
GetNHApp()->hPopupWnd = NULL;
mswin_popup_display(hWnd, NULL);
mswin_popup_destroy(hWnd);
}
BOOL CALLBACK NHTextWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)