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 - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

  The last item that is of extreme importance when using the sample
  Clipper functions is a unique messaging system that has been set
  up to communicate information back and forth with the example
  functions.

  Inside FUNCky is a special segment of data that you can use to
  communicate various pieces of information to the mouse functions.
  This area is known as the Mouse Message Area (MMA) and can only
  be accessed by using 5 special mouse functions that are designed
  to place information or retrieve information from the MMA.

  The five MMA functions are:

       m_data()       - inserts or retrieves mouse message data
       m_title()      - specifies the title to use in mouse functions
       m_frame()      - specifies the box frame characters to use
       m_datasave()   - saves all current mouse messages to a memvar
       m_datarest()   - restores previously saved mouse message data

  If you examine the m_choice(), m_dbfview() etc. functions you
  will see many references to the m_data() function. The m_data()
  function is used to place a message into the MMA, and optionally,
  to retrieve the message from the MMA. In the case of the MMA a
  message is defined by its message number, and the information the
  message contains is also a number. Each of the Clipper m_*
  functions depend upon the information stored in the MMA to decide
  how the window is going to look, what kind of frame to use, the
  title of the window, starting element number etc. This setup
  allows you to customize the m_* functions without having to go
  into the function and modify code.

  For example, you want to display an array with m_choice(), and
  you want to specify a different type of shadow to use for the
  box. You could re-write the m_choice() function and re-compile
  it, or you can just place the shadow type you want into the MMA
  message area for shadow. The shadow message # is 16, and the
  shadow types are determined by the layout of the numeric keypad.
  The default shadow is 1, lower left corner. To change the shadow
  type in the m_choice() function, just load the shadow type into
  the appropriate MMA message number by using the m_data()
  function. The m_data() function takes 1 or 2 parameters,
  depending on it's operation. To place data into the MMA requires
  2 parameters, the first parameter is the MMA message number, and
  the second parameter is the integer to place into the MMA message
  area defined by parameter 1. You can also retrieve an MMA value
  by just specifying the MMA message number and assigning it to a
  variable. To change the shadow type requires one simple function
  call:

       m_data(16,3)

  and then call the m_choice function normally:

       m_choice(10,10,20,60,myarray)

  16 is the MMA message number for shadow type, and 3 is the type
  of shadow you want m_choice() to use. m_choice() will pluck the
  new shadow value out of the MMA, and will use it to create the
  shadows it needs internally without you ever having to modify the
  function itself.

  You can optionally retrieve the value in an MMA message number by
  simply specifying the MMA message number to m_data(), and then
  assigning the value returned by m_data() to a variable. If you
  wanted to find out what the current shadow type is currently
  being used by the m_* and mx_* mouse functions, you would simply
  query the MMA as follows:

       Mshadow = m_data(16)

  16 is the MMA message number for shadow type. The m_data()
  function always returns the current value of the specified MMA
  message even when you are setting an MMA message to a particular
  value.

  If you wanted to specify a title to be displayed in the title
  area of the window. You would use the MMA function m_title().
  Just place the string to use as the title within the parenthesis
  of the m_title() function and the m_* function will use it as the
  title for the window. To specify no title, just send m_title() a
  null string (""). To place a title that says "Up/down arrow moves
  highlight, return selects" into the m_choice() window, just load
  the MMA title area with your title as follows:

       m_title("Up/down arrow moves highlight, return selects")
       m_choice(10,10,20,60,myarray)

  m_choice() will display your new title in the title area of the
  window. You can also retrieve the current title and store it in a
  memory variable with the following line of code:

       mtitle = m_title()

  You can specify the type of frame to use for the box around the
  window with the MMA function m_frame(). Just send the 8
  characters that make up the line characters to be used just as if
  you were using the Clipper @ ... box command. Do not specify a
  ninth character since the m_* functions automatically clear the
  inside of the box using scroll() which is faster than specifying
  a ninth character in the box frame.

  the last 2 functions are used to save the entire state of the
  MMA, and optionally to restore it. The two functions are:

       m_datasave()   - save entire contents of the MMA to a memvar
       m_datarest()   - restore the contents of the MMA from a memvar

  These two functions let you quicky save the MMA. load your new
  values and then restore the MMA to the values it had previously.
  Normally you will only use these functions if you are making many
  changes to the MMA and you will need to restore it to its
  original state. In simpler circumstances you can just save the
  one or two items you are modifying, and then restore them
  individually.

  the MMA messages control many aspects of the functions. You can
  specify that the user is not allowed to scroll the inner contents
  of an mx_choice(), or the user is not allowed to re-position the
  window or that you want the function to specifically restore the
  screen upon exit so you don't have to and many more. You can also
  retrieve values from the MMA. Items like where the window was was
  moved to, what was the last starting element number, what was the
  last record number etc. Each function uses the values contained
  in the MMA for startup, internal, and exiting. This method of
  communicating with the functions is simple, yet powerful and can
  be used in your own mouse functions

  There is a complete list of MMA message numbers and their effects
  on the m_* and mx_* functions in the function description of
  m_data(). Please read it carefully since it can make programming
  the m_* and mx_* functions very easy. The individual mouse
  functions each list which MMA messages are used. Please read them
  carefully.

See Also: m_data() m_title() m_frame()

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