align a window-related template to the main screen */
| 424 | |
| 425 | /* align a window-related template to the main screen */ |
| 426 | static Handle |
| 427 | alignTemplate(ResType rezType, short rezID, short vOff, short vDenom, |
| 428 | Point *pPt) |
| 429 | { |
| 430 | Handle rtnHnd; |
| 431 | Rect *pRct; |
| 432 | |
| 433 | vOff += GetMBarHeight(); |
| 434 | |
| 435 | if (!(rtnHnd = GetResource(rezType, rezID))) |
| 436 | note(nilHandleErr, 0, "\pNil Template Handle"); |
| 437 | |
| 438 | pRct = (Rect *) *rtnHnd; |
| 439 | |
| 440 | /* don't move memory while aligning rect */ |
| 441 | pRct->right -= pRct->left; /* width */ |
| 442 | pRct->bottom -= pRct->top; /* height */ |
| 443 | pRct->left = (qd.screenBits.bounds.right - pRct->right) / 2; |
| 444 | pRct->top = (qd.screenBits.bounds.bottom - pRct->bottom - vOff) / vDenom; |
| 445 | pRct->top += vOff; |
| 446 | pRct->right += pRct->left; |
| 447 | pRct->bottom += pRct->top; |
| 448 | |
| 449 | if (pPt) |
| 450 | *pPt = *(Point *) pRct; /* top left corner */ |
| 451 | |
| 452 | return rtnHnd; |
| 453 | } |
| 454 | |
| 455 | /* notification completion routine */ |
| 456 | pascal void |