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

Function ask_redraw

outdated/sys/mac/macmenu.c:290–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290static pascal void
291ask_redraw(DialogRef wind, DialogItemIndex item)
292{
293 short type;
294 Handle handle;
295 Rect rect;
296 static char *modechar = "NED";
297
298 /* Which item shall we redraw? */
299 GetDialogItem(wind, item, &type, &handle, &rect);
300 switch (item) {
301 case RSRC_ASK_DEFAULT:
302 PenSize(3, 3);
303 FrameRoundRect(&rect, 16, 16);
304 break;
305
306 case RSRC_ASK_ROLE:
307 case RSRC_ASK_RACE:
308 case RSRC_ASK_GEND:
309 case RSRC_ASK_ALIGN:
310 case RSRC_ASK_MODE:
311 if (macFlags.color) {
312 RGBForeColor(&blackcolor);
313 RGBBackColor(&backcolor);
314 }
315 PenNormal();
316 TextMode(srcOr);
317 EraseRect(&rect);
318
319 /* Draw the frame and drop shadow */
320 rect.right--;
321 rect.bottom--;
322 FrameRect(&rect);
323 MoveTo(rect.right, rect.top + 1);
324 LineTo(rect.right, rect.bottom);
325 LineTo(rect.left + 1, rect.bottom);
326
327 /* Draw the menu character */
328 MoveTo(rect.left + 4, rect.top + 12);
329 switch (item) {
330 case RSRC_ASK_ROLE:
331 DrawText(roles[askselect[item]].filecode, 0, 3);
332 break;
333 case RSRC_ASK_RACE:
334 DrawText(races[askselect[item]].filecode, 0, 3);
335 break;
336 case RSRC_ASK_GEND:
337 DrawText(genders[askselect[item]].filecode, 0, 3);
338 break;
339 case RSRC_ASK_ALIGN:
340 DrawText(aligns[askselect[item]].filecode, 0, 3);
341 break;
342 case RSRC_ASK_MODE:
343 DrawChar(modechar[askselect[item]]);
344 break;
345 }
346
347 /* Draw the popup symbol */

Callers 1

ask_filterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected