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_menu() - create drop down menus</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     m_menu() - create drop down menus
  Usage:    <float> = m_menu(<active>, <prompts>, [<color>])
  Params:   integer <active> - number specifying initial prompt
            array <prompts> - array of strings to prompt
            integer <color> - color to use to display prompts
            if <color> is left off then the standard Clipper
            foreground color is used.

            The array of prompts is an array of strings with each prompt
            separated by a colon (:). The first word will become a
            prompt on the main menu, and the following words will
            become prompts on the sub menu. The maximum number of
            sub menu prompts is 20.

  Returns:  a floating point value equal to the main and sub menu
            selections or 0.0 if ESCape is pressed. If the main menu
            selection is four (4), and the sub menu selection is eight (8),
            then a value of 4.8 is returned.

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

                 declare prompts[4]
                 color     = 23      && white on blue
                 active    = 1       && start on first prompt

                 prompts[1] ="APPEND:Employees:Positions:User"
                 prompts[2] ="DELETE:Employees:Positions:User"
                 prompts[3] ="EDIT:Employee Recs:Position Recs"
                 prompts[4] ="QUIT"

                 mchoice = m_menu(active,prompts,color)

            The following keystrokes are active in m_menu():

                 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 with the mouse, simply move the mouse cursor over
            an option and click the left mouse button.

  Note:     Mchoice will equal the element number of the users
            selection, or 0.0 for ESCape (none). m_menu() 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 drop down menus are enclosed in a box with a
            shadow. The frame around the box, and the shadow type and
            color can be easily modified by using the Mouse Message
            Area numbers 16 and 17. Use the m_data() function to set
            these values. To set the type of frame around the drop down
            menu use the m_frame() function.

            The m_menu() 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_menu.prg.


See Also: m_query() m_prompt() m_data()

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