MCPcopy Create free account
hub / github.com/NetHack/NetHack / mswin_layout_main_window

Function mswin_layout_main_window

outdated/sys/wince/mhmain.c:550–837  ·  view source on GitHub ↗

adjust windows to fit main window layout --------------------------- | Status | +-------------------------+ | | | | | MAP | | | | | +-------------------------+ | Command pad | +-------------------------+ | Messag

Source from the content-addressed store, hash-verified

548 ---------------------------
549*/
550void
551mswin_layout_main_window(HWND changed_child)
552{
553 winid i;
554 RECT client_rt, wnd_rect;
555 POINT status_org;
556 SIZE status_size;
557 POINT msg_org;
558 SIZE msg_size;
559 POINT map_org;
560 SIZE map_size;
561 POINT cmd_org;
562 SIZE cmd_size;
563 HWND wnd_status, wnd_msg;
564 PNHMainWindow data;
565#if defined(WIN_CE_POCKETPC)
566 SIPINFO sip;
567 RECT menu_bar;
568 RECT visible_rt;
569 POINT pt;
570#endif
571
572 GetClientRect(GetNHApp()->hMainWnd, &client_rt);
573
574#if defined(WIN_CE_POCKETPC)
575 ZeroMemory(&sip, sizeof(sip));
576 sip.cbSize = sizeof(sip);
577 SHSipInfo(SPI_GETSIPINFO, 0, &sip, 0);
578 if (GetNHApp()->bFullScreen)
579 sip.rcVisibleDesktop.top = 0;
580
581 /* adjust client rectangle size */
582 GetWindowRect(GetNHApp()->hMenuBar, &menu_bar);
583 client_rt.bottom -= menu_bar.bottom - menu_bar.top;
584
585 /* calcuate visible rect in client coordinates */
586 pt.x = sip.rcVisibleDesktop.left;
587 pt.y = sip.rcVisibleDesktop.top;
588 ScreenToClient(GetNHApp()->hMainWnd, &pt);
589 SetRect(&wnd_rect, pt.x, pt.y,
590 pt.x + sip.rcVisibleDesktop.right - sip.rcVisibleDesktop.left,
591 pt.y + sip.rcVisibleDesktop.bottom - sip.rcVisibleDesktop.top);
592 IntersectRect(&visible_rt, &client_rt, &wnd_rect);
593#else
594#if !defined(WIN_CE_SMARTPHONE)
595 client_rt.top += CommandBar_Height(GetNHApp()->hMenuBar);
596#else
597 /* Smartphone only */
598 if (GetNHApp()->bFullScreen) {
599 RECT menu_bar;
600 GetWindowRect(GetNHApp()->hMenuBar, &menu_bar);
601 client_rt.bottom -= menu_bar.bottom - menu_bar.top;
602 }
603#endif
604#endif
605
606 /* get window data */
607 data = (PNHMainWindow) GetWindowLong(GetNHApp()->hMainWnd, GWL_USERDATA);

Callers 6

MainWndProcFunction · 0.70
onMSNHCommandFunction · 0.70
onWMCommandFunction · 0.70
mswin_preference_updateFunction · 0.70
mswin_popup_displayFunction · 0.70
mswin_popup_destroyFunction · 0.70

Calls 5

GetNHAppFunction · 0.70
mswin_hwnd_from_winidFunction · 0.70
mswin_status_window_sizeFunction · 0.70

Tested by

no test coverage detected