+ }
+#if !TARGET_API_MAC_CARBON
+ else {
+ InsetRect(&bounds, -3, -3);
+ mc->listbox.tbctrl = NewControl(window, &bounds, NULL, FALSE,
+ 0, 0, 0,
+ SYS7_LISTBOX_PROC, (long)mc);
+ mc->listbox.list = (ListHandle)(*mc->listbox.tbctrl)->contrlData;
+ (*mc->listbox.list)->refCon = (long)mc;
+ }
+#endif
+ if (!ctrl->listbox.multisel) {
+#if TARGET_API_MAC_CARBON
+ SetListSelectionFlags(mc->listbox.list, lOnlyOne);
+#else
+ (*mc->listbox.list)->selFlags = lOnlyOne;
+#endif
+ }
+ add234(mcs->byctrl, mc);
+ curstate->pos.v += 6 + 16 * ctrl->listbox.height + 2;
+ mc->generic.next = mcs->panels[curstate->panelnum];
+ mcs->panels[curstate->panelnum] = mc;
+ ctrlevent(mcs, mc, EVENT_REFRESH);
+#if TARGET_API_MAC_CARBON
+ HideControl(GetListVerticalScrollBar(mc->listbox.list));
+#else
+ HideControl((*mc->listbox.list)->vScroll);
+#endif
+}
+
+#if !TARGET_API_MAC_CARBON
+static pascal SInt32 macctrl_sys7_listbox_cdef(SInt16 variant,
+ ControlRef control,
+ ControlDefProcMessage msg,
+ SInt32 param)
+{
+ RgnHandle rgn;
+ Rect rect;
+ ListHandle list;
+ long ssfs;
+ Point mouse;
+ ListBounds bounds;
+ Point csize;
+ short savefont;
+ short savesize;
+ GrafPtr curport;
+
+ switch (msg) {
+ case initCntl:
+ rect = (*control)->contrlRect;
+ InsetRect(&rect, 4, 4);
+ rect.right -= 15; /* scroll bar */
+ bounds.top = bounds.bottom = bounds.left = 0;
+ bounds.right = 1;
+ csize.h = csize.v = 0;
+ GetPort(&curport);
+ savefont = curport->txFont;
+ savesize = curport->txSize;
+ ssfs = GetScriptVariable(smSystemScript, smScriptSysFondSize);
+ TextFont(HiWord(ssfs));
+ TextSize(LoWord(ssfs));
+ list = LNew(&rect, &bounds, csize, 0, (*control)->contrlOwner,
+ TRUE, FALSE, FALSE, TRUE);
+ SetControlReference((*list)->vScroll, (long)list);
+ (*control)->contrlData = (Handle)list;
+ TextFont(savefont);
+ TextSize(savesize);
+ return noErr;
+ case dispCntl:
+ /*
+ * If the dialogue box is being destroyed, the scroll bar
+ * might have gone already. In our situation, this is the
+ * only time we destroy a control, so NULL out the scroll bar
+ * handle to prevent LDispose trying to free it.
+ */
+ list = (ListHandle)(*control)->contrlData;
+ (*list)->vScroll = NULL;
+ LDispose(list);