SP Color functions

1. These are the functions that relate to entire color sets

  SATTCOLOR()         Sets up the the color set for color monitor
  SATTMONO()          Sets up the the color set for MONO
  SATTDIRECT()        Sets up the the color set directly
  SATTGET()           Sets up color set from COLORS.DBF
  SATTPICK()          Sets up color set by selecting from stored definitions
  SATTGETMEM()        Sets up color set from old colors.mem
  SATTPUT()           Stores current color set  to colors.dbf
  SATTPICKPUT()       Stores current SuperLib color set to
                      colors.dbf, with picklist selection of set
  SATTPICKDEL()       Picklist deletion of stored color sets
  SATTPUSH()          Pushes the current SuperLib color set
  SATTPOP()           Pops previously pushed color set
  SETCOLORS()         Interactive color setting -
                      save/restore/edit color sets
  COLPIK()            10 built in color sets to select
                      from a popup

 2. These are the functions that deal with individual color set items

  SLS_NORMCOL()       Normal screen output
  SLS_NORMMENU()      Normal MENU color
  SLS_POPCOL()        Popup screen output
  SLS_POPMENU()       Popup MENU color
  SLS_FRAME()         Box frames
  SLS_SHADATT()       Shadow attribute
  SLS_SHADPOS()       Shadow position
  SLS_XPLODE()        Explode/implode popups

 3. Other color related functions

  SLS_ISCOLOR( )      Is this a color monitor

SP Color Implementation

 This is not the perfect color scheme. It is the one
 this library runs on. The color scheme relates to SuperLib functions,
 and will not affect your other color usage.

 Basically, when a SuperLib metafunction is called, it
 will usually have a main screen, a menu, and a number of popups
 and other attached screens. Rather than have a burned-in color
 set, or use SETCOLOR() as the default, SuperLib has a dynamic
 color scheme, which may be changed and stored by both the
 programmer and the end-user.

 Several global color settings are used by SuperLib
 functions. The settings are accessed and set via a set of
 functions calls, which themselves access a set of STATIC
 variables. The functions are:

   <cSetting> := sls_normcol([cNew])      For normal output
   <cSetting> := sls_normmenu([cNew])     For normal 'menu to'
   <cSetting> := sls_popcol([cNew])       For popup  box colors
   <cSetting> := sls_popmenu([cNew])      For popup box menus
   <cSetting> := sls_frame([cNew])        Frame string
   <nSetting> := sls_shadatt([nNew])      Shadow color attribute
   <nSetting> := sls_shadpos([nNew])      Shadow  position
                 (0,1,3,7,9) to match the numeric keypad
   <lSetting> := sls_xplode([lNew])       Logical - explode
                                          popups

 All colors are of the format "fg/bg,fg/bg,,,fg/bg"

 (fg-foreground bg-background) except for shadow
 attribute, which is numeric.

 By default, a monochrome set of colors is used. You
 may call the function SATTCOLOR() to make the 'color' colors the
 default.

 The function SETCOLORS() allows interactive setting
 of these colors. The variables are stored in COLORS.DBF, which
 contains multiple sets of colors.

 You may override the Clipper ISCOLOR() by
 initializing another setting accessed via the function
 SLS_ISCOLOR(), and setting it to True or False. This is helpful
 in instances where ISCOLOR() sees a color card with a monochrome
 monitor, or some such combination.

 If you are upgrading from 2.50 or previous, see
 "Upgrading" in the appendix.

 

SP_VIEWMEMOS

VIEWMEMOS()

  Short:
  ------
  VIEWMEMOS() Popup viewing (non-edit mode) of memos

  Returns:
  --------
  Nil

  Syntax:
  -------
  VIEWMEMOS([nTop,nLeft,nBottom,nRight],[cColor],[cMemoName])

  Description:
  ------------
  VIEWMEMOS() will determine first off if there are any
  memo fields to view. If there are not, it will display a message
  to that effect and exit.

  If there is only one memo, it will be immediately
  viewed.

  If there are more than one memo, a picklist of memos
  will be popped up for selection. The memo selected will be viewed.

  [nTop,nLeft,nBottom,nRight] are the dimensions of the
  popup box.

  Default is 2,15,22,65. (Just numbers off the top of
  my head.)

  [cColor] is an optional color string. Default is
  sls_popcol().

  [cMemoName] (new to 3.5) allows you to pass in a memo name and
  bypass the "Which memo?" screen.

  Examples:
  ---------
   USE CUSTOMER

   if qfldstype("M") > 0  // qfldstyp() is a superlib function
      VIEWMEMOS()
   endif

  Source:
  -------
  S_VMEMO.PRG

 

