Creating and building your own LaunchPad

From EDM2
Revision as of 23:29, 7 April 2018 by Ak120 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

By Richard K. Goran

Figure 1

The introduction of the LaunchPad with Warp provides OS/2 users with a handy, time-saving technique for selecting and launching Workplace Shell objects with a single mouse button click. Typical of so many things in OS/2, the developers did a much better job designing the LaunchPad than the chroniclers did documenting it.

Figure 2

The default LaunchPad is created on the Desktop when you install OS/2. Like all WPS objects, it has a settings notebook that allows you customize what the LaunchPad looks like on your system as well as how it is configured. Figure 1 shows the default LaunchPad in its horizontal orientation. Figure 2 shows the same LaunchPad in the vertical orientation. The selection of the default horizontal LaunchPad versus the optional vertical LaunchPad is controlled with one of the radio buttons on page one of the Settings Notebook for the LaunchPad.

Figure 3
Figure 4

Figures 3 and 4 show the options that can be selected for the LaunchPad. For those of you who have not had a chance to use the Warp launch pad yet, the bars above (horizontal format) or to the right (vertical format) of the first two icons on the LaunchPad are called drawers. A single left mouse button (LMB) on the drawer bar causes the drawer to pop open and any additional objects that have been positioned in the drawer can be launched with a single LMB. (My apologies to the southpaw readers for using just the right-handed designations).

Each object in the LaunchPad is a shadow of some other object on the Desktop or within one of the folders subordinate to the Desktop. To add an object to the LaunchPad, simply RMB drag any object and drop it on either the LaunchPad itself or on one of its drawers. When you want to drop an object between two other objects on the LaunchPad face plate (the LaunchPad icons that are not in the drawers), a black bar will appear between the two positions when it is alright to release the RMB. Similarly, adding an object to a drawer is accomplished by dragging an object to the position on the drawer where you want the new object to appear and dropping it when the black bar is in the proper position. Since LaunchPad objects are, by definition, shadows its is unnecessary to hold <Ctrl-Shift> when dragging an object to the LaunchPad as you would do if you were creating a shadow elsewhere.

You must be wondering at this point why I chose to describe the workings of the LaunchPad in a REXX column. The answer is simply that you can customize your own LaunchPad with a fairly simple REXX program. The LaunchPad class allows setup strings to be used to define the characteristics of the LaunchPad and to allow the LaunchPad to be built with the SysCreateObject() function and modified with the SysSetObjectData() function, both of which are found in REXXUTIL. Table 5, reprinted from the REXX Reference Summary Handbook, contains all of the setup string key word / value pairs that are used to build the LaunchPad. The program shown in Listing 7 was used to construct the LaunchPad shown in Figure 6. This program, 9506ls01.cmd is available for anonymous download.

Figure 6

Publication space limits my description of the REXX program; however, certain things should be noted. Both the FPOBJECTS objects (lines 0025 - 0032) as well as the DRAWEROBJECTS objects (lines 0052-0053, 0068-0072, ...) are structured so that the lines are interchangeable. That is, they can be moved around interchangeably between definitions. Even though these objects are part of comma delimited lists, the last object may be followed by a comma even though it is not necessary (line 0032 is an example).

The LaunchPad is actually built by the CALL instruction to SysCreateObject() (lines 0035 - 0039). The 'R' parameter (line 0039) indicates that the LaunchPad should be replaced if it already exists. The drawer objects are added with the calls to SysSetObjectData() (lines 0093-0098) and the object is made visible with the call to the new Warp function SysOpenObject(). A description of the SysOpenObject() function appeared in my OS/2 Magazine REXX column on page 58 of the February, 1995 issue. Though the function appears in the online REXX information, the description is an example of my opening comment about the inadequacy of the OS/2 documentation.

While most of the objects placed on the LaunchPad face plate and in drawers are designated with the object IDs, line 0053 represents a folder (WWW) that is placed in a drawer with the file system name of the path to the folder and line 0063 results in the program PmCamera being added to a drawer in face plate 3 by specifying it full file-system name.

