/* --------------------------------------------------------------

   ABOUT.WFM
   This was created by Saveli Kossenko, and modified for
   the dUFLP library by Ken Mayer. Modifications are pretty 
   minor. This form can be used as an "about" dialog
   for any application. The fun part is that Saveli created
   a really nice scrolling text object using the timer
   object in Visual dBASE 7 ...

   This is done by using a timer object, and moving a container
   (and everything on it) up ...

   The one drawback to the way that Saveli wrote it, is that
   you have to modify the text in the code. See ABOUT2.WFM
   for a version that allows absolute placement on the container
   of all items, and then scrolls the container ...

   Saveli can be reached at: saveli@iName.com
   -------------------------------------------------------------- */
** END HEADER -- do not remove this line
//
// Generated on 10/17/2002
//
parameter bModal
local f
f = new aboutForm()
if (bModal)
   f.mdi = false // ensure not MDI
   f.readModal()
else
   f.open()
endif

class aboutForm of FORM
   with (this)
      onOpen = class::FORM_ONOPEN
      onClose = class::FORM_ONCLOSE
      open = class::FORM_OPEN
      scaleFontBold = false
      height = 11.5
      left = 32.5714
      top = 4.1818
      width = 49.5714
      text = "About"
      autoCenter = true
      mdi = false
      sizeable = false
      maximize = false
      minimize = false
   endwith

   this.TEXT1 = new TEXT(this)
   with (this.TEXT1)
      height = 0.7273
      left = 2
      top = 1
      width = 6
      text = "Hello!!!"
   endwith

   this.TEXT2 = new TEXT(this)
   with (this.TEXT2)
      height = 0.7273
      left = 2
      top = 2.5
      width = 8
      text = "It is test"
   endwith

   this.TEXT3 = new TEXT(this)
   with (this.TEXT3)
      height = 4.3636
      left = 2
      top = 5.5
      width = 19
      text = "<p>Here you can create any text and images that you want.</p><p>In second part of the dialog will be scrolling text.</p>"
   endwith

   this.CONTAINER1 = new CONTAINER(this)
   with (this.CONTAINER1)
      left = 25.7143
      top = 0.6818
      width = 22.7143
      height = 10
      borderStyle = 3	// None
   endwith

   this.CONTAINER1.IMAGE1 = new IMAGE(this.CONTAINER1)
   with (this.CONTAINER1.IMAGE1)
      height = 1.6364
      left = 17
      top = 5
      width = 5.1429
      dataSource = "RESOURCE #1510"
      alignment = 4	// True Size
      borderStyle = 3	// None
   endwith


   // {Linked Method} form.onClose
   function form_onClose
     this.timer.enabled = false
   return

   // {Linked Method} form.onOpen
   function form_onOpen

       // set up array
       form.a1 = new array()
       form.a1.add( "This is the test of" )
       form.a1.add( " the About Box" )
       form.a1.add( "Version 1.6" )
       form.a1.add( "This form is" )
       form.a1.add( "created by" )
       form.a1.add( "Saveli Kossenko" )
       form.a1.add( "" )
       form.a1.add( "And can be inserted in" )
       form.a1.add( "any VDB applicaions" )
       form.a1.add( "Just change" )
       form.a1.add( "a1 array" )
       form.a1.add( "in the source code" )
       form.a1.add( "of this program" )
       form.a1.add( "and then simply" )
       form.a1.add( "run it from" )
       form.a1.add( "your forms" )
       form.a1.add( "" )
       form.a1.add( "" )
       form.a1.add( "So you" )
       form.a1.add( "can use it in any" )
       form.a1.add( "VDB7 applications" )
       form.a1.add( "But please" )
       form.a1.add( "Keep my name" )
       form.a1.add( "in the source" )
       form.a1.add( "code" )
       form.a1.add( "" )
       form.a1.add( "" )
       form.a1.add( "My e-mail is" )
       form.a1.add( "Saveli@iName.com" )
       form.a1.add( "" ) 
       form.a1.add( "With best regards,") 
       form.a1.add( "Saveli Kossenko" ) 
       form.a1.add( "______________________" )

       form.ii = this.height+2

       // modify container properties:
       with ( this.container1 )
            top = this.height + 2
            left = form.width / 2
            width = (form.width/2) - 1
            height = aLen( form.a1 )
       endwith

       for i=1 to aLen(form.a1)
           TXT = new TEXT(this.CONTAINER1)
           with (TXT)
                wrap=false
                height = 1
                left = 1
                top = i-1
                width = (Form.width/2)-3
                metric = 0
                colorNormal = "BtnText/BtnFace"
                text = form.a1[i]
           endwith
       next

       this.timer = new Timer()
       this.timer.parent   = this               // Assign form as timer's parent
       this.timer.onTimer  = this.updateClock   // Assign method in form to timer
       this.timer.interval = 0.02               // Fire timer every 0.02 seconds
       this.timer.enabled  = true               // Activate timer

   return

   function form_open
      // if dBASE Plus or later, we usually don't
      // want this form to show the button on the
      // taskbar, so ...
      if __version__ => 2.0
         this.showTaskbarButton := false
      endif
   return ABOUTFORM::open()

   function updateClock()
      nLeft = this.parent.container1.left
      if (this.parent.ii<(-this.parent.container1.height))

         this.parent.ii=INT(this.parent.height+2)

         this.parent.CONTAINER1.Move(nLeft,this.parent.ii)
       else 
         this.parent.ii=this.parent.ii-0.02
         this.parent.CONTAINER1.Move(nLeft,this.parent.ii)
      endif 
endclass
