Module StdAbout.pkg

     1//************************************************************************
     2// Confidential Trade Secret.
     3// Copyright (c) 1997 Data Access Corporation, Miami Florida
     4// as an unpublished work.  All rights reserved.
     5// DataFlex is a registered trademark of Data Access Corporation.
     6//
     7//************************************************************************
     8//************************************************************************
     9//
    10// $File name  : StdAbout.pkg
    11// $File title : Standard about object package for VDF
    12// Notice      :
    13// $Author(s)  : John Tuohy
    14//
    15// $Rev History
    16//
    17// JT 06/27/97   File created
    18//************************************************************************
    19
    20// This provides a quick and simple way to create an about package for a program.
    21// You need to create a message inside you client area called Activate_About.
    22// Within this message you should send the message DoAbout passing needed
    23// string information.
    24//
    25//       Procedure Activate_About
    26//           Send DoAbout sTitle sVersion sCopyright sAuthor sBitmap
    27//       End_Procedure
    28//    where: sTitle =     Name of application. If none provided, uses caption
    29//                        bar title
    30//           sVersion   = Version Line. If none provided, will be blank
    31//           sCopyRight = Copyright Line. If none provided, will be blank
    32//           sAuthor    = Author name, blank if none provided
    33//           sBitMap    = Bitmap logo. If none provided, standard VDF bitmap
    34//                        is used.
    35// It is expected that you will place this in your own object package. For
    36// example an order about package may look like this:
    37//
    38//   // OrderAbout.pkg
    39//   Use StdAbout.pkg
    40//   Procedure Activate_About
    41//      String sTitle sCopyright sVersion sAuthor
    42//      Move "My Order Entry System" to sTitle
    43//      Move "Version 2.1" to sVersion
    44//      Move "Copyright 1997, Super Software Inc." to sCopyright
    45//      Move "John Smith"  to sAuthor
    46//      Send DoAbout sTitle sVersion sCopyright sAuthor ""
    47//   end_procedure
    48//   // end of file.
    49
    50Use DfAbout.pkg
    51
    52// *************************************************************************
    53//  Public message. This is the default message. It is expected that you will
    54//   create your own message to override this
    55// *************************************************************************
    56
    57Procedure Activate_About
    58   Send DoAbout "" "" "" "" ""
    59End_Procedure
    60
    61// *************************************************************************
    62//  Public message. It is expected that you will send this message (most
    63//  likely from Activate_About. This creates an about object, activates it
    64//  and destroys it when done. It is not exepected that you will augment this.
    65// *************************************************************************
    66
    67Procedure DoAbout string sTitle string sVersion string sCopyRight string sAuthor string sBitmap
    68        integer hoObj hoMain
    69
    70        // create object
    71        Object About is an AboutDialog
    72            // if no title passed use the label of the main panel
    73            // (if a main panel exists).
    74            if sTitle     eq '' Begin
    75                Get Main_Window of desktop to hoMain
    76                if hoMain Get Label of hoMain to sTitle
    77            end
    78            set productname to sTitle
    79            set version     to sVersion
    80            set copyright   to sCopyRight
    81            set author      to sAuthor
    82            If sBitmap    ne '' ;
    83               set logo to sBitMap // square bitmaps of 42x42 work best
    84            Move self to hoObj // object Id
    85        End_Object
    86        Send Popup   of hoObj    // popup the about object
    87        Send Destroy of hoObj // when done, it will be destroyed
    88End_procedure