SP_VERTVIEW

VERTVIEW()

  Short:
  ------
  VERTVIEW() Pops up a vertical view of the current record

  Returns:
  --------
  Nil

  Syntax:
  -------
  VERTVIEW([aFields,aFDescr],[cColor],[cTitle],[cFooter])

  Description:
  ------------
  Pops up a vertical view of the current record's
  values. Memos are displayed as "(memo - Enter to View)" and pressing CR
  will view them.

  Pressing ESCAPE exits.

  The popup box is displayed centered on the screen. If
  all fields do not fit into the box, scrolling is allowed with the
  arrow keys.

  [aFields] and [aFDescr] are optional fields and field
  descriptions.

  Default is all fields, with field names as
  descriptions.

  [cColor] is the optional box color. Default is
  sls_popcol()

  [cTitle] is an optional title string displayed at
  top,left+1

  [cFooter] is a footer displayed at bottom,left+1.
  Default footer is "ESCAPE to quit"

  Examples:
  ---------
   if nLastkey = K_ALT_V
     VERTVIEW()
   endif

  Source:
  -------
  S_VVIEW.PRG

 

SP_SLS_POPCOL

SLS_POPCOL()

  Short:
  ------
 SLS_POPCOL() A Superlib color setting function

 Returns
 <cSetting> => Current value of the setting

 Syntax
 SLS_POPCOL([cNew])

 Function                   Setting                     Default
 --------------------------------------------------------------
 SLS_POPCOL([cNew])         Popup screen output         'N/W,+W/N,,,W/N'

 [cNew] sets the setting to a new setting
 If [cNew] is passed, the setting is changed and the
 new setting is returned.

 Examples

  SETCOLOR(sls_POPCOL()  )        // use to setcolor()

 Notes:

 Source: S_GLOBAL.PRG

 

SP_MAKEBOX

MAKEBOX()

  Short:
  ------
  MAKEBOX() Draws a box on the screen and returns saved screen

  Returns:
  --------
  <cScreen> => string containing underlying screen &
  colors

  Syntax:
  -------
  MAKEBOX(nTop,nLeft,nbottom,nRight,[cColor],[nShadowPos])

  Description:
  ------------
  Draws a box at screen coordinates <nTop..nRight> and
  returns a string containing the underlying screen and previous color.
  Box will explode or not based on the setting of SLS_XPLODE().

  Default color is setcolor(). Default shadow position
  is the setting in SLS_SHADPOS(). These may be passed as
  options . Shadow position [nShadowPos] has allowable values of
  (1,3,7,9,0) to match the corner positions on the numeric keypad.
  0 is no shadow. [cColor] is a valid color string or variable.

  Examples:
  ---------

   cBox := MAKEBOX(5,5,10,10)
   //draws a box at 5,5,10,10. Color is SETCOLOR().
   //shadow position is based on SLS_SHADPOS().

   cBox: = MAKEBOX(5,5,10,10,SLS_POPCOL())
   //draws a box at 5,5,10,10. Color is SLS_POPCOL().
   //shadow position is based on SLS_SHADPOS().

   cBox: = MAKEBOX(5,5,10,10,SLS_POPCOL(),9)
   //draws a box at 5,5,10,10. Color is SLS_POPCOL().
   //shadow position is 9 (upper right hand corner)

  Warnings:
  ----------
  Use only UNBOX() to remove screens stored with
  MAKEBOX().

  Notes:
  -------
  UNBOX() removes the box and restores the underlying
  screen and prior colors.

  The shadow will not be drawn if it would go off the
  edge of the screen.

  Source:
  -------
  S_MAKEB.PRG