home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / sv12us.zip / SOUNDVIS / SOUNDVIS.CH < prev    next >
Text File  |  1993-07-26  |  10KB  |  207 lines

  1.  
  2. /******************************************************************
  3.  *  TITLE SoundVis.ch                                             *
  4.  *  Include for SOUND & VISION for Clipper                        *
  5.  *                                                                *
  6.  *  Example  : SetPref ( C_BARCOL, 30 ) sets the color for the    *
  7.  *               menubar from 112  ( black on white , default)    *
  8.  *                         to  30  (light-white on blue )         *
  9.  *                                                                *
  10.  *  Copyright (c) 1993, Thomas Groeger                            *
  11.  *  All rights reserved.                                          *
  12.  *                                                                *
  13.  ******************************************************************/
  14.  
  15.  
  16. // definitions
  17.  
  18. #define  A_TELEFON   '╔╣'         // 201 + 185
  19. #define  A_SANDGLASS '╗'          // 189
  20. #define  A_LU        '╘'          // 212
  21. #define  A_RU        '╙'          // 211
  22. #define  A_UPPER     '╟'          // 199
  23. #define  A_BOTTOM    '╚'          // 200
  24. #define  A_SEP       '─'          // 196
  25. #define  A_HORIZONT  '╨'          // 208
  26. #define  A_VERTICAL  'Σ╧'         // 228 + 207
  27. #define  A_EXITBOX   '╦╡'         // 203 + 181
  28. #define  A_ICONBOX   '╠╖'         // 204 + 183
  29. #define  A_CHOIBOX   '═╕'         // 205 + 184
  30. #define  A_RIGHTBOX  '╦╢'         // 203 + 182
  31. #define  A_LEFTBOX   '╩╡'         // 202 + 181
  32. #define  A_UPBOX     '╥▓'         // 210 + 178
  33. #define  A_DOWNBOX   '╤▒'         // 209 + 177
  34. #define  A_SCROLLBOX '██'         // 219 + 219
  35.  
  36. // Return values of the menu functions
  37.  
  38. #define B_ESC       0
  39. #define B_LEFT     -1
  40. #define B_RIGHT    -2
  41. #define B_QUIT     -3
  42. #define B_MOUSE    -4
  43.  
  44.  
  45. // Mouse return values when using AlertBox
  46.  
  47. #define M_CLOSE      0      // CloseButton
  48. #define K_MOUSE    255      // MouseButton
  49. #define M_MOVE     254      // MoveButton
  50. #define M_CHOICE   253      // ButtonPressed ?
  51. #define M_UP       252      // Scrollbar    Top
  52. #define M_DOWN     251      //              Bottom
  53. #define M_LEFT     250      //              Left
  54. #define M_RIGHT    249      //              Right
  55.  
  56.  
  57.  
  58. // ArrayDimension for the Menu-Arrays
  59.  
  60. #define   MEN_TEXT    1                // Dimension 1 = Text
  61. #define   MEN_RET     2                // Dimension 2 = Return-Code/Function
  62. #define   MEN_SEL     3                // Dimension 3 = Selected T/F
  63. #define   MEN_DESC    4                // Dimension 4 = Description
  64. #define   MEN_CUT     5                // Dim.PopUp 5 = ShortCut
  65. #define   MEN_SPACE   5                // Dim.Bar   5 = prompt distance
  66.  
  67. // ArrayDimension for the Mouse-Array
  68.  
  69. #define   MS_ROW      1                // MouseRow   1
  70. #define   MS_LCOL     2                // Column left
  71. #define   MS_RCOL     3                // Column Right
  72. #define   MS_RET      4                // Return value/Function
  73.  
  74.  
  75. // WindowConstants  / Types of Windows
  76.  
  77. #define   WIN_SINGLE     0             // single frame
  78. #define   WIN_MESSAGE   51             // GrafWindow with Close/Movebutton
  79. #define   WIN_LIST      59             // ListBox with ScrollBar without menue
  80. #define   WIN_FULL      63             // full Window: everything's in here
  81.  
  82.  
  83. // Colordefinition for SetDAC ColorValue
  84.  
  85. #define  C_N          0                // black
  86. #define  C_B          1                // blue
  87. #define  C_G          2                // green
  88. #define  C_BG         3                // cyan
  89. #define  C_R          4                // red
  90. #define  C_RB         5                // magenta
  91. #define  C_RG         6                // brown
  92. #define  C_W          7                // white
  93. #define  C_HN         8                // grey
  94. #define  C_HB         9                // shining blue
  95. #define  C_HG        10                // shining green
  96. #define  C_HBG       11                // light blue
  97. #define  C_HR        12                // shining red
  98. #define  C_HRB       13                // shining magenta
  99. #define  C_HRG       14                // yellow
  100. #define  C_HW        15                // shining white
  101.  
  102.  
  103. // ColorDefinitions for SetLibCol
  104.  
  105.  
  106. #define  C_BARCOL        1 // MenuBar, default     240 -  black on white+
  107. #define  C_BARKEY        2 // Hotkey               244 -  red on white+
  108. #define  C_BARPASSIV     3 // non-chooseable       248 -  grey on white+
  109. #define  C_BARPROMPT     4 // PromptColor           15 -  +white on black
  110. #define  C_BARHOTKEY     5 // HotKeyColor           15 -  +white on black
  111.  
  112. // PopUp-Menu
  113.  
  114. #define  C_POPCOL        6 // Window/Text           48 -  black on light blue
  115. #define  C_POPKEY        7 // Hotkeys               52 -  red on light blue
  116. #define  C_POPPASSIV     8 // Choice not available  56 -  grey on light blue
  117. #define  C_POPPROMPT     9 // Prompt                15 -  light white on black
  118. #define  C_POPHOTKEY    10 // Prompt-Hotkey         10 -  light green on black
  119. #define  C_POPSHORT     11 // ShortCuts in Menue    55 -  white on light blue
  120.  
  121. // ColorDefinitions for OpenWin() / DataWindow
  122. #define  C_MASKWIN      12 // Window/FrameColor    112 -  black on white
  123. #define  C_MASKMENU     13 // MenuBar              240 -  black on white+
  124. #define  C_MASKHEAD     14 // Title                 31 -  +white on blue
  125. #define  C_MASKSYMB     15 // All Icons              7 -  white on black
  126.  
  127. // AlertBoxes: TitleColor
  128. #define  C_BOXHEADER    16 // TitleColor           112 -  black on white
  129.  
  130. // Question ? - Box
  131. #define  C_QUESTWIN     17 // QuestionBox           23 -  white on blue
  132. #define  C_QUESTTEXT    18 // Text                  30 -  yellow on blue
  133. #define  C_QUESTBUTTEXT 19 // ButtonText           112 -  black on white
  134. #define  C_QUESTBUTHOT  20 // ButtonHotkey         116 -  red on white
  135.  
  136. // Attention ! - Box
  137. #define  C_ALERTWIN     21 // AlertBox              71 -  white on red
  138. #define  C_ALERTTEXT    22 // MessageText           69 -  yellow on red
  139. #define  C_ALERTBUTTEXT 23 // ButtonText            46 -  yellow on green
  140. #define  C_ALERTBUTHOT  24 // ButtonHotkey          44 -  red on green
  141.  
  142. // Message-Box
  143. #define  C_MESSWIN      25 //  MessageBox          208 -  black on purple
  144. #define  C_MESSTEXT     26 //  MessageText         212 -    red on purple
  145. #define  C_MESSBUTTEXT  27 //  Button-Text         112 -  black on white
  146. #define  C_MESSBUTHOT   28 //  Button-Hotkey       116 -    red on white
  147.  
  148. // Descript() - Row
  149. #define  C_DESCROW      29 // DispText-Row          24 - Row 24
  150. #define  C_DESCCOL      30 // DispText-Column       01 - Col 1
  151. #define  C_DESCEND      31 // EndColumn             79 - EndCol 79
  152.  
  153. // Button-Preferences
  154. #define  C_GRAFBUTTON   32 // GraficButtons  1 = Yes  2 = No
  155. #define  C_BUTTUPPER    33 // Upper Buttonline   chr(200)
  156. #define  C_BUTTLOWER    34 // Lower Buttonline   chr(199)
  157.  
  158.  
  159.  
  160. // Just a few tricks, using the PreProcessor :
  161. // -------------------------------------------
  162.  
  163. #COMMAND @ <row>, <col>  GET <var>                                        ;
  164.                          AS PUSHBUTTON <buttons>                          ;
  165.                         [COLOR  <color>]                                  ;
  166.                         [HOTKEY <nHot>]                                   ;
  167.                         [WHEN   <when>]                                   ;
  168.                         [SEND   <msg>]                                    ;
  169.                         [<vert: VERTIKAL>]                                ;
  170.                                                                           ;
  171. => SetPos( <row>, <col> )                                                 ;
  172.    ; aAdd( GetList, _GET_( <var>, <(var)>, "9",, <{when}> ) )             ;
  173.   [; aTail(GetList):<msg>]                                                ;
  174.    ; ButtonView (<row>,<col>,<color>, <nHot> ,<buttons>,<.vert.>)         ;
  175.    ; aTail(getlist):reader :={|get|ReadaButton(get,<buttons>,<color>,<nHot>,<.vert.>)}
  176.  
  177.  
  178. #command @ <row>, <col> GET <var> AS FRAME IN <col1>,<col2>               ;
  179.                         [PICTURE <pic>]                                   ;
  180.                         [VALID <valid>]                                   ;
  181.                         [WHEN <when>]                                     ;
  182.                         [SEND <msg>]                                      ;
  183.                                                                           ;
  184. => SetPos( <row>, <col> )                                                 ;
  185.    ; AAdd(GetList, _GET_( <var>, <(var)>, <pic>, <{valid}>, <{when}>):display() ) ;
  186.    ; aTail(getList):reader:={|get|FrameReader(get,<col1>,<col2>,2)}       ;
  187.      [; ATail(GetList):<msg>]                                             ;
  188.  
  189.  
  190. #COMMAND OPENWIN FROM <tRow>, <tCol> TO <bRow>, <bCol>                    ;
  191.         [TITLE    <title> ]                                               ;
  192.         [TOPCOLOR <TopCol>]                                               ;
  193.         [WINCOLOR <WinCol>]                                               ;
  194.         [TYP      <WinTyp>]                                               ;
  195.          SAVE TO  <Buffer>                                                ;
  196.                                                                           ;
  197. => <Buffer> := OpenMask(<tRow>,<tCol>,<bRow>,<bCol>,<title>,<WinTyp>,<TopCol>,<WinCol>)
  198.  
  199. #COMMAND OPENWIN FROM <tRow>, <tCol> TO <bRow>, <bCol>                    ;
  200.         [TITLE    <title> ]                                               ;
  201.         [TOPCOLOR <TopCol>]                                               ;
  202.         [WINCOLOR <WinCol>]                                               ;
  203.         [TYP      <WinTyp>]                                               ;
  204.                                                                           ;
  205. => OpenMask(<tRow>,<tCol>,<bRow>,<bCol>,<title>,<WinTyp>,<TopCol>,<WinCol>)
  206.  
  207.