@database 07a06450-0
@master AFrame:Help/Panel.Guide
@$VER: 1.0
@author "Deryk B Robosson"
@(c) "1995, 1996 Synthetic Input"
@index Main
@remark Created with Heddley v1.1 (c) Edd Dumbill 1994

@node "Main" "AFPanel"

                      ***********************************

                        Panel C++ Object

                        AFrame Version 1.0
                        Panel Object Version 1.0

                        (c) 1995,1996 Jeffry A Worth
                                       Deryk B Robosson

                      ***********************************

TABLE OF CONTENTS

  @{"Panel Object Information" link "INFORMATION" 0}

  Methods:
    @{"AFPanel" link "AFPANEL" 0}
    @{"~AFPanel" link "~AFPANEL" 0}

    @{"Create" link "CREATE" 0}

    @{"Misc Members" link "MISCMEMBERS" 0}

    @{"Includes" link "INCLUDES" 0}
    @{"Source" link "SOURCE" 0}
    @{"History" link "HISTORY" 0}
    @{"Distribution" link "DISTRIBUTION" 0}
@endnode

@node "INFORMATION" "Panel Object Information"
AFPanel/Object Information

  The Panel Object was written to provide a C++ Object Class interface in order to visually group information such
as gadgets, images, text etc.

  This Panel also offers all the features inherent of AFGadget.
@endnode

@node "AFPANEL" "AFPanel"
AFPanel/AFPanel

  NAME AFImageButton()

  DESCRIPTION
    Default class constructor.  Modify this only if you wish each class to have
    the modifications

  INPUTS
    none

  RESULT
    none

  BUGS
    none known

  SEE ALSO
    @{"~AFPanel" link "~AFPANEL" 0}
@endnode

@node "~AFPANEL" "~AFPanel"
AFPanel/~AFPanel

  NAME ~AFImageButton()

  DESCRIPTION
    Default class destructor.  Modify this only if you wish each class to have
    the modifications

  INPUTS
    none

  RESULT
    none

  BUGS
    none known

  SEE ALSO
    @{"AFPanel" link "AFPANEL" 0}
@endnode

@node "CREATE" "Create"
AFPanel/Create

  NAME Create()

    void = Create(char *text, AFWindow* pwindow, AFRect *rect, ULONG id, int bevel)

  DESCRIPTION
    The Create function creates the Panel gadget at the points supplied by rect

  INPUTS
    text    - pointer to text to placed in the panel.  If NULL, no text is used.
    pwindow - pointer to the window to receive the panel
    rect    - size and coordinates of panel
    id      - gadget id of panel
    bevel   - defines border type.  See Includes for description

  RESULT
    none

  BUGS
    none known

  SEE ALSO
    AFWindow
    AFRect
@endnode

@node "MISCMEMBERS" "Misc Members"
AFPanel/Misc Members

  @{"m_IntuiText" link "M_INTUITEXT" 0}
  @{"m_gborder" link "M_GBORDER" 0}, @{"m_gborder2" link "M_GBORDER2" 0}
  @{"m_text" link "M_TEXT" 0}
  @{"m_xyshine" link "M_XYSHINE" 0}
  @{"m_xyshadow" link "M_XYSHADOW" 0}
@endnode

@node "INCLUDES" "Includes"
  //////////////////////////////////////////////////////////////////////////////
  // panel.hpp
  //
  // Jeffry  Worth
  // November 10, 1995
  //////////////////////////////////////////////////////////////////////////////

  #ifndef __PANEL_HPP__
  #define __PANEL_HPP__

  //////////////////////////////////////////////////////////////////////////////
  // INCLUDES
  #include <string.h>
  #include "aframe:include/gadget.hpp"

  //////////////////////////////////////////////////////////////////////////////
  // Definitions
  #define PANEL_BEVELDOWN   0
  #define PANEL_BEVELUP     1
  #define PANEL_NOBORDER    2

  //////////////////////////////////////////////////////////////////////////////
  // Panel Class

  class AFPanel : public AFGadget
  {
  public:
    AFPanel();
    ~AFPanel();

    virtual void DestroyObject();
    virtual char *ObjectType() { return "Panel"; };

    virtual void Create(char *text, AFWindow* pwindow, AFRect *rect, ULONG id,
                        int bevel);

    struct IntuiText m_IntuiText;
    struct Border m_gborder,m_gborder2;
    char *m_text;
    WORD m_xyshine[6];
    WORD m_xyshadow[6];
  };

  //////////////////////////////////////////////////////////////////////////////
  #endif // __PANEL_HPP__
@endnode

