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

Function mswin_init_map_window

win/win32/mhmap.c:97–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95extern boolean win32_cursorblink; /* from sys\windows\windsys.c */
96
97HWND
98mswin_init_map_window(void)
99{
100 static int run_once = 0;
101 HWND hWnd;
102 RECT rt;
103
104 if (!run_once) {
105 register_map_window_class();
106 run_once = 1;
107 }
108
109 /* get window position */
110 if (GetNHApp()->bAutoLayout) {
111 SetRect(&rt, 0, 0, 0, 0);
112 } else {
113 mswin_get_window_placement(NHW_MAP, &rt);
114 }
115
116 /* create map window object */
117 hWnd = CreateWindow(
118 szNHMapWindowClass, /* registered class name */
119 NULL, /* window name */
120 WS_CHILD | WS_HSCROLL | WS_VSCROLL | WS_CLIPSIBLINGS
121 | WS_SIZEBOX, /* window style */
122 rt.left, /* horizontal position of window */
123 rt.top, /* vertical position of window */
124 rt.right - rt.left, /* window width */
125 rt.bottom - rt.top, /* window height */
126 GetNHApp()->hMainWnd, /* handle to parent or owner window */
127 NULL, /* menu handle or child identifier */
128 GetNHApp()->hApp, /* handle to application instance */
129 NULL); /* window-creation data */
130 if (!hWnd) {
131 panic("Cannot create map window");
132 }
133
134 /* Set window caption */
135 SetWindowText(hWnd, "Map");
136
137 mswin_apply_window_style(hWnd);
138
139 /* set cursor blink timer */
140 SetTimer(hWnd, 0, CURSOR_BLINK_INTERVAL, NULL);
141
142 return hWnd;
143}
144
145void
146mswin_map_layout(HWND hWnd, LPSIZE map_size)

Callers 1

mswin_create_nhwindowFunction · 0.70

Calls 5

mswin_apply_window_styleFunction · 0.85
GetNHAppFunction · 0.70
panicFunction · 0.50

Tested by

no test coverage detected