With experimentation, you can "have it your way". Just remember, if you drag and drop objects onto your newly created LaunchPad, be sure to update your program that you used to build it in the first place.

Table 5 - WPLaunchPad Setup Strings
WPLaunchPad
Key Name
Value Description
DRAWEROBJECTS n,object [, ...] A comma delimited list, each of which represents a drawer number followed by either object IDs or fully qualified path names. The drawer number (0 = LaunchPad itself, 1 = first drawer, etc.) is separated from the object name with a comma.
FPOBJECTS filename [, ...] A comma delimited list of objects to be added to the end of the LaunchPad. The value(s) for this key name is/are object IDs or fully qualified path names.
Note: This is equivalent to specifying DRAWEROBJECTS with a drawer number of 0.
LPACTIONSTYLE TEXT Display action buttons as text.
MINI Display action buttons as mini icons.
NORMAL Display action buttons as normal sized icons.
OFF Do not display action buttons.
LPCLOSEDRAWER YES Specifies whether a drawer should be closed after a LaunchPad object is opened.
LPDRAWERTEXT YES Specifies whether object titles should be displayed on the LaunchPad drawers (not buttons).
LPFLOAT YES Specifies whether the LaunchPad should float to the top of other windows.
LPHIDECTLS NO Specifies whether the LaunchPad frame controls (i.e. title bar and icon) should be hidden.
LPSMALLICONS YES Specifies whether small icons or default size icons should be displayed on the LaunchPad.
LPTEXT YES Specifies whether object titles should be displayed on the LaunchPad buttons (not drawers).
LPVERTICAL YES Specifies whether the LaunchPad should be displayed horizontally or vertically.

