home *** CD-ROM | disk | FTP | other *** search
- # include "TransSkel.h"
-
- # include "MakeWrite.h"
-
-
- # define tab '\t'
-
-
- /*
- * Local data for creating controls
- */
-
-
- /*
- * maxSize = number of point-size selection radio buttons
- * maxStyle = number of style selection check boxes
- * maxCP = number of edit menu cut/paste indicator controls
- * maxCtrl = sum of above three
- * maxFonts = maximum number of fonts allowed in scrollable list
- */
-
- # define maxSize 7
- # define maxStyle 9
- # define maxCP 2
- # define maxCtrl (maxSize+maxStyle+maxCP)
- # define maxFonts 102
-
-
- typedef enum /* control types, by function */
- {
- sizeType, /* size radio button */
- styleType, /* style check box */
- cpType /* edit menu check box */
- };
-
-
- typedef struct CtrlInfo
- {
- Str255 cTitle; /* initial control title */
- short ch, cv; /* location of upper left corner */
- } CtrlInfo;
-
-
- static CtrlInfo ctrlInfo[maxCtrl] =
- {
- { "\pSame", 181, 20 },
- { "\p9", 172, 40 },
- { "\p10", 172, 60 },
- { "\p12", 172, 80 },
- { "\p14", 217, 40 },
- { "\p18", 217, 60 },
- { "\p24", 217, 80 },
- { "\pSame", 312, 20 },
- { "\pPlain", 265, 40 },
- { "\pBold", 265, 60 },
- { "\pItalic", 265, 80 },
- { "\pUnderline", 265, 100 },
- { "\pOutline", 355, 40 },
- { "\pShadow", 355, 60 },
- { "\pSuperscript", 355, 80 },
- { "\pSubscript", 355, 100 },
- { "\pMarker", 9, 210 },
- { "\pMap Lines", 9, 230 }
- };
-
-
- static ControlHandle sizeCtrl[maxSize];
- static ControlHandle styleCtrl[maxStyle];
- static ControlHandle cpCtrl[maxCP];
-
-
-
- /*
- * Standard MacWrite point sizes, plus the "same size" selection.
- * The order of these corresponds to the size radio buttons.
- */
-
- static short sizeInfo[maxSize] = { sameSize, 9, 10, 12, 14, 18, 24 };
-
-
- /*
- * Masks for manipulating style selections. The order of these
- * corresponds to the style check boxes.
- */
-
-
- static short styleMask[maxStyle] =
- {
- sameStyle,
- 0, /* plain; special-cased */
- styleBold,
- styleItalic,
- styleUnder,
- styleOutline,
- styleShadow,
- styleSuper,
- styleSub
- };
-
-
- /*
- * Standard font specifications
- */
-
-
- typedef struct
- {
- short fontNum;
- StringHandle fontName;
- } FontSpec;
-
-
- static FontSpec fontSpecs[maxFonts];
- static short nFontSpecs;
-
-
- static short fontOffsets[2] = { 0, 137 };
-
-
- static LineList fontStruct =
- {
- nil, /* port - filled in later */
- nil, /* control - filled in later */
- { 20, 5, 116, 141 }, /* text display rect, t, l, b, r */
- 0, /* max lines */
- 6, /* max visible lines */
- 0, /* top visible line */
- 16, /* line height */
- 0, /* number of lines */
- noLine, /* current line */
- false, /* no hiliting */
- 1, /* number of fields/line */
- fontOffsets, /* field offsets */
- nil /* line array */
- };
-
-
- static LListPtr fontList = &fontStruct;
-
- static MapSpec *curMSpec;
- static short curMSpecNo;
-
- static TEHandle markTE;
-
-
- /* ---------------------------------------------------------------- */
- /* General Control Operations */
- /* ---------------------------------------------------------------- */
-
-
-
- /*
- * Set a control value, but only when it changes, to avoid
- * unnecessary redrawing (ugly, since gobs of them are usually
- * changed together).
- *
- * Use for check boxes and radio buttons only, not scroll bars!
- */
-
- static void
- SetControl (ControlHandle ctrl, Boolean value)
- {
- if (GetCtlValue (ctrl) != value)
- SetCtlValue (ctrl, value);
- }
-
-
- /* ---------------------------------------------------------------- */
- /* Font List Operations */
- /* ---------------------------------------------------------------- */
-
-
- /*
- * Add a font to the spec list. Return false if there's overrun.
- */
-
- Boolean
- SetFontSpec (short fNum, StringPtr fName)
- {
- StringHandle h;
- Str255 s;
- short i, result;
-
- for (i = 0; i < nFontSpecs; ++i) /* see if already there */
- {
- h = fontSpecs[i].fontName;
- HLock ((Handle) h);
- result = CompareString (*h, fName);
- HUnlock ((Handle) h);
- if (result == 0) /* font name's a duplicate */
- return (true); /* but that's ok */
- }
-
- if (nFontSpecs >= fontList->maxLines) /* will list be too full? */
- {
- NumToString ((long) maxFonts - 2, s);
- Message3 ("\pSorry, I am such a brain-damaged program that I only allow ",
- s, "\p fonts!");
- return (false);
- }
-
- h = (StringHandle) NewHandle ((long) (fName[0] + 1));
- HLock ((Handle) h);
- CopyString (fName, *h);
- HUnlock ((Handle) h);
- fontSpecs[nFontSpecs].fontName = h;
- fontSpecs[nFontSpecs++].fontNum = fNum;
- return (true);
- }
-
-
- /*
- * Set up to construct a new font list. Note that the other
- * selector controls must have been initialized by this point.
- */
-
- void
- ResetFontList (void)
- {
- short i;
-
- for (i = 0; i < fontList->nLines; ++i)
- DisposeHandle ((Handle) fontSpecs[i].fontName);
- nFontSpecs = 0;
- ResetList (fontList);
- SetFontSpec (sameFont, "\pSame");
- SetFontSpec (applFont, "\pApplication");
- }
-
-
- /*
- * Sync information in fontSpec to fontList by constructing the LineList
- * elements.
- */
-
- void
- SyncFontSpecs (void)
- {
- short i, j;
- short tmp;
- FontSpec *f1, *f2;
- StringHandle h1, h2;
- LineHandle hField;
-
- /*
- * Sort font names, except for "Same" and "Application", which
- * stay at the front of the list.
- */
-
- for (i = 2; i < nFontSpecs - 1; ++i)
- {
- for (j = i + 1; j < nFontSpecs; ++j)
- {
- f1 = &fontSpecs[i];
- f2 = &fontSpecs[j];
- h1 = f1->fontName;
- h2 = f2->fontName;
- HLock ((Handle) h1);
- HLock ((Handle) h2);
- if (CompareString (*h1, *h2) > 0)
- {
- f1->fontName = h2;
- f2->fontName = h1;
- tmp = f1->fontNum;
- f1->fontNum = f2->fontNum;
- f2->fontNum = tmp;
- }
- HUnlock ((Handle) h1);
- HUnlock ((Handle) h2);
- }
- }
-
- /*
- * Add names to fontList
- */
-
- ResetList (fontList);
- for (i = 0; i < nFontSpecs; ++i)
- {
- h1 = fontSpecs[i].fontName;
- HLock ((Handle) h1);
- hField = NewLine (1);
- SetFieldStr (hField, *h1);
- HUnlock ((Handle) h1);
- (void) InsertLine (fontList, hField, i);
- }
- SelectLine (fontList, 0);
- ScrollToLine (fontList, 0); /* force scroll to top */
- }
-
-
- /*
- * Given a font number, find its index in the stdFontSpecs
- * array. Return -1 if it's not there.
- */
-
- short
- FontIndex (short fontNum)
- {
- short i;
-
- for (i = 0; i < fontList->nLines; ++i)
- {
- if (fontNum == fontSpecs[i].fontNum)
- return (i);
- }
- return (-1);
- }
-
-
- /*
- * Return a font name corresponding to the given index
- */
-
- void
- FontName (short fontIndex, StringPtr str)
- {
- StringHandle hStr;
-
- hStr = fontSpecs[fontIndex].fontName;
- HLock ((Handle) hStr);
- CopyString (*hStr, str);
- HUnlock ((Handle) hStr);
- }
-
-
- /* ---------------------------------------------------------------- */
- /* Size Control Operations */
- /* ---------------------------------------------------------------- */
-
-
- /*
- * Given a point size, find its index in the sizeInfo
- * array. (Return -1 if it's not there.)
- */
-
- short
- SizeIndex (short size)
- {
- short i;
-
- for (i = 0; i < maxSize; ++i)
- {
- if (size == sizeInfo[i])
- return (i);
- }
- return (-1);
- }
-
-
- static void
- SetSizeCtrls (void)
- {
- short i;
-
- for (i = 0; i < maxSize; ++i)
- SetControl (sizeCtrl[i], sizeInfo[i] == curMSpec->size);
- }
-
-
- /* ---------------------------------------------------------------- */
- /* Style Control Operations */
- /* ---------------------------------------------------------------- */
-
-
- /*
- * Set the style controls based on the current value of theStyle.
- *
- * The sameStyle bit and the attributes bits cause the corresponding
- * boxes to be checked if they are set. If the style is zero, it's
- * plain.
- */
-
- static void
- SetStyleCtrls (void)
- {
- short i;
- Boolean same;
- short theStyle;
-
- theStyle = curMSpec->style;
- same = ((theStyle & sameStyle) != 0);
- SetControl (styleCtrl[0], same);
-
- if (same)
- {
- for (i = 1; i < maxStyle; ++i)
- SetControl (styleCtrl[i], false);
- }
- else if (theStyle == 0) /* plain */
- {
- SetControl (styleCtrl[1], true);
- for (i = 2; i < maxStyle; ++i)
- SetControl (styleCtrl[i], false);
- }
- else /* not plain */
- {
- SetControl (styleCtrl[1], false);
- for (i = 2; i < maxStyle; ++i)
- SetControl (styleCtrl[i], (theStyle & styleMask[i]) != 0);
- }
- }
-
-
- /*
- * Determine style value. The argument is an index into the control
- * array not a style value itself. Style controls interact in
- * wretched complexity.
- *
- * If same is toggled on, all the other style boxes are toggled off.
- * If it's toggled off, plain is toggled on.
- *
- * If plain is toggled on, all the other style boxes are toggled off.
- * If it's toggled off, same is toggled on.
- *
- * The other style boxes correspond to style attributes. If any of
- * them are toggled on, then same and plain are toggle off if
- * they were on. If all the attributes are toggled off, plain is
- * toggled on. Superscript and subscript are mutually exclusive,
- * so that if one of them is toggled on, the other is toggled off.
- */
-
- static short
- NewStyleValue (short i)
- {
- short curValue;
- short theStyle;
-
- curValue = GetCtlValue (styleCtrl[i]); /* current value - new value */
- /* will be opposite */
- theStyle = curMSpec->style;
-
- if (i == 0) /* "same" box clicked */
- {
- if (curValue) /* currently same, turn off (implies plain) */
- theStyle = 0;
- else
- theStyle = styleMask[0]; /* currently off, turn on */
- }
- else if (i == 1) /* plain box clicked */
- {
- if (curValue) /* currently plain, turn off (implies same) */
- theStyle = styleMask[0];
- else
- theStyle = 0; /* currently off, turn on */
- }
- else
- {
- /*
- * Flip box value.
- * Can't have superscript and subscript at the same time.
- */
- if (curValue) /* currently on, turn off */
- theStyle &= ~styleMask[i];
- else /* currently off, turn on (turn same off) */
- {
- theStyle |= styleMask[i];
- theStyle &= ~styleMask[0];
- }
-
- if (i == 7) /* superscript. if turning on, turn off sub */
- {
- if (curValue == 0)
- theStyle &= ~styleMask[8];
- }
- if (i == 8) /* subscript. if turning on, turn off super */
- {
- if (curValue == 0)
- theStyle &= ~styleMask[7];
- }
- }
- return (theStyle);
- }
-
-
- /* ---------------------------------------------------------------- */
- /* Edit Menu Cut/Paste Control Operations */
- /* ---------------------------------------------------------------- */
-
-
- static void
- SetCPCtrls (void)
- {
- SetControl (cpCtrl[0], cpMarker);
- SetControl (cpCtrl[1], !cpMarker);
- }
-
-
- void
- SetCPMarker (Boolean useMarker)
- {
- cpMarker = useMarker;
- SetCPCtrls ();
- }
-
-
- void
- BlankCPCtrls (void)
- {
- SetControl (cpCtrl[0], false);
- SetControl (cpCtrl[1], false);
- }
-
-
- /* ---------------------------------------------------------------- */
- /* Marker Operations */
- /* ---------------------------------------------------------------- */
-
-
- /*
- * Sync the marker edit text to a mapSpec
- */
-
- void
- MSpecToMark (MapSpec *m)
- {
- StringHandle s;
- Rect r;
-
- s = m->mark;
- HLock ((Handle) s);
- TESetSelect (0L, 32767L, markTE);
- TEDelete (markTE);
- TEInsert (*s + 1, (long) (*s)[0], markTE); /* replace text */
- HUnlock ((Handle) s);
- TESetSelect ((long) m->selStart, (long) m->selEnd, markTE);
- }
-
-
- /*
- * Sync current mapSpec to the marker edit text
- */
-
- static void
- MarkToMSpec (void)
- {
- StringHandle hStr;
- Handle h;
- short len;
-
- curMSpec->selStart = (**markTE).selStart;
- curMSpec->selEnd = (**markTE).selEnd;
- h = (Handle) TEGetText (markTE);
- len = (**markTE).teLength;
- if (len > maxMarkLen)
- len = maxMarkLen; /* truncate length if necessary */
- hStr = curMSpec->mark;
- HLock (h);
- HLock ((Handle) hStr);
- BlockMove (*h, *hStr + 1, (long) len);
- (*hStr)[0] = len;
- HUnlock (h);
- PasteField (mapList, mapList->curLine, markField, *hStr);
- HUnlock ((Handle) hStr);
- }
-
-
- typedef enum /* relevant Edit menu item numbers */
- {
- cut = 3,
- copy,
- paste,
- clear
- };
-
-
- void
- MarkerUndoSetup (void)
- {
- CopyMSpec (curMSpec, &undoMSpec);
- undoOp = undoMarkerOp;
- undoPos = mapList->curLine;
- undoCPMarker = cpMarker;
- }
-
-
- Boolean
- EditMarker (short item)
- {
- if (!cpMarker)
- return (false);
-
- switch (item)
- {
-
- case cut:
- MarkerUndoSetup ();
- TECut (markTE);
- (void) ZeroScrap ();
- (void) TEToScrap ();
- break;
-
- case copy:
- TECopy (markTE);
- (void) ZeroScrap ();
- (void) TEToScrap ();
- break;
-
- case paste:
- if (curMSpec == nil) /* ignore if no line selected */
- return (false);
- MarkerUndoSetup ();
- (void) TEFromScrap ();
- TEPaste (markTE);
- break;
-
- case clear:
- MarkerUndoSetup ();
- (void) TEDelete (markTE);
- break;
-
- default:
- return (false); /* all others handled by general */
- /* edit menu handler */
-
- }
-
- MarkToMSpec (/*curMSpec*/); /* sync map with change in mark */
- if (item != copy)
- mapModified = true;
- FixMenus ();
- return (true);
- }
-
-
- /* ---------------------------------------------------------------- */
-
-
- /*
- * Set a field in the currently selected line. Don't call this if
- * no line is selected, or if the field already has the same value.
- */
-
- void
- SetMapFieldValue (short fieldType, short value)
- {
- Str255 s;
-
- switch (fieldType)
- {
-
- case fontField:
- undoVal = curMSpec->font;
- FontToStr (value, s);
- curMSpec->font = value;
- SelectLine (fontList, FontIndex (value));
- break;
-
- case sizeField:
- undoVal = curMSpec->size;
- SizeToStr (value, s);
- curMSpec->size = value;
- SetSizeCtrls ();
- break;
-
- case styleField:
- undoVal = curMSpec->style;
- StyleToStr (value, s);
- curMSpec->style = value;
- SetStyleCtrls ();
- break;
- }
-
- PasteField (mapList, mapList->curLine, fieldType, s);
- mapModified = true;
- undoOp = undoFieldChg;
- undoFieldType = fieldType;
- }
-
-
- /*
- * Set the selection controls and font list to reflect currently
- * selected conversion specification. Also sets current MapSpec
- * pointer.
- */
-
- void
- SetSelectors (short lineNo)
- {
- short i;
-
- if (lineNo == noLine) /* no map line selected */
- {
-
- curMSpec = nil;
- curMSpecNo = noLine;
-
- ListActivate (fontList, false);
-
- for (i = 0; i < maxSize; ++i)
- SetControl (sizeCtrl[i], false);
-
- for (i = 0; i < maxStyle; ++i)
- SetControl (styleCtrl[i], false);
-
- TESetSelect (0L, 32767L, markTE);
- TEDelete (markTE);
- TEDeactivate (markTE);
-
- return;
- }
-
- curMSpec = &mapSpec[curMSpecNo = lineNo];
-
- SelectLine (fontList, FontIndex (curMSpec->font));
- ListActivate (fontList, true);
- ScrollToLine (fontList, fontList->curLine);
- SetSizeCtrls ();
- SetStyleCtrls ();
- MSpecToMark (curMSpec);
- TEActivate (markTE);
- /*SetCPCtrls ();*/
- }
-
-
- /*
- * Map window mouse handler.
- *
- * First test the scroll bars, and return if one was hit; they
- * require no further action.
- *
- * Then check for hit in map list. If a new line was selected, set
- * the selectors to the values, and disable undo.
- *
- * Then, if a line is currently selected, check the selection controls.
- * If one is hit, change the values in the current line and reset the
- * controls properly - but only if the current values *change*.
- */
-
- static pascal void
- Mouse (Point pt, long t, short mods)
- {
- ControlHandle ctrl;
- short index;
- short type;
- long refCon;
- short newVal;
- Boolean newIO;
- short curLine;
- Rect r;
-
- if (ListTestScroll (mapList, pt) || ListTestScroll (fontList, pt))
- return;
-
- curLine = mapList->curLine; /* current line */
- if (ListTestText (mapList, pt))
- {
- if (curLine != mapList->curLine) /* different now? */
- {
- undoOp = noUndo;
- if ((curLine = mapList->curLine) != noLine)
- {
- mapSpec[curLine].selStart = 0;
- mapSpec[curLine].selEnd = 32767;
- }
- /*SetCPMarker (true);*/
- SetSelectors (curLine);
- FixMenus ();
- }
- return;
- }
-
- if (curMSpec == nil)
- return; /* no current line - controls irrelevant */
-
- if (ListTestText (fontList, pt))
- {
- if (fontList->curLine == noLine)
- SelectLine (fontList, fontList->nLines - 1);
- newVal = fontSpecs[fontList->curLine].fontNum;
- if (curMSpec->font != newVal)
- {
- SetMapFieldValue (fontField, newVal);
- FixMenus ();
- }
- return;
- }
-
- /*
- * Check the edittext box
- */
-
- r = (**markTE).viewRect;
- InsetRect (&r, -3, -3);
- if (PtInRect (pt, &r))
- {
- undoOp = noUndo;
- SetCPMarker (true);
- TEClick (pt, (mods & shiftKey) != 0, markTE);
- curMSpec->selStart = (**markTE).selStart;
- curMSpec->selEnd = (**markTE).selEnd;
- FixMenus ();
- return;
- }
-
- /*
- * Don't need to check control type returned from FindControl - at
- * this point, it can't be anything but inCheckBox. The control type
- * and index is coded in the reference constant (see MakeControl).
- */
-
- if (FindControl (pt, mapWind, &ctrl))
- {
- if (TrackControl (ctrl, pt, nil) == inCheckBox)
- {
- refCon = GetCRefCon (ctrl);
- index = refCon & 0x00ff;
- type = (refCon & 0xff00) >> 8;
-
- switch (type)
- {
-
- case sizeType:
- newVal = sizeInfo[index];
- if (newVal != curMSpec->size)
- SetMapFieldValue (sizeField, newVal);
- break;
-
- case styleType:
- newVal = NewStyleValue (index);
- if (newVal != curMSpec->style)
- SetMapFieldValue (styleField, newVal);
- break;
-
- case cpType:
- SetCPMarker (index == 0);
- undoOp = noUndo;
- break;
-
- }
-
- FixMenus ();
- }
- return;
- }
- }
-
-
- /*
- * Process key click in window for mark string. On the first key
- * after any other operation, save the current mark string state
- * for undo. And on every key click, save the selection range. This
- * is so the range can be saved properly if the window is inactivated
- * and later activated, or if another line is selected and then this
- * line is reselected.
- */
-
- static pascal void
- Key (short c, short code, short mods)
- {
- Handle h;
- StringHandle s;
- short len;
-
- if (curMSpec == nil)
- return;
-
- switch (c)
- {
-
- case tab:
- case enter:
- case cr:
- undoOp = noUndo;
- if (mods & shiftKey)
- {
- if (--curMSpecNo < 0)
- curMSpecNo = mapList->nLines - 1;
- }
- else
- {
- if (++curMSpecNo >= mapList->nLines)
- curMSpecNo = 0;
- }
- SelectMapping (curMSpecNo);
- break;
-
- default:
- if (undoOp != undoTyping) /* first char typed */
- {
- MarkerUndoSetup ();
- undoOp = undoTyping;
- }
-
- TEKey (c, markTE);
- MarkToMSpec (/*curMSpec*/);
- SetCPMarker (true);
- mapModified = true;
- FixMenus ();
-
- }
- }
-
-
- static pascal void
- Update (Boolean resized)
- {
- short i;
- Rect r;
-
- MoveTo (65, 14);
- DrawString ("\pFont");
- MoveTo (180, 14);
- DrawString ("\pPoint Size");
- MoveTo (322, 14);
- DrawString ("\pStyle");
- MoveTo (30, 145);
- DrawString ("\pMarker");
- MoveTo (4, 190);
- DrawString ("\pCut & Paste Ops");
- MoveTo (4, 206);
- DrawString ("\pAffect:");
- MoveTo (212, 143);
- DrawString ("\pFormat Specifications");
- DrawControls (mapWind);
- r = (**markTE).viewRect;
- EraseRect (&r);
- TEUpdate (&r, markTE);
- InsetRect (&r, -3, -3);
- FrameRect (&r);
- DrawListFrame (fontList);
- DrawListFrame (mapList);
- DrawListText (fontList);
- DrawListText (mapList);
- }
-
-
- /*
- * When the window is activated, do appropriate map list and font list
- * line and scroll bar hiliting, and set size and style controls to
- * current values.
- *
- * When the window is deactivated, all hiliting is turned off, the
- * scroll bars are unhilited and the size and style controls go blank.
- *
- * Note that SetSelectrs takes care of setting font list line and scroll
- * bar hiliting; it doesn't have to be done here. It also activates
- * or deactivates the text field properly.
- */
-
- static pascal void
- Activate (Boolean active)
- {
- if (active)
- {
- SkelDoUpdates ();
- ListActivate (mapList, true);
- SetSelectors (mapList->curLine);
- }
- else
- {
- SetSelectors (noLine);
- ListActivate (mapList, false);
- }
- FixMenus ();
- }
-
-
- static pascal void
- Clobber (void)
- {
- HideWindow (mapWind);
- TEDispose (markTE);
- /*DisposeList (mapList);
- DisposeList (fontList);*/
- DisposeWindow (mapWind);
- }
-
-
- static pascal void
- Idle (void)
- {
- TEIdle (markTE);
- }
-
-
- /*
- * Create controls. These are created in the same order as the specs
- * in the ctrlInfo array.
- */
-
- static ControlHandle
- MakeControl (short proc, short type, short index)
- {
- static short i = 0; /* used to step through ctrlInfo array */
- CtrlInfo *cInfo;
- Rect r;
- StringPtr title;
- short h, v;
- ControlHandle ctrl;
-
- cInfo = &ctrlInfo[i++];
- title = cInfo->cTitle;
- h = cInfo->ch;
- v = cInfo->cv;
- SetRect (&r, h, v, h + StringWidth (title) + 20, v + 20);
- ctrl = NewControl (mapWind,
- &r,
- title,
- true,
- 0, 0, 1,
- proc,
- (long) (type << 8 | index));
- return (ctrl);
- }
-
-
- void
- MapSetup (void)
- {
- short i;
- Rect r;
-
- SetRect (&r, 0, 0, 456, 251);
- if (SkelQuery (skelQHasColorQD))
- {
- mapWind = NewCWindow (nil, &r, "\p", false, noGrowDocProc,
- (WindowPtr) -1L, false, 0L);
- }
- else
- {
- mapWind = NewWindow (nil, &r, "\p", false, noGrowDocProc,
- (WindowPtr) -1L, false, 0L);
- }
- SkelWindow (mapWind,
- Mouse,
- Key,
- Update,
- Activate,
- nil,
- Clobber,
- Idle,
- true);
-
- TextFont (0); /* do this so StringWidth calculations */
- TextSize (0); /* for controls will be accurate */
-
- for (i = 0; i < maxSize; ++i)
- sizeCtrl[i] = MakeControl (radioButProc, sizeType, i);
-
- for (i = 0; i < maxStyle; ++i)
- styleCtrl[i] = MakeControl (checkBoxProc, styleType, i);
-
- for (i = 0; i < maxCP; ++i)
- cpCtrl[i] = MakeControl (radioButProc, cpType, i);
-
- SetRect (&r, 7, 152, 107, 168);
- markTE = TENew (&r, &r);
- (void) ZeroScrap ();
-
- InitList (fontList, maxFonts); /* initialize empty list */
- InitList (mapList, maxMappings);
- for (i = 0; i < maxMappings; ++i)
- InitMSpec (&mapSpec[i]);
-
- /*
- * Add default set of fonts: ImageWriter fonts and LaserWriter fonts.
- * Reset the list and add the two sets without asking whether to add to
- * or replace the current list, since there's not really any current
- * list.
- */
-
- ResetFontList ();
- StrFonts (false);
-
- ClearMapName ();
- SkelPositionWindow (mapWind, skelPositionOnMainDevice,
- FixRatio (1, 2), FixRatio (1, 5));
- ShowWindow (mapWind);
- }
-