═══ 1. Usage Instructions ═══ How to Use the Contents (The following instructions are taken from the OS/2 online Command Reference.) When the Contents window first appears, some topics have a plus (+) sign beside them. The plus sign indicates that additional topics are available. To expand the Contents if you are using a mouse, click on the plus sign. If you are using the keyboard, use the Up or Down Arrow key to highlight the topic, and press the plus (+) key. For example, Keyword Instructions has a plus sign beside it. To see the complete list of REXX keyword instructions, click on the plus sign or highlight that topic and press the plus (+) key. To view a topic, double-click on the topic (or press the Up or Down Arrow key to highlight the topic, and then press the Enter key). How to Obtain Additional Information After you select a topic, the information for that topic appears in a window. You will notice that certain words in the text may be specially highlighted (The default color for this special highlighting is green). These words are links to additional information. If you are using a mouse, double-click on the highlighted word. If you are using a keyboard, press the Tab key to move to the highlighted word, and then press the Enter key. Additional information will appear in a pop-up window. How to Use Action Bar Choices A number of choices are available for managing information presented in the REXX Quick Reference. If you want to see more information about these choices, click on the name of the choice (or press the Tab key to move to the choice and press Enter). Bookmark Allows you to set a placeholder so you can retrieve information of interest to you. (This choice is available from the Services pull-down). Search Allows you to find occurrences of a word or phrase in the current topic, selected topics, or all topics. (This choice is available from the Services pull-down). Print Allows you to print one or more topics. (This choice is available from the Services pull-down). Copy Allows you to copy a topic you are viewing to a file you can edit. (This choice is available from the Services pull-down). Options Allows you to change the way your Contents is displayed. ═══ 2. About this package ═══ This package contains (among other things) the C code for a DLL that enables the use of any font (including monospaced ones) in EASEL listboxes. I originally changed fonts only in listboxes, and to do so I subclassed the dialog procedure, and changed the listbox style to owner draw. This works just fine, but adds the nuisance of having to keep around instance data for each listbox while not being able to use window words (in EASEL) to store it. With the advent of OS/2 1.2, I switched techniques for font manipulation; I employ the WinSetPresParam API, which does not require me to store instance data on a per listbox basis. Now I can change fonts in any dialog control. I can change colors, also, although unless the user is given some options to change them this is not really CUA. The original font changing program was based on the ideas found in a program called LBFONT that was written by Easel Corp. and given away at one of their EASEL training classes, and a different program called LBFONT that was found on BIX. The program in this package bears no real resemblance to either of those; parts of the logic are based on ideas in Charles Petzold's fontlist.exe program, and the IBM 1.2 PTI sample program fonttest.exe. This was all done pre-1.3, pre-ATM. It *does* not appear as though there is any way to specify an outline font for use with WinSetPresParam. I would appreciate hearing from anyone who finds a way to do so. This package is released into the public domain; use it any way you like. I would appreciate hearing of any errors or omissions that you find. Now, to satisfy the lawyers: no warranties, guarantees, etc. are implied, no liability is assumed. You break it and you own both halves. Any opinions expressed herein are my own, not that of my employer or any vendor. Brian Buck 23SEP90 Internet 76666.60@Compuserve.COM Compuserve 76666,60 Phone (708) 620-5000 Trademark Information. EASEL is a trademark of Easel Corporation. OS/2 is a trademark of International Business Machines Corporation. Presentation Manager is a trademark of International Business Machines Corporation. ═══ 3. What's in this package? ═══ The following sections detail the contents of this package. ═══ 3.1. Read.Me ═══ The Read.Me file just tells you how to view this online reference. ═══ 3.2. FntDemo.IPF ═══ FntDemo.IPF contains (in source form) the information you are viewing now. The Information Presentation Facility (IPF, also known as the Help Manager) provides an undocumented but nonetheless supported method for creating standalone online references like the one you are using now, or like the OS/2 Command Reference. You can use the IPF compiler to create modular online documentation for your library of reusable code. It is possible to view multiple .INF files as a composite book -- just look at how the IBM OS/2 1.2 PTI (Programming Tools and Information, aka toolkit) organizes the online programming reference. How to compile To compile an IPF file into a standalone reference (an INF file), you must have the PTI (1.2 toolkit) installed. Use the following: ipfc yourfile.ipf /inf /cou=001 /codepage=850 /l=enu When you include the /inf command line switch, you generate an .INF file rather than the default .HLP file. ═══ 3.3. FntDemo.INF ═══ The FntDemo.INF file is the compiled form of the .IPF file for the online reference. How to view To view this (or any other .INF file) you can simply type: view fntdemo.inf from the command line of any OS/2 command session. You must fully qualify the name of the .INF file if it is not in your current directory. You can also install this in an OS/2 program group. ═══ 3.4. FntDemo.C ═══ The FntDemo.C file contains the source code for the FntDemo.DLL dynalink library. This library contains the subroutines: o ChangeHANDLE_FontToPOINTSFACE_ o ChangeHANDLE_FontToDefault o MakeHANDLE_ForegroundCOLOR_ o MakeHANDLE_BackgroundCOLOR_ o MakeHANDLE_HiliteForegroundCOLOR_ o MakeHANDLE_HiliteBackgroundCOLOR_ o MakeHANDLE_DisabledForegroundCOLOR_ o MakeHANDLE_DisabledBackgroundCOLOR_ o MakeHANDLE_BorderCOLOR_ o ErrMsgFromChangeHANDLEFont o ErrMsgFromMakeHANDLECOLOR Because these subroutines are intended for use in EASEL programs, an EASEL style nomenclature is used rather than C style. The idea is that you would ideally want to be able to code: change LB_MyListbox font to 10 "System Monospaced" But since EASEL is not fully object-oriented, you can't define new methods using the same syntax as the underlying language. So instead you code: string FONT_10_SYSTEM_MONOSPACED is "10.System Monospaced" string Handle ... copy handle of LB_MyListbox to Handle call ChangeHANDLE_FontToPOINTSFACE_ ( Handle, FONT_10_SYSTEM_MONOSPACED ) if (errorlevel != 0) then # handle errors send errorlevel " " ErrMsgFromChangeHANDLEFont ( errorlevel ) to errorlog end if ═══ 3.5. FntDemo.INC ═══ The FntDemo.INC file is the EASEL include file that contains the subroutine and function definitions for the following routines: o ChangeHANDLE_FontToPOINTSFACE_ o ChangeHANDLE_FontToDefault o MakeHANDLE_ForegroundCOLOR_ o MakeHANDLE_BackgroundCOLOR_ o MakeHANDLE_HiliteForegroundCOLOR_ o MakeHANDLE_HiliteBackgroundCOLOR_ o MakeHANDLE_DisabledForegroundCOLOR_ o MakeHANDLE_DisabledBackgroundCOLOR_ o MakeHANDLE_BorderCOLOR_ o ErrMsgFromChangeHANDLEFont o ErrMsgFromMakeHANDLECOLOR ═══ 3.6. FntDemo.EAL ═══ The FntDemo.EAL file contains a trivial EASEL program that simply demonstrates the use of the FntDemo subroutines. ═══ 3.7. FntDemo.EBI ═══ The FntDemo.EBI file contains the compiled form of the FntDemo.EAL program. ═══ 3.8. FntDemo.DEF ═══ The FntDemo.DEF file is the link definition file for the FntDemo.DLL dynalink library. ═══ 3.9. FntDemo.DLL ═══ The FntDemo.DLL file contains the compiled and linked Dynalink library required for EASEL programs to use the subroutines. This file must be in a directory that is specified in your LIBPATH in your CONFIG.SYS file. Rather than dedicate one directory to contain DLLs, I find it convenient to include a "." as the first thing in my LIBPATH. This means that the current directory is searched first for DLLs. A variation is to specify .\DLL; For example: LIBPATH=.;.\DLL;C:\OS2\DLL;E:\EASEL-EE\DLL;...etc. ═══ 3.10. FntDemo.CMD ═══ Why a .CMD file and not a make file? Because the IBM C/2 Make and the Microsoft C Make are so different that it is too confusing to provide only one, and too much work for me to provide both. A command file is not ambiguous. ═══ 3.11. MakeINF.CMD ═══ Compiles the FntDemo.IPF file with the IPF compiler. It compiles it into the FntDemo.INF file. ═══ 4. OS/2 1.2 Fonts ═══ The following sections provide some information on the fonts that are distributed with OS/2 1.2 and are by default installed. Sources of info are visual comparisons of info from: fontlist.exe (Petzold) fonttest.exe (IBM 1.2 PTI) system editor (1.2) ═══ 4.1. VGA Fonts ═══ Font Device Res = 96 x 96 Cell := Average character width x Max baseline extent ┌────────────────────┬─────────┬──────┐ │ │Character│ Point│ │Face name │ Cell │ Size │ ├════════════════════┼═════════┼══════┤ │System Proportional │ 6 x 16 │ 10 │ ├────────────────────┼─────────┼──────┤ │ System Monospaced │ 9 x 20 │ 12 │ │ System Monospaced │ 8 x 16 │ 10 │ ├────────────────────┼─────────┼──────┤ │ Courier │ 8 x 13 │ 8 │ │ Courier │ 9 x 16 │ 10 │ │ Courier │ 12 x 20 │ 12 │ ├────────────────────┼─────────┼──────┤ │ Helv │ 5 x 13 │ 8 │ │ Helv │ 6 x 16 │ 10 │ │ Helv │ 7 x 20 │ 12 │ │ Helv │ 8 x 24 │ 14 │ │ Helv │ 11 x 29 │ 18 │ │ Helv │ 14 x 37 │ 24 │ ├────────────────────┼─────────┼──────┤ │ Tms Rmn │ 4 x 13 │ 8 │ │ Tms Rmn │ 5 x 16 │ 10 │ │ Tms Rmn │ 6 x 19 │ 12 │ │ Tms Rmn │ 7 x 21 │ 14 │ │ Tms Rmn │ 10 x 27 │ 18 │ │ Tms Rmn │ 13 x 35 │ 24 │ └────────────────────┴─────────┴──────┘ ═══ 4.2. EGA Fonts ═══ Font Device Res = 96 x 72 Cell := Average character width x Max baseline extent ┌────────────────────┬─────────┐ │ │Character│ │Face name │ Cell │ ├════════════════════┼═════════┤ │ System Monospaced │ 8 x 12 │ ├────────────────────┼─────────┤ │ Courier │ 6 x 12 │ │ Courier │ 7 x 15 │ │ Courier │ 8 x 10 │ │ Courier │ 8 x 18 │ │ Courier │ 9 x 12 │ │ Courier │ 12 x 10 │ │ Courier │ 12 x 15 │ │ Courier │ 10 x 22 │ │ Courier │ 14 x 28 │ ├────────────────────┼─────────┤ │ Helv │ 5 x 10 │ │ Helv │ 6 x 12 │ │ Helv │ 7 x 15 │ │ Helv │ 8 x 18 │ │ Helv │ 10 x 22 │ │ Helv │ 14 x 28 │ ├────────────────────┼─────────┤ │ Tms Rmn │ 4 x 10 │ │ Tms Rmn │ 5 x 12 │ │ Tms Rmn │ 6 x 15 │ │ Tms Rmn │ 7 x 16 │ │ Tms Rmn │ 10 x 20 │ │ Tms Rmn │ 13 x 26 │ └────────────────────┴─────────┘ ═══ 4.3. CGA Fonts ═══ Font Device Res = 96 x 48 Cell := Average character width x Max baseline extent ┌────────────────────┬─────────┐ │ │Character│ │Face name │ Cell │ ├════════════════════┼═════════┤ │ System Monospaced │ 8 x 8 │ ├────────────────────┼─────────┤ │ Courier │ 8 x 7 │ │ Courier │ 9 x 8 │ │ Courier │ 12 x 10 │ ├────────────────────┼─────────┤ │ Helv │ 5 x 6 │ │ Helv │ 6 x 8 │ │ Helv │ 7 x 10 │ │ Helv │ 8 x 12 │ │ Helv │ 11 x 15 │ │ Helv │ 14 x 19 │ ├────────────────────┼─────────┤ │ Tms Rmn │ 4 x 6 │ │ Tms Rmn │ 6 x 8 │ │ Tms Rmn │ 7 x 10 │ │ Tms Rmn │ 7 x 11 │ │ Tms Rmn │ 10 x 14 │ │ Tms Rmn │ 14 x 18 │ └────────────────────┴─────────┘ ═══ 4.4. 8514 Fonts ═══ Font Device Res = 120 x 72 Cell := Average character width x Max baseline extent ┌────────────────────┬─────────┐ │ │Character│ │Face name │ Cell │ ├════════════════════┼═════════┤ │ Courier │10 x 10 │ │ Courier │12 x 12 │ │ Courier │15 x 15 │ ├────────────────────┼─────────┤ │ Helv │ 6 x 10 │ │ Helv │ 7 x 12 │ │ Helv │ 9 x 15 │ │ Helv │10 x 18 │ │ Helv │13 x 22 │ │ Helv │18 x 28 │ ├────────────────────┼─────────┤ │ Tms Rmn │ 6 x 10 │ │ Tms Rmn │ 7 x 12 │ │ Tms Rmn │ 9 x 15 │ │ Tms Rmn │10 x 16 │ │ Tms Rmn │13 x 21 │ │ Tms Rmn │17 x 27 │ └────────────────────┴─────────┘ ═══ 5. EASEL Subroutines, Functions ═══ The following sections describe the EASEL subroutines and functions provided by the FntDemo package through the FntDemo.INC and FntDemo.DLL files. The convention used for naming the subroutines corresponds as closely as possible with the nomenclature used in the base EASEL language, and in the descriptions of EASEL syntax. A subroutine or function name consists of several words. Words that are descriptive of the function appear with the first letter capitalized, and the rest in lower case. Words that represent a parameter to be passed appear in all upper case, and are suffixed with an underscore character. For example, in the subroutine name ChangeHANDLE_FontToPOINTSFACE_ the words that describe the function are Change, Font, and To. The words that represent the parameters to be passed are HANDLE_ and POINTSFACE_. This naming convention seems to mesh best with the native EASEL language syntax. ═══ 5.1. ChangeHANDLE_FontToPOINTSFACE_ ═══ Changes the font used in displaying a dialog control. Any EASEL control object can be specified. This subroutine sets the builtin EASEL errorlevel function to zero for a successful change, and to a non-zero value for an unsuccessful change. The error message for an unsuccessful change can be retrieved with the ErrMsgFromChangeHANDLEFont function. subroutine ChangeHANDLE_FontToPOINTSFACE_ ( integer : Handle # input handle of CONTROL , string : PointsDotFaceName # input e.g., "12.Helv" ) # library "FNTDEMO" # sets errorlevel ═══ 5.2. ChangeHANDLE_FontToDefault ═══ Restores the dialog control's font to its original font. subroutine ChangeHANDLE_FontToDefault ( integer : Handle # input handle of CONTROL ) # library "FNTDEMO" # sets errorlevel ═══ 5.3. MakeHANDLE_PP_COLOR_ ═══ This is primarily an internal routine for use by the other EASEL MakeHANDLE_COLOR_ subroutines, but it can be called directly using the PP_ defined constants from the 'C' header file PMWIN.H. Only the PP_ constants for color changes should be used; no error checking is performed on the passed PP_ constant. This subroutine sets the builtin EASEL errorlevel function to zero for a successful change, and to a non-zero value for an unsuccessful change. The error message for an unsuccessful change can be retrieved with the ErrMsgFromMakeHANDLECOLOR function. subroutine MakeHANDLE_PP_COLOR_ ( integer : Handle # input handle of CONTROL , integer : PresParamConstant # input e.g., PP_BORDERCOLOR , integer : ColorNumber # input e.g., 1 ) # library "FNTDEMO" # sets errorlevel ═══ 5.4. MakeHANDLE_ForegroundCOLOR_ ═══ Changes the foreground color of the specified dialog control by changing the value of its PP_FOREGROUNDCOLORINDEX presentation parameter. This subroutine sets the builtin EASEL errorlevel function to zero for a successful change, and to a non-zero value for an unsuccessful change. The error message for an unsuccessful change can be retrieved with the ErrMsgFromMakeHANDLECOLOR function. subroutine MakeHANDLE_ForegroundCOLOR_ ( integer : Handle # input handle of CONTROL , integer : ColorNumber # input e.g., 1 ) # library "FNTDEMO" # sets errorlevel ═══ 5.5. MakeHANDLE_BackgroundCOLOR_ ═══ Changes the background color of the specified dialog control by changing the value of its PP_BACKGROUNDCOLORINDEX presentation parameter. This subroutine sets the builtin EASEL errorlevel function to zero for a successful change, and to a non-zero value for an unsuccessful change. The error message for an unsuccessful change can be retrieved with the ErrMsgFromMakeHANDLECOLOR function. subroutine MakeHANDLE_BackgroundCOLOR_ ( integer : Handle # input handle of CONTROL , integer : ColorNumber # input color, e.g., 1 ) # library "FNTDEMO" # sets errorlevel ═══ 5.6. MakeHANDLE_HiliteForegroundCOLOR_ ═══ Changes the hilite foreground color of the specified dialog control by changing the value of its PP_HILITEFOREGROUNDCOLORINDEX presentation parameter. This subroutine sets the builtin EASEL errorlevel function to zero for a successful change, and to a non-zero value for an unsuccessful change. The error message for an unsuccessful change can be retrieved with the ErrMsgFromMakeHANDLECOLOR function. subroutine MakeHANDLE_HiliteForegroundCOLOR_ ( integer : Handle # input handle of CONTROL , integer : ColorNumber # input e.g., 1 ) # library "FNTDEMO" # sets errorlevel ═══ 5.7. MakeHANDLE_HiliteBackgroundCOLOR_ ═══ Changes the hilite background color of the specified dialog control by changing the value of its PP_HILITEBACKGROUNDCOLORINDEX presentation parameter. This subroutine sets the builtin EASEL errorlevel function to zero for a successful change, and to a non-zero value for an unsuccessful change. The error message for an unsuccessful change can be retrieved with the ErrMsgFromMakeHANDLECOLOR function. subroutine MakeHANDLE_HiliteBackgroundCOLOR_ ( integer : Handle # input handle of CONTROL , integer : ColorNumber # input color, e.g., 1 ) # library "FNTDEMO" # sets errorlevel ═══ 5.8. MakeHANDLE_DisabledForegroundCOLOR_ ═══ Changes the disabled background color of the specified dialog control by changing the value of its PP_DISABLEDBACKGROUNDCOLORINDEX presentation parameter. This subroutine sets the builtin EASEL errorlevel function to zero for a successful change, and to a non-zero value for an unsuccessful change. The error message for an unsuccessful change can be retrieved with the ErrMsgFromMakeHANDLECOLOR function. subroutine MakeHANDLE_DisabledForegroundCOLOR_ ( integer : Handle # input handle of CONTROL , integer : ColorNumber # input e.g., 1 ) # library "FNTDEMO" # sets errorlevel ═══ 5.9. MakeHANDLE_DisabledBackgroundCOLOR_ ═══ Changes the disabled background color of the specified dialog control by changing the value of its PP_DISABLEDBACKGROUNDCOLORINDEX presentation parameter. This subroutine sets the builtin EASEL errorlevel function to zero for a successful change, and to a non-zero value for an unsuccessful change. The error message for an unsuccessful change can be retrieved with the ErrMsgFromMakeHANDLECOLOR function. subroutine MakeHANDLE_DisabledBackgroundCOLOR_ ( integer : Handle # input handle of CONTROL , integer : ColorNumber # input color, e.g., 1 ) # library "FNTDEMO" # sets errorlevel ═══ 5.10. MakeHANDLE_BorderCOLOR_ ═══ Changes the border color of the specified dialog control by changing the value of its PP_BORDERCOLORINDEX presentation parameter. This subroutine sets the builtin EASEL errorlevel function to zero for a successful change, and to a non-zero value for an unsuccessful change. The error message for an unsuccessful change can be retrieved with the ErrMsgFromMakeHANDLECOLOR function. subroutine MakeHANDLE_BorderCOLOR_ ( integer : Handle # input handle of CONTROL , integer : ColorNumber # input e.g., 1 ) # library "FNTDEMO" # sets errorlevel ═══ 5.11. ErrMsgFromChangeHANDLEFont ═══ Returns an error message associated with the given errorlevel number passed from EASEL. It is assumed that: 1. the errorlevel represents an errorlevel due to the ChangeHANDLE_FontToPOINTSFACE_ call. 2. no other PM Winxxx errors have occurred between the ChangeHANDLE_FontToPOINTSFACE_ call and this call. function ErrMsgFromChangeHANDLEFont ( integer : Errorlevel # input errorlevel ) returns string # output error message library "FNTDEMO" # ═══ 5.12. ErrMsgFromMakeHANDLECOLOR ═══ Returns an error message associated with the given errorlevel number passed from EASEL. It is assumed that: 1. the errorlevel represents an errorlevel due to one of the MakeHANDLE_COLOR_ calls. 2. no other PM Winxxx errors have occurred between the MakeHANDLE_COLOR_ call and this call. function ErrMsgFromMakeHANDLEColor ( integer : Errorlevel # input errorlevel ) returns string # output error message library "FNTDEMO" # ═══ ═══ BookMark When you place a bookmark on a topic, it is added to a list of bookmarks you have previously set. You can view the list, and you can remove one or all bookmarks from the list. If you have not set any bookmarks, the list is empty. To set a bookmark, do the following: 1. Select a topic from the Contents. 2. When that topic appears, choose the Bookmark option from the Services pull-down. 3. If you want to change the name used for the bookmark, type the new name in the field. 4. Click on the Place radio button (or press the Up or Down Arrow key to select it) 5. Click on OK (or select it and press Enter). The bookmark is then added to the bookmark list. ═══ ═══ Search You can specify a word or phrase to be searched. You can also limit the search to a set of topics by first marking the topics on the Contents list. To search for a word or phrase in all topics, do the following: 1. Choose the Search option from the Services pull-down. 2. Type the word or words to be searched. 3. Click on All sections (or press the Up or Down Arrow keys to select it) 4. Click on Search (or select it and press Enter) to begin the search. 5. The list of topics where the word or phrase appears is displayed. If only one topic contains the word or phrase, a window containing that topic appears. ═══ ═══ Print You can print one or more topics. You can also print a set of topics by first marking the topics on the Contents list. To print the document Contents list, do the following: 1. Choose Print from the Services pull-down. 2. Click on Contents (or press the Up or Down Arrow key to select it) 3. Click on Print (or select it and press Enter). 4. The Contents list is printed on your printer. ═══ ═══ Copy You can copy a topic you are viewing into a temporary file named TEXT.TMP. You can later edit that file by using the editor of your choice. To copy a topic, do the following: 1. Expand the Contents list and select a topic. 2. When the topic appears, choose Copy to file from the Services pull-down. 3. The system puts the text pertaining to that topic in the temporary TEXT.TMP file. "p.For information on one of the other choices in the Services pull-down, highlight the choice and press the F1 key. ═══ ═══ Options You can control the appearance of the Contents list. To expand the Contents and show all levels for all topics, choose Expand all from the Options pull-down. You can also press the Ctrl and * keys together. For information on one of the other choices in the Options pull-down, highlight the choice and press the F1 key. ═══ ═══ IBM Level 2 says that the method for creating standalone references will be documented in a future release, and is supported.