
               File: magnifyclass.doc
        Description: MagnifyClass documentation.
          Copyright: (C) Copyright 1995/96 Reinhard Katzmann. 
                     All Rights Reserved.
                     This class is FREEWARE.

------------------------------------------------------------------------------

TABLE OF CONTENTS

magnifyclass/--background--
magnifyclass/Methods
magnifyclass/Attributes

magnifyclass/--background--                        magnifyclass/--background--

    NAME
        Class:          magnifyclass
        Superclass:     baseclass
        Include File:   "MagnifyClass.h"

    FUNCTION
        To provide  you  with a  picture  gadget which uses bitmaps as picture
        data instead of Intuition Images. It allows you to magnify the picture
        and to show you only a region of the whole bitmap if you want to.
        It also lets you edit the picture or to only view the picture.
        
        Objects  from  this  class  send  out  the  following  attribute pairs
        in their notification messages:

        GA_ID:                - Gadget object ID
        MAGNIFY_MagFactor     - The current magnification factor
        MAGNIFY_FrameCoordsX  - The current X-coordinate of a framed point
        MAGNIFY_FrameCoordsX  - The current Y-coordinate of a framed point
        MAGNIFY_PicArea       - The current Picture (bitmap) area
        MAGNIFY_SelectRegionX - The currently selected X-coordinate
        MAGNIFY_SelectRegionY - The currently selected Y-coordinate

    NOTE
        This class is provided as source code.   To make use of this class you
        must compile it into an object module and  link it in  with  your main
        program.

        Also your program must open the following libraries:

        intuition.library       - V37 or better.
        graphics.library        - V37 or better.
        utility.library         - V37 or better.
        bitmap.library          - V1.3 or better.
        bgui.library            - V39 or better.

        Ofcourse these libraries must remain open until you are done using the
        class.

