Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FreshWin (c) Fresh Technologies - <b>msatprompt() mouse function</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  MSATPROMPT()                                                Mouse Function
 Purpose..: Replace the Clipper @...PROMPT command
-------------------------------------------------------------------------------
 Syntax...: MsAtPrompt( <nX>, <nY>, <cPrompt>, [<cPromptClr>],       ;
                        [<cMsg>], [<cMsgClr>],  [<nMsgX>], [<nMsgY>],;
                        [<nHotKPos>], [<cHotKClr>],                  ;
                        [<uBox>],                                    ;
                        [<bBlock>], [<lShad>] ) --> NIL

 Arguments: <nX>           = row to place the menu prompt.
            <nY>           = column to place the menu prompt.
            <cPrompt>      = menu item string to display.
            [<cPromptClr>] = color string to use for the menu item.

            [<cMsg>]       = the menu prompt message to display.
            [<cMsgClr>]    = color to use for the message.
            [<nMsgX>]      = row to display message.
            [<nMsgY>]      = column to start message.

            [<nHotKPos>]   = position in menu string for hot key.
            [<cHotKClr>]   = color to use for the hot key character.

            [<uBox>]       = parameter that can take a pre-defined
                             frame type or a clipper frame string.

               Frame Type Manifest Constants as found in FW_BOX.CH
               --------------------------------------------------
               Value  FW_BOX.CH    Description
               --------------------------------------------------
               1     B_SSSS       single line box
               2     B_DDDD       double line box
               3     B_SDSD       NS-single EW-double
               4     B_DSDS       NS-double EW-single
               5     B_SSDD       NE-single SW-double
               6     B_SDDS       NW-double SE-single
               7     B_DSSD       NW-double SE-single
               8     B_DDSS       NE-double SW-single
               9     B_THICK      thick solid
              10     B_LIGHT      shaded light
              11     B_MEDIUM     shaded medium
              12     B_HEAVY      shaded heavy
              13     B_NONE       spaces - DEFAULT
              --------------------------------------------------

            [<bBlock>]     = code block to execute when
                             the menu item is chosen. If
                             this parmeter is NOT a code block,
                             the variable is ignored.

            [<lShad>]      = logical which can be used
                             to shadow the prompt or, if you
                             us BOXED WITH, the prompt box. It
                             will draw a half shadow only.

 Returns..: NIL

 Remark...: The function, MsAtPrompt(), can be used in a manner
            similar to the @...PROMPT command which is the display
            portion of the Clipper light-bar menu system.  Each
            function call paints a menu item in your choice of colors,
            defines an associated message to be displayed wherever you
            want in a user-defined color, allows you to define a hot
            key in your choice of colors, frame it with a defined set
            of boxes or your own and lets you execute a code block
            if the option is picked. Wheww! Then the light-bar menu
            is invoked with the use of the command, MENU TO.
            Menu items can be specified in any order and configuration of
            row and column position.  MENU TO, however, navigates
            the current list of menu items in the order they were defined.

 Source...: MSMENU.PRG
-------------------------------------------------------------------------------
 Example..: . The example displays a code portion for a display
              menu which toggles chosen values on the screen and
              resets values in the array, aPicks.

            while !empty( nCho )

               @ 4, 14 PROMPT   " Bond interest            ";
                       COLOR    "+W/B,+W/BG"                ;
                       MESSAGE  "Excludes bearer bonds    " ;
                       MSGCOLOR "+W/B"                      ;
                       MSGROW   24                          ;
                       MSGCOL   5                           ;
                       HOTKEY   2                           ;
                       HOTCOLOR "+GR/B"                     ;
                       EXECUTE  { || BondInt() }            ;
                       BOXED WITH B_SSSS

               @ 8, 14 PROMPT   " banK interest            ";
                       COLOR    "+W/B,+W/BG"                ;
                       MESSAGE  "Includes savings & loans " ;
                       MSGCOLOR "+W/B"                      ;
                       MSGROW   24                          ;
                       MSGCOL   5                           ;
                       HOTKEY   5                           ;
                       HOTCOLOR "+GR/B"                     ;
                       EXECUTE  { || BankInt() }            ;
                       BOXED WITH  B_SSSS

               @ 4, 14 PROMPT   " Mortgage interest        ";
                       COLOR    "+W/B,+W/BG"                ;
                       MESSAGE  "Only those not in default" ;
                       MSGCOLOR "+W/B"                      ;
                       MSGROW   24                          ;
                       MSGCOL   5                           ;
                       HOTKEY   2                           ;
                       HOTCOLOR "+GR/B"                     ;
                       EXECUTE  { || MortInt() }            ;
                       BOXED WITH B_SSSS

               @ 8, 45 PROMPT   " Trust income             ";
                       COLOR    "+W/B,+W/BG"                ;
                       MESSAGE  "Includes only that for T3" ;
                       MSGCOLOR "+W/B"                      ;
                       MSGROW   24                          ;
                       MSGCOL   5                           ;
                       HOTKEY   2                           ;
                       HOTCOLOR "+GR/B"                     ;
                       EXECUTE { || TrustInc() }            ;
                       BOXED WITH B_SSSS

               MENU TO nCho

            enddo

 Note.....: When using HOTKEY, the command counts position places
            starting from one. Pressing the hot key moves
            the cursor to the item and executes it.

            In addition to using the arrow keys, the Tab key
            is active for moving about the menu.

            When using BOXED WITH, each menu item is boxed, so leave
            enough space between the prompt items.

            The above code generates a screen that looks like:

          +--------------------------+   +--------------------------+
          | Bond interest            |   | Trust income             |
          +--------------------------+   +--------------------------+

          +--------------------------+   +--------------------------+
          | banK interest            |   | Mortgage interest        |
          +--------------------------+   +--------------------------+


           Excludes bearer bonds

See Also: MsMenuTo()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson