-/* $Id: macctrls.c,v 1.28 2003/04/05 17:19:38 ben Exp $ */
+/* $Id: macctrls.c,v 1.29 2003/04/05 18:00:46 ben Exp $ */
/*
* Copyright (c) 2003 Ben Harris
* All rights reserved.
struct {
struct macctrl_generic generic;
ControlRef tbctrl;
+ ControlRef tbring;
} button;
struct {
struct macctrl_generic generic;
c2pstrcpy(title, ctrl->button.label);
mc->button.tbctrl = NewControl(window, &bounds, title, TRUE, 0, 0, 1,
pushButProc, (long)mc);
+ mc->button.tbring = NULL;
if (mac_gestalts.apprvers >= 0x100) {
Boolean isdefault = ctrl->button.isdefault;
sizeof(isdefault), &isdefault);
} else if (ctrl->button.isdefault) {
InsetRect(&bounds, -4, -4);
- NewControl(window, &bounds, title, TRUE, 0, 0, 1,
- SYS7_DEFAULT_PROC, (long)mc);
+ mc->button.tbring = NewControl(window, &bounds, title, TRUE, 0, 0, 1,
+ SYS7_DEFAULT_PROC, (long)mc);
}
if (mac_gestalts.apprvers >= 0x110) {
Boolean iscancel = ctrl->button.iscancel;
RgnHandle rgn;
Rect rect;
int oval;
+ PenState savestate;
switch (msg) {
case drawCntl:
if ((*control)->contrlVis) {
rect = (*control)->contrlRect;
+ GetPenState(&savestate);
PenNormal();
PenSize(3, 3);
+ if ((*control)->contrlHilite == kControlInactivePart)
+ PenPat(&qd.gray);
oval = (rect.bottom - rect.top) / 2 + 2;
FrameRoundRect(&rect, oval, oval);
+ SetPenState(&savestate);
}
return 0;
case calcCRgns:
break;
case MACCTRL_BUTTON:
HiliteControl(mc->button.tbctrl, state);
+ if (mc->button.tbring != NULL)
+ HiliteControl(mc->button.tbring, state);
break;
case MACCTRL_POPUP:
HiliteControl(mc->popup.tbctrl, state);