magnifyclass/Methods                                      magnifyclass/Methods

    NEW METHODS
        MAGM_Undo -- This method tells the class to undo the last operation on
                     the MAGNIFY_PicArea (direct set, last user edit operation).

        MAGM_AllocBitMap -- Internal methods for allocating bitmap. Do _not_
        MAGM_FreeBitMap     use them because they will be obsolete in a future
                            version (it will use BGUI_Alloc/FreeBitMap() which
                            are V40 bgui.library functions.

    CHANGED METHODS
        None.
magnifyclass/Attributes                                magnifyclass/Attributes

    NOTE
        All baseclass attributes are also valid for this class.
        
    NAME
        MAGNIFY_MagFactor -- ( UWORD )
        
    FUNCION
        This is the magnification factor of the magnify object.  If you set it
        the class will immediately change the picture to show you the magnified
        part which  fits  into  the  object  bounds. The attribute MAGNIFY_Grid
        also causes another change of the magnification.
        
        Default is 1 (no magnification). Applicability is (ISGNU).
        
    SEE ALSO
        MAGNIFY_Grid
        

    NAME
        MAGNIFY_Edit -- ( BOOL )
        
    FUNCTION
        This attribute selects the kind of the Magnify object.  If set to TRUE
        the user is allowed to draw in it with the mouse. Drawing is done with
        the left mouse button. If set to FALSE it is a view only gadget.
        
        Defalt is TRUE (Drawing is allowed). Applicability is (IG)
        
        
    NAME
        MAGNIFY_SpecialFrame -- ( BOOL )

    FUNCTION
        To allow you to have a point with a  frame around it.  This is mainly
        thought to be used in sprite or bob editors whose graphic objects are
        later  controlled  by  mouse  or joystick (like the "Hot Spot" in the
        Pointer  Preferences ). Note  that  the  point  is  only  framed when 
        MAGNIFY_Grid == TRUE.
        
        Default is FALSE (no framed pointer). Applicability is (IG).

    BUGS
        I never tested this attribute.
        
    SEE ALSO
        MAGNIFY_FrameCoordsX
        MAGNIFY_FrameCoordsY
        MAGNIFY_Grid

        
    NAME
        MAGNIFY_GraphWidth -- ( UWORD )
        MAGNIFY_GraphHeight -- ( UWORD )
        
    FUNCTION
        These attributes  specify the Width and the Height of the picture area
        (better:  bitmap  area  of the window object). They must be set to use
        the object at all.  These  attributes are used to set the picture area
        in which the picture will be rendered.
        
        Defaults are MINCOL for MAGNIFY_GraphWidth
                 and MINROW for MAGNIFY_GraphHeight
        Applicability is (IG)
        
    WARNING
        Don't assume anything about the real defaults values. They are subject
        to change or even dissappear in the future and might be replaced by an
        "error and exit" message.
        
    FURTHER NOTES
        Until  know  it is not possible to change the picture area size om the
        fly.  This is theoretically possible, but needs some overhead.  Please
        let me know if this is important to you.

    SEE ALSO
        MAGNIFY_PicArea


    NAME
        MAGNIFY_FrameCoordsX -- ( UWORD )
        MAGNIFY_FrameCoordsY -- ( UWORD )
    
    FUNCTION
        To specify the X- and Y-coordinates on which the  framed pointer  will
        appear. Note that this is not done automatically like editing.
        
        Defaults are 0. Applicability is (ISGNU)
        
    SEE ALSO
        MAGNIFY_SpecialFrame


    NAME
        MAGNIFY_PicArea -- ( struct BitMap * )
        
    FUNCTION
        This attribute is used to set the whole  picture Area  and its bitmap.
        The BitMap has to be fully initialized and allocated.  If a picture is
        already in the BitMap it will be shown after building the gadget. This
        is also the way to change the picture of the gadget.
        
        The object allocates its own  BitMap so you can free your BitMap after
        having set / initialized it into  the  object.  If there already was a
        picture in the BitMap it will be copied into a (new allocated)  BitMap
        which works as an undo buffer.  This buffer can be  restored using the
        MAGM_Undo method.
        
        When using  V39+  of the OS the object allocates the bitmap  using the
        GetBitMapAttr() function,  so there should be no  problem with special
        bitmaps (as long as they work with ScaleBitMap()).
        
        Default is NULL. Applicability is (ISGNU)

    SEE ALSO
        MAGNIFY_SelectRegionX
        MAGNIFY_SelectRegionY


    NAME
        MAGNIFY_CurrentPen -- ( UBYTE )
        
    FUNCTION
        To set or change the current  Pen Color which is used in drawing mode.
        This is useful in conjunction with a palette gadget :-).
        
        Default is 0. Applicability is (ISGU)
        
    WARNING
        24 Bit Palettes or HAM Mode are not supported by this class.

    SEE ALSO
        MAGNIFY_Edit


    NAME
        MAGNIFY_Grid -- ( BOOL )

    FUNCTION
        To enable the GRID Mode of the Class. This creates a square around each
        pixel.  The magnification of the object is therefore doubled.  The grid
        will be drawm in the current Grid color.
        
        Default is FALSE (no Grid mode). Applicability is (ISGNU)

    SEE ALSO
        MAGNIFY_MagFactor
        MAGNIFY_GridPen


    NAME
        MAGNIFY_GridPen ( UBYTE )

    FUNCTION
        This attribute sets or changes the Pen in which the Grid is drawn.
        
        Default is 0 ("invisible"). Applicability is (ISGNU)

    WARNING
        24 Bit Palettes or HAM Mode are not supported by this class.

    SEE ALSO
        MAGNIFY_Grid


    NAME
        MAGNIFY_SelectRegionX -- ( UWORD )
        MAGNIFY_SelectRegionY -- ( UWORD )

    FUNCTION
        To change the X- and Y-Coordinates of the picture area.  These are the
        real coodinates of the picture bitmap of the object.  This way you can
        scroll around in the whole picture. (Note that scrolling itself is not
        very fast and can't be optimized with much overhead.)
        
        Defaults are 0. Applicability is (ISGNU)
