home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual dBase Pro v7.0 / DATA1.CAB / Sample_dBASE / Mugs / Mugs.cfm < prev    next >
Encoding:
Text File  |  1997-11-20  |  3.0 KB  |  122 lines

  1. //--------------------------------------------------------------
  2. //
  3. //  Mugs.cfm --  Custom form classes for the Mugs application. 
  4. //
  5. //  The mugsCForm defines a default color for forms in 
  6. //  the Mugs application.
  7. //
  8. //  The mugsDataCForm is a template for data entry
  9. //  forms in the Mugs application. It includes 
  10. //  definitions for a color, title, notebook 
  11. //  and grid. It also contains methods for resizing
  12. //  controls on the data entry forms.
  13. //
  14. //  Dependencies: <none>
  15. //
  16. //  Visual dBASE Samples Group
  17. //
  18. //  $Revision:   1.11  $
  19. //
  20. //  Copyright (c) 1997, Borland International, Inc. 
  21. //  All rights reserved.
  22. //
  23. //---------------------------------------------------------------
  24.  
  25.  
  26. CLASS mugsCForm OF FORM custom
  27.    this.ColorNormal = "burlywood"
  28.    this.Height = 18.4118
  29.    this.Left = 23
  30.    this.Top = 4.0588
  31.    this.Width = 56
  32.    this.Text = ""
  33.  
  34.  
  35. ENDCLASS
  36. class mugsDataCForm of FORM custom
  37.    with (this)
  38.       canClose = class::FORM_CANCLOSE
  39.       onSize = class::FORM_ONSIZE
  40.       Open = class::FORM_OPEN
  41.       scaleFontSize = 8
  42.       scaleFontBold = false
  43.       colorNormal = "APPWORKSPACE"
  44.       height = 15
  45.       left = 10
  46.       top = 2
  47.       width = 56.8333
  48.       text = ""
  49.    endwith
  50.  
  51.  
  52.    this.TITLE = new TEXT(this)
  53.    with (this.TITLE)
  54.       height = 1.5
  55.       left = 1
  56.       top = 0.5
  57.       width = 54
  58.       border = true
  59.       metric = 0
  60.       colorNormal = "MenuText/Menu"
  61.       alignVertical = 1
  62.       alignHorizontal = 1
  63.       fontSize = 8
  64.       text = "<h2>title</h2>"
  65.       borderStyle = 2
  66.    endwith
  67.  
  68.  
  69.    this.BOOK1 = new NOTEBOOK(this)
  70.    with (this.BOOK1)
  71.       height = 12
  72.       left = 1
  73.       top = 2.5
  74.       width = 54
  75.       metric = 0
  76.       fontName = "MS Sans Serif"
  77.       fontSize = 8
  78.       dataSource = 'ARRAY {"Row","Table"}'
  79.       borderStyle = 2
  80.    endwith
  81.  
  82.  
  83.    this.BOOK1.GRIDROWS = new GRID(this.BOOK1)
  84.    with (this.BOOK1.GRIDROWS)
  85.       bgColor = "white"
  86.       pageno = 2
  87.       height = 10.3529
  88.       left = 0.5
  89.       top = 1.5
  90.       width = 52
  91.       metric = 0
  92.    endwith
  93.  
  94.    // {Linked Method} Form.onSize
  95.    function Form_onSize(nSizeType, nWidth, nHeight)
  96.       this.TITLE.width  := ( nWidth - 2 )
  97.       this.book1.move( this.book1.left, ;
  98.                        this.book1.top, ;
  99.                       ( nWidth - 2 ),;
  100.                       ( nHeight - 3 ) )
  101.       this.book1.gridRows.move( this.book1.gridRows.left, ;
  102.                                 this.book1.gridRows.top, ;
  103.                                ( nWidth - 4 ), ;
  104.                                ( nHeight - 5 ) )
  105.    return ( nSizeType )
  106.  
  107.    // {Linked Method} Form.open
  108.    function Form_open
  109.       class::Form_OnSize( 0, this.width, this.height )
  110.    return SUPER::OPEN()
  111.  
  112.    // {Linked Method} Form.canClose
  113.    function Form_canClose
  114.       if ( TYPE('this.rowset.state') == "N" )
  115.          if ( this.rowset.state == 3 )
  116.             this.rowset.abandon()
  117.          endif
  118.       endif
  119.    return true
  120.  
  121. endclass
  122.