begin external class windowtools; MainWindow class TypeFaceWindow; begin ref(RadioPanel) face_panel, point_panel, bold_panel, obliq_panel; ref(Button) stop_button; ref(SubWindow) typeface_wnd; procedure handle_Selection(Window, Item, ItemN); Ref(XWindow) Window; Text Item; Integer ItemN; ShowTypeface; procedure ShowTypeface; inspect typeface_wnd do begin SetTypeFace(face_panel .CurrentChoice, point_panel.CurrentChoice.getint, bold_panel .CurrentChoice = "Yes", obliq_panel.CurrentChoice = "Yes"); Clear; if FontExists then begin integer mid_y; mid_y := (height + head_height)//2; SetHeading(CurrentFontname); DrawTextPos(width//2, mid_y - font_height, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", CenterPos, CenterPos); DrawTextPos(width//2, mid_y, "abcdefghijklmnopqrstuvwxyz", CenterPos, CenterPos); DrawTextPos(width//2, mid_y + font_height, "1234567890!#$%^&*()_+|~-=\`{}[];'<>?/", CenterPos, CenterPos); end else SetHeading("No such font!"); end; SetBackGround("gray25"); SettNorskTekst; stop_button :- MakeButton("Stop"); face_panel :- MakeRadioPanel.SetHorizontal .AddSetButton("helvetica") .AddButton("courier") .AddButton("times") .AddButton("lucida") .AddButton("lucidabright") .AddButton("charter") .SetHeading("Typeface:"); bold_panel :- MakeRadioPanel.SetHorizontal .AddSetButton("Yes") .AddButton("No") .SetHeading(" Bold? ") .PlaceRightof(face_panel); obliq_panel :- MakeRadioPanel.SetHorizontal .AddButton("Yes") .AddSetButton("No") .SetHeading(" Oblique? ") .PlaceRightof(bold_panel); point_panel :- MakeRadioPanel.SetVertical .AddButton("8") .AddButton("10") .AddButton("12") .AddButton("14") .AddSetButton("18") .AddButton("24") .SetHeading("Point:") .PlaceLeftBelow(face_panel); typeface_wnd :- new SubWindow(this TypeFaceWindow) .SetHeading(" Typeface ") .PlaceRightof(point_panel) .SetSize(obliq_panel.max_x - face_panel.min_x - 2*BorderWidth, point_panel.height) .Show; stop_button.SetSize(point_panel.width, face_panel.height); face_panel.PlaceRightof(stop_button); SetSizeToSubwindowSize; Show; ShowTypeface; stop_button.Wait; end; new TypeFaceWindow(" Typeface display "); end;