+#if !TARGET_API_MAC_CARBON
+static pascal SInt32 macctrl_sys7_editbox_cdef(SInt16 variant,
+ ControlRef control,
+ ControlDefProcMessage msg,
+ SInt32 param)
+{
+ RgnHandle rgn;
+ Rect rect;
+ TEHandle te;
+ long ssfs;
+ Point mouse;
+
+ switch (msg) {
+ case initCntl:
+ rect = (*control)->contrlRect;
+ InsetRect(&rect, 3, 3); /* 2 if it's 20 pixels high */
+ te = TENew(&rect, &rect);
+ ssfs = GetScriptVariable(smSystemScript, smScriptSysFondSize);
+ (*te)->txSize = LoWord(ssfs);
+ (*te)->txFont = HiWord(ssfs);
+ (*control)->contrlData = (Handle)te;
+ return noErr;
+ case dispCntl:
+ TEDispose((TEHandle)(*control)->contrlData);
+ return 0;
+ case drawCntl:
+ if ((*control)->contrlVis) {
+ rect = (*control)->contrlRect;
+ PenNormal();
+ FrameRect(&rect);
+ InsetRect(&rect, 3, 3);
+ TEUpdate(&rect, (TEHandle)(*control)->contrlData);
+ }
+ return 0;
+ case testCntl:
+ mouse.h = LoWord(param);
+ mouse.v = HiWord(param);
+ return
+ PtInRect(mouse, &(*(TEHandle)(*control)->contrlData)->viewRect) ?
+ kControlEditTextPart : kControlNoPart;
+ case calcCRgns:
+ if (param & (1 << 31)) {
+ param &= ~(1 << 31);
+ goto calcthumbrgn;
+ }
+ /* FALLTHROUGH */
+ case calcCntlRgn:
+ rgn = (RgnHandle)param;
+ RectRgn(rgn, &(*control)->contrlRect);
+ return 0;
+ case calcThumbRgn:
+ calcthumbrgn:
+ rgn = (RgnHandle)param;
+ SetEmptyRgn(rgn);
+ return 0;
+ }
+
+ return 0;
+}
+#endif
+