home *** CD-ROM | disk | FTP | other *** search
/ TopWare Tools / TOOLS.iso / tools / top1655 / gepackt.exe / SAMPLE / APTFILER.CH next >
Encoding:
Text File  |  1993-11-21  |  6.6 KB  |  150 lines

  1. // DEFAULT mvar TO value, mvar2 to value2, ...
  2. // -------------------------------------------
  3.  
  4.    #command DEFAULT <p> TO <v> [,<pn> TO <vn>]  ;
  5.             =>                                  ;
  6.            <p> := iif(<p> == NIL, <v>, <p>)       ;
  7.            [;<pn> := iif(<pn> == NIL, <vn>, <pn>)]
  8.  
  9. // Absolute screen coordinate system (ABS = row + (col * maxcol()))
  10. // ----------------------------------------------------------------
  11.    #xtranslate absolute(<r>, <c>) => (((<r>) * maxcol()) + (<c>))
  12.    #xtranslate abs2r(<p>)         => int((<p>) / maxcol())
  13.    #xtranslate abs2c(<p>)         => int((<p>) % maxcol())
  14.  
  15. // ===========================================================================
  16. // DIALOGS
  17. // ===========================================================================
  18.  
  19. // Each dialog definition has at least a colour definition (xxxxC)
  20. // and a window border (xxxxB):
  21.  
  22. // Group box definitions:
  23. // ----------------------
  24.    #define B_BLOCK     "█▀███▄██ "
  25.    #define B_SINGLE    "┌─┐│┘─└│ "
  26.    #define GROUPC   "w+/b,n/rg*,w+/b,b/b,w+/b"
  27.    #define GROUPB   B_BLOCK
  28.  
  29. // Input box definitions:
  30. // ----------------------
  31.    #define INPUTC   "rg+/n*,rg+/b,bg+/n*,n/n*,n+/b"
  32.    #define INPUTB   B_SINGLE
  33.    #define INPUTS   "rg+/n*"
  34.    #define INPUTG   "rg+/b"
  35.  
  36. // TBrowse box definitions:
  37. // ------------------------
  38.                  // Say---SaySel-Del-Delsel-Unsel-Frozen-DelFrozen
  39.    #define BROWC      "rg+/b,n/rg*,n/b,n+/w,b+/w,w+/b,n+/b"
  40.    #define BROWB      B_SINGLE
  41.    #define BROWTXTC   "n/bg,b/w"    // Text browser
  42.    #define BROWTXTB   B_DS
  43.    #define NORMHS    "─┬─"          // Header
  44.    #define NORMCS    " │ "          // Column
  45.    #define NORMFS    "─┴─"          // Footer
  46.    #define BROWSW    3              // Width of column separators
  47.  
  48. // Picklist definitions
  49. // --------------------
  50.    #define PICKC   "rg+/b"
  51.    #define PICKB   B_DS
  52.    #define LFTCHR  "├"              // Split box left side
  53.    #define RGTCHR  "┤"              // Split box right side
  54.    #define SEPCHR  "─"              // Split box row
  55.    #define TOPCHR  "╤"              // Split box top side
  56.    #define BOTCHR  "╧"              // Split box bottom side
  57.    #define COLCHR  "│"              // Split box column
  58.    #define MIDCHR  "┼─┤"            // Split box cross
  59.    #define SCRBAR  "▒"              // Generic scroll bar
  60.    #define VSCRB   "▒"              // Vertical scroll bar
  61.    #define HSCRB   "▒"              // Horizontal scroll bar
  62.    #define BARC   "w+/b"            // Scroll bar colour
  63.    #define ARRC   "b+/w*"           // Scroll bar icon colour
  64.    #define TAGCHR  chr(7)           // Tag character
  65.    #define SUP  chr(24)             // Up arrow icon
  66.    #define SDN  chr(25)             // Down arrow icon
  67.    #define SLT  chr(26)             // Left arrow icon
  68.    #define SRT  chr(27)             // Right arrow icon
  69.    #define ARROWS SLT+SRT+SUP+SDN   // Icon set
  70.  
  71.    #define MNU_IDX    1
  72.    #define MNU_ARR    2
  73.    #define MNU_LEN    3
  74.    #define MNU_TAG    4
  75.  
  76. // ALERT dialogs
  77. // -------------
  78.    #define ERRC         "w+/r,r+/w,w+/r,r/r,w+/r"
  79.    #define ERRB         B_BLOCK
  80.    #define TELC         "w+/g,g+/w,w+/g,g/g,w+/g"
  81.    #define TELB         B_BLOCK
  82.    #define ASKC         "w+/b,b+/w,w+/b,b/b,w+/b"
  83.    #define ASKB         B_BLOCK
  84.    #define BUT_OK       "OK"
  85.    #define BUT_CANCEL   "CANCEL"
  86.    #define BUT_YES      "YES"
  87.    #define BUT_NO       "NO"
  88.    #define BUT_RETRY    "RETRY"
  89.    #define BUT_DEFAULT  "DEFAULT"
  90.    #define BUT_SAVE     "SAVE"
  91.    #define BUT_EDIT     "EDIT"
  92.    #define BUT_DELETE   "DELETE"
  93.    #define BUT_HORIZONTAL   .t.      // Button orientation
  94.    #define BUT_VERTICAL     .f.
  95.    #define BUT_SAY          .f.      // Display buttons
  96.    #define BUT_GET          .t.      // Activate previously displayed
  97.  
  98.    #define OKCANCEL     {BUT_OK, BUT_CANCEL}
  99.    #define YESNO        {BUT_YES, BUT_NO}
  100.    #define RETRYCANCEL  {BUT_RETRY, BUT_CANCEL}
  101.    #define SAVEEDITCAN  {BUT_SAVE,BUT_EDIT,BUT_CANCEL}
  102.  
  103.    #xtranslate aptErr(<msg>  [,<act>]) => aptalert(<msg>, <act>, ERRC, ERRB)
  104.    #xtranslate aptTell(<msg> [,<act>]) => aptalert(<msg>, <act>, TELC, TELB)
  105.    #xtranslate aptAsk(<msg>  [,<act>]) => aptalert(<msg>, <act>, ASKC, ASKB)
  106.  
  107. // ===========================================================================
  108. // TBROWSE extensions
  109. // ===========================================================================
  110.  
  111. #define TB_CARGO_DIM 31
  112.    #define TB_METHODS   01  // Array of method code blocks
  113.       #define MT_KEY     1  // Methods array inkey number
  114.       #define MT_BLOCK   2  // Methods array code block
  115.    #define TB_DBF       02  // DBF file name or data source
  116.    #define TB_NTX       03  // Index order number
  117.    #define TB_LEDIT     04  // ALLOW/disallow Lotus-like editing
  118.    #define TB_DICT      05  // Clone of data-dictionary for this DBF
  119.    #define TB_STARTAT   06  // Record to start at (0 == bof())
  120.    #define TB_MAXROW    07  // Video mode (25 = CGA, 50 = VGA)
  121.    #define TB_BOTTOM    08  // Block to work out bottom row of browse
  122.    #define TB_SGWIDTH   09  // Width of the scrolling get list box
  123.    #define TB_SGSAYLEN  10  // Width of the SAY part of the scrolling get list
  124.    #define TB_WIDTH     11  // Width of the visible tbrowse
  125.    #define TB_REDRAW    12  // Browse is redrawn if .t.
  126.    #define TB_REOPEN    13  // File/index is reopened if .t.
  127.    #define TB_GETLIST   14  // Getlist array
  128.    #define TB_MSG1      15  // Message line 1
  129.    #define TB_MSG2      16  // Message line 2
  130.    #define TB_QUIT      17  // .t. causes keyhandler to quit
  131.    #define TB_PICK      18  // .t. indicates a pick-list browse
  132.    #define TB_GRAY      19  // .t. causes background to be grayed out
  133.    #define TB_SHADOW    20  // .t. causes a shadow to be drawn around box
  134.    #define TB_BCKGND    21  // Code block to draw background (aptBackPlane())
  135.    #define TB_BOX       22  // Box characters
  136.    #define TB_INIT      23  // Init code block
  137.    #define TB_EXIT      24  // Exit code block
  138.    #define TB_STABIL    25  // Stabilization code block
  139.    #define TB_MSG1A     26  // Arrays of coordinates and inkey codes for
  140.    #define TB_MSG2A     27  //  function keys on message lines.
  141.    #define TB_PREVAL    28  // Full screen edit prevalidate block
  142.    #define TB_POSVAL    29  // Full screen edit postvalidate block
  143.    #define TB_DEFREP    30  // List option report name (if NIL, generic used)
  144.    #define TB_POS       31  // Data row index
  145.  
  146. #define TBC_CARGO_SIZE 3
  147.    #define NUMBER       1   // Column number
  148.    #define READER       2   // Get reader for this column
  149.    #define FROZEN       3   // .t. if column is currently frozen
  150.