Listing 7 - REXX Program to build your own launchPad

 /* 9506ls01.CMD - Build your own Launchpad */
                                                     /* 0002 */
 LaunchPadID = '<WP_LAUNCHPAD>'                      /* 0003 */
 location    = '<WP_OS2SYS>'                         /* 0004 */
 title       = 'LaunchPad'                           /* 0005 */
 class       = 'WPLaunchPad'                         /* 0006 */
                                                     /* 0007 */
 /*------------------------*\                        /* 0008 */
 |  Setup LaunchPad string  |                        /* 0009 */
 \*------------------------*/                        /* 0010 */
 parameters =,                                       /* 0011 */
    'CCVIEW=NO;'                              ||,    /* 0012 */
    'HELPPANEL=32253;'                        ||,    /* 0013 */
    'ICONRESOURCE=74 PMWP.DLL;'               ||,    /* 0014 */
    'LPACTIONSTYLE=OFF;'                      ||,    /* 0015 */
    'LPCLOSEDRAWER=YES;'                      ||,    /* 0016 */
    'LPDRAWERTEXT=YES;'                       ||,    /* 0017 */
    'LPFLOAT=NO;'                             ||,    /* 0018 */
    'LPHIDECTLS=YES;'                         ||,    /* 0019 */
    'LPSMALLICONS=YES;'                       ||,    /* 0020 */
    'LPTEXT=YES;'                             ||,    /* 0021 */
    'LPVERTICAL=YES;'                         ||,    /* 0022 */
    'NOPRINT=YES;'                            ||,    /* 0023 */
    'FPOBJECTS='                              ||,    /* 0024 */
       '<WP_DRIVES>,'                /* 01 */ ||,    /* 0025 */
       '<WPPO_HPLaserJ>,'            /* 02 */ ||,    /* 0026 */
       '<Corel_Draw!>,'              /* 03 */ ||,    /* 0027 */
       '<WP_MEGASCAN^3>,'            /* 04 */ ||,    /* 0028 */
       '<WP_OS2WIN>,'                /* 05 */ ||,    /* 0029 */
       '<TAPCIS>,'                   /* 06 */ ||,    /* 0030 */
       '<WordPerfect_for_Windows>,'  /* 07 */ ||,    /* 0031 */
       '<WP_GAMES>,'                 /* 08 */ ||,    /* 0032 */
       ';'                                    ||,    /* 0033 */
    'OBJECTID=' || LaunchPadID || ';'                /* 0034 */
                                                     /* 0035 */
 call SysCreateObject class,,                        /* 0036 */
                      title,,                        /* 0037 */
                      location,,                     /* 0038 */
                      parameters,,                   /* 0039 */
                      'R'                            /* 0040 */
 if RESULT <> 1 then                                 /* 0041 */
    do                                               /* 0042 */
       say '   Error creating launchpad'             /* 0043 */
       exit                                          /* 0044 */
    end                                              /* 0045 */
                                                     /* 0046 */
 /*----------------------*\                          /* 0047 */
 |  Setup drawer strings  |                          /* 0048 */
 \*----------------------*/                          /* 0049 */
 drawer_01 =,                                        /* 0050 */
    'DRAWEROBJECTS=01,'                       ||,    /* 0051 */
       '<BackMaster>,'                        ||,    /* 0052 */
       'L:\WWW,'                              ||,    /* 0053 */
       ';'                                           /* 0054 */
                                                     /* 0055 */
 drawer_02 =,                                        /* 0056 */
    'DRAWEROBJECTS=02,'                       ||,    /* 0057 */
       '<WPPO_FxPrint>,'                      ||,    /* 0058 */
       ';'                                           /* 0059 */
                                                     /* 0060 */
 drawer_03 =,                                        /* 0061 */
    'DRAWEROBJECTS=03,'                       ||,    /* 0062 */
       'c:\os2addon\pmcamera.exe,'            ||,    /* 0063 */
       ';'                                           /* 0064 */
                                                     /* 0065 */
 drawer_05 =,                                        /* 0066 */
    'DRAWEROBJECTS=05,'                       ||,    /* 0067 */
       '<WP_WINFS>,'                          ||,    /* 0068 */
       '<WP_WIN2WIN>,'                        ||,    /* 0069 */
       '<WP_DOSFS>,'                          ||,    /* 0070 */
       '<WP_DOSWIN>,'                         ||,    /* 0071 */
       '<WP_OS2FS>,'                          ||,    /* 0072 */
       ';'                                           /* 0073 */
                                                     /* 0074 */
 drawer_06 =,                                        /* 0075 */
    'DRAWEROBJECTS=06,'                       ||,    /* 0076 */
       '<IAK_SLIPPM>,'                        ||,    /* 0077 */
       '<ADV_DIALER>,'                        ||,    /* 0078 */
       '<WP_OS/2_CIM__>,'                     ||,    /* 0079 */
       '<WP_INTERNET^C>,'                     ||,    /* 0080 */
       '<WP_XTALK_^MK_>,'                     ||,    /* 0081 */
       ';'                                           /* 0082 */
                                                     /* 0083 */
 drawer_07 =,                                        /* 0084 */
    'DRAWEROBJECTS=07,'                       ||,    /* 0085 */
       '<WP_WP_5.1>,'                         ||,    /* 0086 */
       '<WP_REXX_^HAND>,'                     ||,    /* 0087 */
       ';'                                           /* 0088 */
                                                     /* 0089 */
 /*-----------------------------------------------*\ /* 0090 */
 |  Add drawers to LaunchPad & open it on Desktop  | /* 0091 */
 \*-----------------------------------------------*/ /* 0092 */
 call SysSetObjectData LaunchpadID, drawer_01        /* 0093 */
 call SysSetObjectData LaunchpadID, drawer_02        /* 0094 */
 call SysSetObjectData LaunchpadID, drawer_03        /* 0095 */
 call SysSetObjectData LaunchpadID, drawer_05        /* 0096 */
 call SysSetObjectData LaunchpadID, drawer_06        /* 0097 */
 call SysSetObjectData LaunchpadID, drawer_07        /* 0098 */
                                                     /* 0099 */
 call SysOpenObject LaunchpadID, 0, 1                /* 0100 */
 exit                                                /* 0101 */

See also LaunchPad Revisited by the same author.