2021-10-15 16:43:09 +00:00
|
|
|
// Copyright (c) Jon Thysell <http://jonthysell.com>
|
|
|
|
// Licensed under the MIT License.
|
|
|
|
|
|
|
|
#include "MacCommon.h"
|
|
|
|
|
|
|
|
void ShowError(Str255 message, Boolean isFatal)
|
|
|
|
{
|
2021-10-16 00:29:07 +00:00
|
|
|
ParamText(message, EmptyString, EmptyString, EmptyString);
|
|
|
|
StopAlert(ErrorAlertResID, NilFilterProc);
|
2021-10-15 16:43:09 +00:00
|
|
|
|
|
|
|
if (isFatal)
|
|
|
|
{
|
|
|
|
ExitToShell();
|
|
|
|
}
|
|
|
|
}
|
2021-10-31 22:13:51 +00:00
|
|
|
|
|
|
|
void CenterRect(const Rect *pOuterRect, Rect *pInnerRect)
|
|
|
|
{
|
|
|
|
CenterRectH(pOuterRect, pInnerRect);
|
|
|
|
CenterRectV(pOuterRect, pInnerRect);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CenterRectH(const Rect *pOuterRect, Rect *pInnerRect)
|
|
|
|
{
|
|
|
|
OffsetRect(pInnerRect, pOuterRect->left - pInnerRect->left, 0);
|
|
|
|
OffsetRect(pInnerRect, (pOuterRect->right - pInnerRect->right) / 2, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CenterRectV(const Rect *pOuterRect, Rect *pInnerRect)
|
|
|
|
{
|
|
|
|
OffsetRect(pInnerRect, 0, pOuterRect->top - pInnerRect->top);
|
|
|
|
OffsetRect(pInnerRect, 0, (pOuterRect->bottom - pInnerRect->bottom) / 2);
|
|
|
|
}
|