@node "SOURCE" "Source"
  //////////////////////////////////////////////////////////////////////////////
  // panel.cpp
  //
  // Jeffry A Worth
  // November 10, 1995
  //////////////////////////////////////////////////////////////////////////////

  //////////////////////////////////////////////////////////////////////////////
  // INCLUDES
  #include "aframe:include/panel.hpp"

  //////////////////////////////////////////////////////////////////////////////
  //

  AFPanel::AFPanel()
  {
    m_text=NULL;
  }

  AFPanel::~AFPanel()
  {
    DestroyObject();
  }

  void AFPanel::DestroyObject()
  {
    AFGadget::DestroyObject();
    if(m_text) {
      delete m_text;
      m_text=NULL;
    }
  }

  void AFPanel::Create(char *text, AFWindow* pwindow, AFRect *rect, ULONG id, int bevel)
  {
    WORD w,h;

    // Create the gadget
    AFGadget::Create(pwindow,rect,id);

    // Create string for the text
    if(text) {
      m_text = new char[strlen(text)+1];
      strcpy(m_text,text);
    }

    if(bevel!=PANEL_NOBORDER) {
      // Fill in coordinates to draw border
      w=rect->Width()-1;
      h=rect->Height()-1;
      m_xyshine[0]=m_xyshine[2]=m_xyshine[3]=m_xyshine[5]=0;
      _xyshine[1]=h;
      _xyshine[4]=w;

      _xyshadow[0]=1;
      m_xyshadow[1]=m_xyshadow[3]=h;
      _xyshadow[2]=m_xyshadow[4]=w;
      _xyshadow[5]=0;

     // Fill in Border Structure
      _gborder.LeftEdge = m_gborder2.LeftEdge = 0;
      _gborder.TopEdge = m_gborder2.TopEdge = 0;
      if(bevel) {
          m_gborder.FrontPen = 2;
          m_gborder2.FrontPen = 1;
      } else {
          m_gborder.FrontPen = 1;
          m_gborder2.FrontPen = 2;
        }
      m_gborder.BackPen = m_gborder2.BackPen = 0;
      m_gborder.DrawMode = m_gborder2.DrawMode = JAM1;
      m_gborder.Count = m_gborder2.Count = 3;
      m_gborder.XY = m_xyshine;
      m_gborder2.XY = m_xyshadow; 
      m_gborder.NextBorder = &m_gborder2;
      m_gborder2.NextBorder = NULL;
    }

    // Fill IntuiText Structure
    m_IntuiText.FrontPen = 1;
    m_IntuiText.DrawMode = JAM1;
    m_IntuiText.LeftEdge = 5;
    m_IntuiText.TopEdge = 5;
    m_IntuiText.ITextFont = NULL;
    m_IntuiText.IText = (UBYTE*)m_text;
    m_IntuiText.NextText = NULL;

    // Attach IntuiText Struct and Border Struct to gadget Struct
    m_pgadget->GadgetText = &m_IntuiText;

    if(bevel!=PANEL_NOBORDER)
      m_pgadget->GadgetRender = &m_gborder;
    else
      m_pgadget->GadgetRender = NULL;

    m_pgadget->Flags = GFLG_GADGHNONE;
  }
@endnode

@node "HISTORY" "History"
                    ***HISTORY***

 ***********************************************************
  Panel Object v1.0

  Created November 10, 1995
  Release November 10, 1995

   - Created all function class objects.
 ***********************************************************
@endnode

@node "DISTRIBUTION" "Distribution"
Distribution

  The programs and files in this distribution are freely distributable, but are also Copyright (c) Jeff Worth and
Deryk Robosson. They may be freely distributed as long as no more than a nominal fee is charged to cover time and
copying costs. AFrame is distributed as non-crippled shareware, it is fully functional.

Commercial Distribution

Commercial usage is allowed if the following conditions are met:

    a) You state in your documentation that your program uses aframe.library
       and that AFrame is Copyright (c) Jeff Worth and Deryk Robosson.

    b) You send us a copy of your finished product(s) using aframe.library.

  If these conditions are met you are allowed to include the Kickstart 2.0 or higher version of aframe.library and
the installation script(s) with your commercial product.



Freely Distibutable Products

  All of the files copyrighted by the authors must remain unmodified.  None of these files may be distributed on its
own, the entire package must be distributed as one whole.  'demo.cpp' is full public domain and can be used in any
way you like.

  There is one exception to the above.  If you plan to release a freely distributable program (either public domain,
freeware or shareware), you may include 'libs/aframe.library', the installation scripts (with icon), the
documentation (with icons) with your distribution.

If you include AFrame with a crippled shareware program I'd like to ask you to send us a full working version.

  Whether your program is freely distributable or commercial, you must state in your documentation that your program
uses aframe.library and that AFrame is Copyright (c) Jeff Worth and Deryk Robosson
@endnode

@node "M_INTUITEXT" "m_IntuiText"
AFPanel/m_IntuiText

  MEMBER TYPE
   struct IntuiText

  DESCRIPTION
   An IntuiText structure used if text is to be place in the panel

  SEE ALSO
   <intuition/intuition.h>
@endnode

@node "M_GBORDER" "m_gborder"
AFPanel/m_gborder

  MEMBER TYPE
   struct Border

  DESCRIPTION
   A Border struct unique to each class

  SEE ALSO
   <intuition/intuition.h>
@endnode

@node "M_GBORDER2" "m_gborder2"
AFPanel/m_gborder2

  MEMBER TYPE
   struct Border

  DESCRIPTION
   A Border struct unique to each class

  SEE ALSO
   <intuition/intuition.h>
@endnode

@node "M_TEXT" "m_text"
AFPanel/m_text

  MEMBER TYPE
   char *

  DESCRIPTION
   A text pointer unique to each class

  SEE ALSO
   <intuition/intuition.h>
@endnode

@node "M_XYSHINE" "m_xyshine"
AFPanel/m_xyshine

  MEMBER TYPE
   WORD

  DESCRIPTION
   An array used to draw the borders.  Unique to each class

  SEE ALSO
   <intuition/intuition.h>
@endnode

@node "M_XYSHADOW" "m_xyshadow"
AFPanel/m_xyshadow

  MEMBER TYPE
   WORD

  DESCRIPTION
   An array used to draw the borders.  Unique to each class

  SEE ALSO
   <intuition/intuition.h>
@endnode

