Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Flipper 6.0 Help File - <b>ms_object()</b> c_demo,c_exam05 http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
MS_OBJECT()                                                C_DEMO,C_EXAM05
   Draws an object on the drawing surface with the mouse.

   Syntax
         nObjectnumber = MS_OBJECT(nObjectType,nFgColor,nBgFill,nPattern
                                   [,cDesc])

   Arguments
         nObjectType       Sets the type of object to add.
        +------------------------------------------------------------+
        |Object Types                                                |
        -------------------------------------------------------------|
        |LINE      |ROUND OBJECTS                        |TEXT OBJECT|
        |OBJECTS   |-------------------------------------|           |
        |          |Center-drag|3-point|Object Type      |           |
        |----------+-----------+-------+-----------------+-----------|
        |1|Box     |     10    |  -10  |Circle           |20 |Text   |
        |2|Polygon |     11    |  -11  |Oval             |   |       |
        |3|Line    |     12    |  -12  |Circle Arc       |   |       |
        |4|Polyline|     13    |  -13  |Oval Arc         |   |       |
        | |        |     14    |  -14  |Pie Slice        |   |       |
        | |        |     15    |  -15  |Pie Oval         |   |       |
        | |        |     16    |  -16  |Closed Circle Arc|   |       |
        | |        |     17    |  -17  |Closed Oval Arc  |   |       |
        +------------------------------------------------------------+

         nFgColor         Color of object: 0 to 255, -1 is layer color.
         nBgFill          Filled objects: hatching style.
                                     (circles, boxes, polygons)
                          Line objects: No affect. (lines, arc)

                          Bitmapped text: Background text color, -1 is
                                     transparent. Stroke text does not have a
                                     background color.
         nPattern         Filled objects: Background color for the pattern.
                          Line objects: Dashed line style.
                          Text: Font handle.
         OPTIONAL PARAMETERS
         cDesc            Sets the description of the object.

   Returns
         nObjectNumber    Returns object number if creation was successful.
                          -1 = Object creation failed.
                           0 = Object creation was cancelled.

   Description
         MS_OBJECT() draws any object type on the drawing surface under mouse
         control. The function handles all requirements of building the object
         once it is called.

         Round objects can be drawn by selecting the center and pulling the
         circle (positive numbers), or clicking on three points (negative
         numbers).

         The default keyboard keys and mouse buttons are the following:

         Keyboard -   ENTER - call ENTER_PNT() function.
                      ESC - cancel.
                      HOME - done drawing (like DrawButton).
                      END - exit drawing (complete all objects).
                      PgUp - pen up for polyline.
                      PgDn - snap to grid or object.

         Mouse - left button - anchor point
                 right button - snap to object or grid
                 middle button - cancel drawing

         CAD_SETUP() allows you to customize which key affects the way a
         figure is drawn.

         nFgColor is the color of the object. If a -1 is entered, then the
         object will take the color of the layer it is on.

         nBgFill is the background fill pattern for the object. For the
         nObjectType of 20 (text) it is the background color for the font and
         can be set from 0-15. If BgFill is set to -1, the object will be
         drawn then erased when completed. This can be used for drawing cut
         boxes on the screen.

         nPattern sets the background pattern. For nObjectType of 20
         (text), this is the font handle. For line objects, the line pattern
         is set.

         While drawing an object, a double-click on the SnapButton will always
         exit from the current object. Polygons and polylines require more
         than one line segment. The DrawButton anchors the end of each line.
         To finish the polyfigure, a double click on the DrawButton or END key
         must be entered. MS_OBJECT() can temporarily pick up the pen with
         PenUpKey. The EnterKey allows you to transfer to a user controlled
         function defined in CAD_CLIP.PRG called ENTER_PNT(). The Clipper
         source for this function can be found in the \FLIPPER\LIBRARY
         sub-directory.

         Circle objects are drawn in one of two ways. A center point can be
         placed down, then the mouse can be moved to pull the circle from the
         center until the size is reached. Then the DrawButton will complete
         the circle. An arc will require you to set the starting and ending
         position of the arc with two subsequent button presses. Another
         way to enter a circle is a three point method. nObjectType from 10
         to 17 is entered as a negative number. The first point is the
         current mouse position, and the subsequent points are entered by
         additional button presses and a circle is drawn through the three
         points at the end of the last button.

See Also: CIRCLE_3PT() ENTER_PNT() MS_POINTS() OBJ_ADD()

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