Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FUNCky - <b>name:</b> <b>m_prompt() - emulate @ .. prompt with mouse support</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     m_prompt() - emulate @ .. prompt with mouse support
  Usage:    <int> = m_prompt(<except>,<active>,<rows>,<cols>,;
                             <prompts>,<color>,[<mess>],[<line>])
  Params:   logical <except> - a logical value that signals the
            processing of exceptions.
            integer <active> - an integer specifying initial prompt
            array <rows> - array of rows for prompts
            array <cols> - array of columns for prompts
            array <prompts> - array of strings to prompt
            integer <color> - color to use to display prompts
            if the <color> is left off, or is -1, then the standard
            Clipper foreground color is used for normal text, and the
            enhanced Clipper color is used for highlighted text.

            array <mess> - array of strings to display as the
            messages for each prompt
            integer <line> - row to use to display the messages

            * messages and message line are optional

  Returns:  integer = to the selected element, 0 if ESCape pressed. If the
            exception flag is true, then m_prompt returns -1 if the left
            mouse button is pressed outside of any area that does not
            contain a prompt. If the exception flag is true, then a -2 is
            returned if the user pressed the left arrow key or -3 if the
            right arrow key is pressed. Use this to create drop down
            menus that can be moved with the arrow keys.

 ---------------------------------- Example ---------------------------------

                 declare prompts[3], rows[3], cols[3], mess[3]
                 color     = 23 && white on blue
                 messline  = 24 && messages on line 24

                 prompts[1]     = " APPEND "
                 prompts[2]     = " DELETE "
                 prompts[3]     = "  EDIT  "

                 rows[1]        = 10
                 rows[2]        = 11
                 rows[3]        = 12
                 cols[1]        = 45
                 cols[2]        = 45
                 cols[3]        = 45

                 mess[1]        = "Append New Records"
                 mess[2]        = "Delete Records"
                 mess[3]        = "Edit Records"

                 active = 1
                 except = .F.
                 m1 = m_prompt(except, active, rows, cols,;
                          prompts, color, mess, messline)

                 if m1 = 0
                      quit
                 endif
                 ondo(m1, "addfunc()","delfunc()","editfunc()")

            The following keystrokes are active in m_prompt():

                 RETURN      -  selects highlighted prompt
                 ESCAPE      -  aborts to calling program
                 UP ARROW    -  goes to previous prompt
                 DOWN ARROW  -  goes to next prompt
                 LEFT ARROW  -  goes to previous prompt
                 HOME        -  goes to first prompt
                 END         -  goes to last prompt
                 PGUP        -  selects highlighted prompt
                 PGDN        -  selects highlighted prompt

                 Also, any keystroke that matches the first character
                 of any displayed prompt will select that prompt.

            To select a prompt with the mouse, move the mouse cursor
            over the prompt you want and click the left mouse button.

  Note:     In this example, the memvar m1 will equal the element
            number of the users selection, or 0 for ESCape (none).
            m_prompt() will work with or without the mouse present, and
            is considered a wait state. The user can use arrow keys and
            alpha keys like @ ... prompt. The m_prompt() function is
            written in Clipper using the mouse functions. The source code
            is provided so you may make modifications to suit your
            particular application. See the file c_m_prom.prg.


See Also: ondo() m_query() m_menu() m_choice()

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