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_data() - send mouse messages to the mouse functions</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     m_data() - send mouse messages to the mouse functions
            m_frame() - specify frame to use in mouse functions
            m_title() - specify title to use in view functions
  Usage:    [<integer>] = m_data(<MMA#>,[<message>])
  Params:   integer <MMA#> - the Mouse Message Area message #
            integer <message> - the number to load into the MMA#
            for m_title() - the string you want as the title
            for m_frame() - the box characters to use for the frame

  Returns:  integer equal to the current value stored in the MMA#.
            m_title() and m_frame() return the current title and
            frame characters defined.

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

                 m_data(16,3) && sets shadow type to use to 3
                 m_data(2,1)  && sets starting active element to 1
                 m_title("Press return to select")

                 * or to get a setting
                 mclick = m_data(4)
                 temptitle = m_title()

  Note:     The following are all the Mouse Message Area message
            numbers. Please refer to the documentation of each
            individual function as to what MMA numbers affect that
            particular function. You do not have to know what the
            MMA does or how it works. Under normal circumstances
            you can use any of the m_* functions without ever knowing
            about the Mouse Message Area. The MMA and m_data()
            system is designed so that you don't have to re-write the
            mouse functions to do simple tasks.

            MMA # - Meaning

            1    - STARTING ELEMENT NUMBER, normally 1.
                   If the restart flag is set to one, this number
                   is used as the element number to display
                   as the first line in the window.

            2    - ACTIVE LINE NUMBER, normally 1. If the
                   restart flag is one, then the highlight
                   is moved to the row number inside the
                   window represented in this message.

            3    - EXCEPTION FLAG. If 1, Tells the function to
                   return if the user clicks the left button
                   outside the window area. If 0, then the function
                   will only return if the user selects a value or
                   clicks on the triple bar in the control panel.

            4    - MOUSE CLICK FLAG set to 1 if the user clicked
                   outside the window area, 0 if not. Check this
                   value on return from the m_* function.

            8    - TOP VIRTUAL ROW. The mouse will not be able
                   to move the window past this top row. The mx_*
                   functions verify that the starting coordinates
                   of the window are within the virtual coordinates.
                   if the mx_* function determines that the window
                   will be beyond the virtual coordinates, then it
                   will exit prematurely with an error value. You can
                   check m_data(30) to see what the error return is.

            9    - LEFT VIRTUAL COLUMN. The mouse will not
                   be able to move the window past this column.
                   The mx_* functions verify that the starting values
                   of the window are within the virtual coordinates.
                   if the mx_* function determines that the window
                   will be beyond the virtual coordinates, then it
                   will exit prematurely with an error value. You can
                   check m_data(30) to see what the error return is.

            10   - BOTTOM VIRTUAL ROW. Mouse will not be
                   able to expand or move the window beyond this
                   row The mx_* functions verify that the starting
                   values of the window are within the virtual
                   coordinates. if the mx_* function determines that
                   the window will be beyond the virtual coordinates,
                   then it will exit prematurely with an error value.
                   You can check m_data(30) to see what the error
                   return is.

            11   - RIGHT VIRTUAL COLUMN. Mouse won't be
                   able to expand or move the window beyond this
                   column. The mx_* functions verify that the starting
                   values of the window are within the virtual
                   coordinates. if the mx_* function determines that
                   the window will be beyond the virtual coordinates,
                   then it will exit prematurely with an error value.
                   You can check m_data(30) to see what the error
                   return is.

            12   - MOVE WINDOW FLAG. If this flag is set to 0,
                   then the user will not be able to move the
                   window at all. 1 is the default. Only the mx_*
                   functions check this.

            13   - USER DATA AREA 1. You can use MMA # 13
                   for your own mouse messages.

            14   - USER DATA AREA 2. You can use MMA # 14
                   for your own mouse messages.

            15   - USER DATA AREA 3. You can use MMA # 15
                   for your own mouse messages.

            16   - SHADOW TYPE. This sets the type of shadow
                   to use for the box around the windows. see
                   the box function for shadow types.

            17   - SHADOW COLOR. This sets the color to use
                   for the shadow. See the box function for
                   a description of shadow colors.

            18   - PULL FLAG. If this flag is set to 0,
                   the user will not be able to pull open/close
                   the window from the right side. 1 is the
                   default.

            19   - RETURN ON KEYPRESS FLAG. If this flag is set
                   to 1, then mx_choice() and m_choice() will
                   return if the user presses a key that matches
                   the first character of any elements in the
                   array being displayed. If set to 0, then the
                   highlight is moved to the next element that begins
                   with the key pressed. Default is 0, and leading
                   spaces are ignored. Also be aware that if the
                   scroll flag (m_data(21)) is set to 0, then the
                   user will not be able to exit the window by
                   pressing the first letter of a displayed element.
                   Make sure m_data(21) is set to 1 to use this
                   message.

            20   - PULL FLAG 2. If this flag is set to 0, the
                   user will not be able to pull up/down the
                   bottom of the window. 1 is the default.

            21   - SCROLL FLAG. If this flag is set to 0, the
                   user will not be allowed to scroll the inner
                   contents of the box up or down. 1 is default.
                   this message affects m_data(19).

            22   - AUTOSAVE FLAG. If this flag is set to 1, the
                   mouse function will automatically restore
                   the screen upon exit. 0 is the default.

            23   - PAN FLAG. If this flag is set to 0 the
                   user will not be able to pan the contents
                   of the window left or right. 1 is the default

            24   - NEW TOP ROW. Upon exit from the mx_*
                   functions, the new top row coordinate is
                   saved here in case the user moved the window.

            25   - NEW LEFT COLUMN. Upon exit from the mx_*
                   functions, the new left column coordinate is
                   saved here in case the user moved the window

            26   - NEW BOTTOM ROW. Upon exit from the mx_*
                   functions, the new bottom row coordinate is
                   saved here in case the user moved the window

            27   - NEW RIGHT COLUMN. Upon exit from the
                   mx_* functions, the new right column coordinate is
                   saved here in case the user moved the window

            28   - WINDOW MOVED FLAG. If the window of the
                   mx_* function was moved, then this flag is
                   set to 1. It is 0 if the window wasn't moved.

            29   - RESTART FLAG. Set this flag to 1 if you want the
                   m_* functions to use the values found in messages
                   m_data(1), m_data(2) or m_data(31) 1 and 2 so
                   you can redisplay the window in the same state as
                   it was left. You must reload the starting element
                   number, starting line number, and in the case of
                   the file viewing functions, the file position pointer
                   to the correct positions they had last. You can
                   save the return values to memvars, and re-load
                   the MMA when you need to.

            The m_data() messages that use a 1 or 0 value interpret the
            value 1 to be .T. (true), and a value of 0 to be .F. (false).
            If the message says that if 1 it will do something, you can
            correctly assume that 0 means not to do that something.

            30   - RETURN ERROR NUMBER. a return value is
                   loaded here upon exiting the function so that you
                   can determine exactly what happened in the
                   function that caused the return. The following
                   values and meanings are defined:

                   ERROR # - MEANING
                    0      - User escaped out
                   -1      - User made a selection
                   -2      - Mouse was clicked outside
                             window
                   -3      - An array passed were empty
                   -4      - Height of the window was not
                             high enough to display at least
                             one line
                   -5      - Width of the window too small.
                             The control panel wouldn't fit
                   -6      - Window was outside of the
                             virtual coordinates.
                   -7      - File was not found by m_view(),
                             or mx_view
                   -8      - No DBF in use for m_dbfview(),
                             or mx_dbfview()
                   -9      - No directories found by
                             m_popdir(), or mx_popdir().
                   -10          - No files were found by
                             m_popfile(), or mx_popfile().

            31   - FILE POSITION POINTER. This location saves
                   the last file position when using m_view() or
                   mx_view(), or the record # when using
                   m_dbfview() or mx_dbview(). When the restart
                   flag is set to one, The file pointer is moved to the
                   position found here before the window is
                   displayed. If you wanted m_dbfview() to display
                   the window starting at record 50, you would
                   do an m_data(31,50), an m_data(29,1), an
                   m_data(1,1) and an m_data(2,1). so that the restart
                   will occur at record # 50. If you are using
                   m_view() to view a text file and you wanted the
                   view to start displaying at offset 100 into the file,
                   you would do an m_data(31,100), an m_data(29,1),
                   an m_data(1,1) and an m_data(2,1). so that
                   m_view() can reposition the file pointer for you.
                   You can also position the file pointer yourself by
                   using the handle of the file. See the functions
                   m*_view() and m*_dbfview() for more
                   information.

            The following functions affect, or are affected by the Mouse
            Message Area, Please refer to the documentation for each of
            these functions to see which MMA numbers are used and
            how. Note that since the m_data() area is global, when you set
            a value, it remains in effect for all subsequent calls to the
            mouse functions that use the MMA. If you specify a frame via
            m_frame(), it will be used for all the mouse functions that use
            the frame in m_frame(). The same holds true for the m_title()
            function. Each function that uses the m_title(), m_frame() or
            m_data() functions has a complete listing of which MMA areas
            it uses. Here is a list of those functions. See the
            documentation on the function for a more complete explanation
            on how to use the MMA with that function.

                 m_popdir()          m_query()
                 m_popfile()         m_message()
                 mx_popdir()         m_display()
                 mx_popfile()        mx_dbfview()
                 m_choice()          m_dbfview()
                 mx_choice()         mx_view()
                 m_view()


See Also: m_title() m_frame() m_datasave() m_datarest()

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