home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / crystal / extras / vbxdemo / main.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-12-15  |  29.4 KB  |  916 lines

  1. VERSION 2.00
  2. Begin MDIForm Main 
  3.    Caption         =   "VBXDemo"
  4.    ClientHeight    =   5235
  5.    ClientLeft      =   1065
  6.    ClientTop       =   1965
  7.    ClientWidth     =   10215
  8.    Height          =   5925
  9.    Icon            =   MAIN.FRX:0000
  10.    Left            =   1005
  11.    LinkTopic       =   "Main"
  12.    Top             =   1335
  13.    Width           =   10335
  14.    WindowState     =   2  'Maximized
  15.    Begin SSPanel Panel3D1 
  16.       Align           =   2  'Align Bottom
  17.       Alignment       =   1  'Left Justify - MIDDLE
  18.       BackColor       =   &H00C0C0C0&
  19.       BevelInner      =   1  'Inset
  20.       BevelOuter      =   0  'None
  21.       BevelWidth      =   2
  22.       BorderWidth     =   2
  23.       Font3D          =   0  'None
  24.       Height          =   690
  25.       Left            =   0
  26.       TabIndex        =   2
  27.       Top             =   4065
  28.       Visible         =   0   'False
  29.       Width           =   10215
  30.       Begin SSCommand Command3D17 
  31.          Caption         =   "Close"
  32.          Font3D          =   0  'None
  33.          Height          =   375
  34.          Left            =   270
  35.          TabIndex        =   12
  36.          Top             =   135
  37.          Visible         =   0   'False
  38.          Width           =   795
  39.       End
  40.    End
  41.    Begin SSPanel ToolBar 
  42.       Align           =   1  'Align Top
  43.       BackColor       =   &H00C0C0C0&
  44.       Font3D          =   0  'None
  45.       Height          =   555
  46.       Left            =   0
  47.       TabIndex        =   1
  48.       Top             =   0
  49.       Width           =   10215
  50.       Begin CrystalReport Report1 
  51.          BoundReportFooter=   0   'False
  52.          BoundReportHeading=   ""
  53.          Connect         =   ""
  54.          CopiesToPrinter =   1
  55.          Destination     =   0  'Window
  56.          DetailCopies    =   1
  57.          DiscardSavedData=   0   'False
  58.          EMailCCList     =   ""
  59.          EMailMessage    =   ""
  60.          EMailSubject    =   ""
  61.          EMailToList     =   ""
  62.          EMailVIMBCCList =   ""
  63.          GroupSelectionFormula=   ""
  64.          Left            =   8610
  65.          MarginBottom    =   0
  66.          MarginLeft      =   0
  67.          MarginRight     =   0
  68.          MarginTop       =   0
  69.          PrinterCollation=   2  'default
  70.          PrinterCopies   =   1
  71.          PrinterDriver   =   ""
  72.          PrinterName     =   ""
  73.          PrinterPort     =   ""
  74.          PrinterStartPage=   0
  75.          PrinterStopPage =   0
  76.          PrintFileCharSepQuote=   ""
  77.          PrintFileCharSepSeparator=   ""
  78.          PrintFileName   =   ""
  79.          PrintFileType   =   2  'Text
  80.          PrintFileUseRptDateFmt=   0   'False
  81.          PrintFileUseRptNumberFmt=   0   'False
  82.          ReportFileName  =   ""
  83.          ReportSource    =   0  'Report File
  84.          ReportTitle     =   ""
  85.          SelectionFormula=   ""
  86.          SessionHandle   =   0
  87.          SQLQuery        =   ""
  88.          Top             =   90
  89.          UserName        =   ""
  90.          WindowBorderStyle=   0  'None
  91.          WindowControlBox=   -1  'True
  92.          WindowControls  =   -1  'True
  93.          WindowHeight    =   300
  94.          WindowLeft      =   100
  95.          WindowMaxButton =   -1  'True
  96.          WindowMinButton =   -1  'True
  97.          WindowParentHandle=   0
  98.          WindowState     =   0  'normal
  99.          WindowTitle     =   ""
  100.          WindowTop       =   100
  101.          WindowWidth     =   480
  102.       End
  103.       Begin SSCommand SQLButton 
  104.          Enabled         =   0   'False
  105.          Font3D          =   0  'None
  106.          Height          =   375
  107.          Left            =   3870
  108.          Picture         =   MAIN.FRX:0302
  109.          TabIndex        =   13
  110.          Top             =   90
  111.          Width           =   405
  112.       End
  113.       Begin Timer Timer1 
  114.          Left            =   9060
  115.          Top             =   90
  116.       End
  117.       Begin SSCommand SortButton 
  118.          Enabled         =   0   'False
  119.          Font3D          =   0  'None
  120.          Height          =   375
  121.          Left            =   2460
  122.          Picture         =   MAIN.FRX:04EC
  123.          TabIndex        =   11
  124.          Top             =   90
  125.          Width           =   405
  126.       End
  127.       Begin SSCommand PrintButton 
  128.          Enabled         =   0   'False
  129.          Font3D          =   0  'None
  130.          Height          =   375
  131.          Left            =   1110
  132.          Picture         =   MAIN.FRX:06D6
  133.          TabIndex        =   10
  134.          Top             =   90
  135.          Width           =   405
  136.       End
  137.       Begin SSCommand OpenJobbutton 
  138.          Font3D          =   0  'None
  139.          Height          =   375
  140.          Left            =   150
  141.          Picture         =   MAIN.FRX:0858
  142.          TabIndex        =   9
  143.          Top             =   90
  144.          Width           =   405
  145.       End
  146.       Begin SSCommand HelpButton 
  147.          Font3D          =   0  'None
  148.          Height          =   375
  149.          Left            =   6510
  150.          Picture         =   MAIN.FRX:09DA
  151.          TabIndex        =   8
  152.          Top             =   90
  153.          Width           =   405
  154.       End
  155.       Begin SSCommand SelectionButton 
  156.          Enabled         =   0   'False
  157.          Font3D          =   0  'None
  158.          Height          =   375
  159.          Left            =   3450
  160.          Picture         =   MAIN.FRX:0B5C
  161.          TabIndex        =   7
  162.          Top             =   90
  163.          Width           =   405
  164.       End
  165.       Begin SSCommand Previewbutton 
  166.          Enabled         =   0   'False
  167.          Font3D          =   0  'None
  168.          Height          =   375
  169.          Left            =   720
  170.          Picture         =   MAIN.FRX:0E5E
  171.          TabIndex        =   6
  172.          Top             =   90
  173.          Width           =   405
  174.       End
  175.       Begin SSCommand Graphbutton 
  176.          Enabled         =   0   'False
  177.          Font3D          =   0  'None
  178.          Height          =   375
  179.          Left            =   2040
  180.          Picture         =   MAIN.FRX:1160
  181.          TabIndex        =   5
  182.          Top             =   90
  183.          Width           =   405
  184.       End
  185.       Begin SSCommand FormulaButton 
  186.          Enabled         =   0   'False
  187.          Font3D          =   0  'None
  188.          Height          =   375
  189.          Left            =   2910
  190.          Picture         =   MAIN.FRX:133C
  191.          TabIndex        =   4
  192.          Top             =   90
  193.          Width           =   405
  194.       End
  195.       Begin SSCommand ExportButton 
  196.          Enabled         =   0   'False
  197.          Font3D          =   0  'None
  198.          Height          =   375
  199.          Left            =   1530
  200.          Picture         =   MAIN.FRX:1510
  201.          TabIndex        =   3
  202.          Top             =   90
  203.          Width           =   405
  204.       End
  205.       Begin CommonDialog CMDialog1 
  206.          DefaultExt      =   "*.rpt"
  207.          DialogTitle     =   "Open Report"
  208.          Filter          =   "Crystal Report(*.rpt)|*.rpt"
  209.          Left            =   9540
  210.          Top             =   45
  211.       End
  212.    End
  213.    Begin SSPanel StatusBar 
  214.       Align           =   2  'Align Bottom
  215.       Alignment       =   1  'Left Justify - MIDDLE
  216.       BackColor       =   &H00C0C0C0&
  217.       BevelInner      =   1  'Inset
  218.       BevelOuter      =   0  'None
  219.       BevelWidth      =   2
  220.       BorderWidth     =   2
  221.       Caption         =   " Ready"
  222.       Font3D          =   0  'None
  223.       FontBold        =   0   'False
  224.       FontItalic      =   0   'False
  225.       FontName        =   "Arial"
  226.       FontSize        =   9
  227.       FontStrikethru  =   0   'False
  228.       FontUnderline   =   0   'False
  229.       Height          =   480
  230.       Left            =   0
  231.       TabIndex        =   0
  232.       Top             =   4755
  233.       Width           =   10215
  234.       Begin Line Line2 
  235.          BorderColor     =   &H00FFFFFF&
  236.          X1              =   0
  237.          X2              =   7350
  238.          Y1              =   30
  239.          Y2              =   30
  240.       End
  241.       Begin Line Line1 
  242.          BorderColor     =   &H00000000&
  243.          X1              =   0
  244.          X2              =   7350
  245.          Y1              =   15
  246.          Y2              =   15
  247.       End
  248.    End
  249.    Begin Menu MenuFile 
  250.       Caption         =   "&File"
  251.       Begin Menu MenuFileOpenReport 
  252.          Caption         =   "&Open Report"
  253.       End
  254.       Begin Menu MenuFileClose 
  255.          Caption         =   "&Close"
  256.          Enabled         =   0   'False
  257.       End
  258.       Begin Menu MenuFileSep1 
  259.          Caption         =   "-"
  260.       End
  261.       Begin Menu MenuFilePrint 
  262.          Caption         =   "&Print"
  263.          Enabled         =   0   'False
  264.          Begin Menu MenuFilePrinter 
  265.             Caption         =   "Printer"
  266.             Enabled         =   0   'False
  267.          End
  268.          Begin Menu MenuFileWindow 
  269.             Caption         =   "Window"
  270.          End
  271.       End
  272.       Begin Menu MenuFileExport 
  273.          Caption         =   "&Export"
  274.          Enabled         =   0   'False
  275.       End
  276.       Begin Menu MenuFileSep2 
  277.          Caption         =   "-"
  278.       End
  279.       Begin Menu MenuFileExit 
  280.          Caption         =   "E&xit"
  281.       End
  282.    End
  283.    Begin Menu MenuFormat 
  284.       Caption         =   "For&mat"
  285.       Begin Menu MenuFormatRptTitle 
  286.          Caption         =   "&Report Title"
  287.          Enabled         =   0   'False
  288.       End
  289.       Begin Menu MenuFormatGraph 
  290.          Caption         =   "&Graphing"
  291.          Enabled         =   0   'False
  292.       End
  293.    End
  294.    Begin Menu MenuFields 
  295.       Caption         =   "Sor&ting"
  296.       Begin Menu MenuFieldsRecordSortField 
  297.          Caption         =   "&Record Sort Fields"
  298.          Enabled         =   0   'False
  299.       End
  300.       Begin Menu MenuFieldsGroupSortFields 
  301.          Caption         =   "&Group Sort Fields"
  302.          Enabled         =   0   'False
  303.       End
  304.    End
  305.    Begin Menu MenuFormulas 
  306.       Caption         =   "Fo&rmula"
  307.       Begin Menu MenuFormulasSetFormula 
  308.          Caption         =   "&Formula"
  309.          Enabled         =   0   'False
  310.       End
  311.       Begin Menu MenuFormulasSetSelForm 
  312.          Caption         =   "&Selection Formula"
  313.          Enabled         =   0   'False
  314.       End
  315.       Begin Menu MenuFormulasGroupSel 
  316.          Caption         =   "&Group Selection Formula"
  317.          Enabled         =   0   'False
  318.       End
  319.    End
  320.    Begin Menu MenuDatabase 
  321.       Caption         =   "&Database"
  322.       Begin Menu MenuDBLocation 
  323.          Caption         =   "&Location"
  324.          Enabled         =   0   'False
  325.       End
  326.       Begin Menu MenuLogonInfo 
  327.          Caption         =   "Logon &Info"
  328.          Enabled         =   0   'False
  329.       End
  330.       Begin Menu MenuSecurity 
  331.          Caption         =   "Access &Security"
  332.          Enabled         =   0   'False
  333.       End
  334.    End
  335.    Begin Menu MenuSQL 
  336.       Caption         =   "&SQL"
  337.       Begin Menu MenuSQLModify 
  338.          Caption         =   "&Modify SQL"
  339.          Enabled         =   0   'False
  340.       End
  341.       Begin Menu MenuSQLStoredProc 
  342.          Caption         =   "&Stored Procedure"
  343.          Enabled         =   0   'False
  344.       End
  345.    End
  346.    Begin Menu MenuWindow 
  347.       Caption         =   "&Window"
  348.       WindowList      =   -1  'True
  349.       Begin Menu MenuWindowCascade 
  350.          Caption         =   "&Cascade"
  351.          Enabled         =   0   'False
  352.       End
  353.       Begin Menu MenuWindowTileH 
  354.          Caption         =   "Tile &Horizontally"
  355.          Enabled         =   0   'False
  356.       End
  357.       Begin Menu MenuWindowTileV 
  358.          Caption         =   "&Tile Vertically"
  359.          Enabled         =   0   'False
  360.       End
  361.       Begin Menu MenuWindowArrange 
  362.          Caption         =   "&Arrange"
  363.          Enabled         =   0   'False
  364.       End
  365.    End
  366.    Begin Menu MenuHelp 
  367.       Caption         =   "&Help"
  368.       Begin Menu MenuHelpCRWHLP 
  369.          Caption         =   "&Crystal Reports Help"
  370.       End
  371.       Begin Menu MenuHelpWhere 
  372.          Caption         =   "&Included VBX Properties"
  373.       End
  374.       Begin Menu MenuHelpLine 
  375.          Caption         =   "-"
  376.       End
  377.       Begin Menu MenuHelpAbout 
  378.          Caption         =   "&About VBXDemo..."
  379.       End
  380.    End
  381. ' Crystal.Vbx doesn't have an Align Property so The ToolBar
  382. ' is used as a container.
  383. ' The following Default Properties of Crystal.Vbx have been
  384. ' changed to:-
  385. '       WindowBorderStyle = 0 - None
  386. '       WindowControlBox = False
  387. '       WindowMaxButton = False
  388. '       WindowMinButton = False
  389. '       WindowLeft = 0      'so that the MoveWindow Function
  390. '       WindowTop = 0       'doesn't jerk the Crystal Window
  391. '                           'across the MDIChild Window.
  392. '--------------------------------------------------------------------
  393.  Dim DLLName As String * 20
  394. Sub Command1_Click ()
  395. End Sub
  396. Sub Command2_Click ()
  397. End Sub
  398. Sub Command3_Click ()
  399. End Sub
  400. Sub Command3D13_Click ()
  401. End Sub
  402. Sub Command3D14_Click ()
  403. End Sub
  404. Sub Command3D15_Click ()
  405. End Sub
  406. Sub Command3D16_Click ()
  407. End Sub
  408. Sub Command3D17_Click ()
  409.     If Forms.Count > 1 Then
  410.         Unload ActiveForm
  411.         If Forms.Count = 1 Then
  412.             MenuFileClose.Enabled = False
  413.         End If
  414.     End If
  415. End Sub
  416. Sub Command4_Click ()
  417. End Sub
  418. Sub Command5_Click ()
  419.     If Forms.Count > 1 Then
  420.         Unload ActiveForm
  421.         If Forms.Count = 1 Then
  422.             MenuFileClose.Enabled = False
  423.         End If
  424.     End If
  425. End Sub
  426. Sub Command6_Click ()
  427. End Sub
  428. Function exists (f As String) As Integer
  429. ' What follows is code for the exists function
  430. ' This function returns True if a given file exists, False otherwise
  431.   Dim n As Integer
  432.   On Error GoTo handler
  433.   n = FreeFile
  434.   ' Try to open file for input.  If successful, file exists
  435.   Open f For Input As #n
  436.   Close #n
  437.   exists = True
  438.   Exit Function
  439. handler:
  440.   ' If we get here the file does not exist
  441.   exists = False
  442.   Exit Function
  443. End Function
  444. Sub ExportButton_Click ()
  445. 'Check to see if Resources are high enough to open the print engine
  446. 'Never let the user drop below 20% resources. If they do they ask them
  447. 'to exit the application, close other applications down, and try running
  448. 'CRPEDemo again
  449.     FreeRes = FreeResourcesAreAbove(20)
  450.     If FreeRes = False Then
  451.       MsgBox "Your System Resources are below 20% Free, the engine cannot be opened! Please exit CRPEDemo, close some of your other Windows applications and try again."
  452.       Exit Sub
  453.     End If
  454. 'Show export form
  455.     Export.Show 1
  456. End Sub
  457. Sub FormatButton_Click ()
  458.   'Section.Show 1
  459. End Sub
  460. Sub FormulaButton_Click ()
  461. SetFormula.Show 1
  462. End Sub
  463. Sub Graphbutton_Click ()
  464.  Graph.Show 1
  465. End Sub
  466. Sub GroupCondButton_Click ()
  467.  'GroupCond.Show 1
  468. End Sub
  469. Sub HelpButton_Click ()
  470.   RCode = Shell("Winhelp c:\crw\crw.hlp", 3)
  471. End Sub
  472. Sub MDIForm_Load ()
  473.  ' Set timer for 1 second, and enable it.
  474.        Timer1.Interval = 1000
  475.        Timer1.Enabled = True
  476. End Sub
  477. Sub MDIForm_Resize ()
  478.     Line1.X2 = Me.ScaleWidth
  479.     Line2.X2 = Me.ScaleWidth
  480. End Sub
  481. Sub MenuDBLocation_Click ()
  482.  Tablem.Show 1
  483. End Sub
  484. Sub MenuEditCopy_Click ()
  485.   MsgBox "Not Yet Implemented!"
  486. End Sub
  487. Sub MenuEditCut_Click ()
  488.  MsgBox "Not Yet Implemented!"
  489. End Sub
  490. Sub MenuEditPaste_Click ()
  491.    MsgBox "Not Yet Implemented!"
  492. End Sub
  493. Sub MenuEditUndo_Click ()
  494.  MsgBox "Not Yet Implemented!"
  495. End Sub
  496. Sub MenuEngineClose_Click ()
  497. End Sub
  498. Sub MenuEngineCloseJob_Click ()
  499. End Sub
  500. Sub MenuEngineOpen_Click ()
  501. End Sub
  502. Sub MenuEngineOpenJob_Click ()
  503. End Sub
  504. Sub MenuFieldsGroupSortFields_Click ()
  505.  Sort.Show 1
  506. End Sub
  507. Sub MenuFieldsRecordSortField_Click ()
  508.  Sort.Show 1
  509. End Sub
  510. Sub MenuFileClose_Click ()
  511.     If Forms.Count > 2 Then
  512.         Unload ActiveForm
  513.         If Forms.Count = 1 Then
  514.             MenuFileClose.Enabled = False
  515.         End If
  516.     End If
  517. End Sub
  518. Sub MenuFileExit_Click ()
  519.     End
  520. End Sub
  521. Sub MenuFileExport_Click ()
  522. 'Check to see if Resources are high enough to open the print engine
  523. 'Never let the user drop below 20% resources. If they do they ask them
  524. 'to exit the application, close other applications down, and try running
  525. 'CRPEDemo again
  526.     FreeRes = FreeResourcesAreAbove(20)
  527.     If FreeRes = False Then
  528.       MsgBox "Your System Resources are below 20% Free, the engine cannot be opened! Please exit CRPEDemo, close some of your other Windows applications and try again."
  529.       Exit Sub
  530.     End If
  531. 'Show export form
  532.     Export.Show 1
  533. End Sub
  534. Sub MenuFileNew_Click ()
  535. Dim C As New Child
  536. 'Invoke common dialogue to choose a report file name
  537.     On Error GoTo ErrrHandler
  538.     CmDialog1.CancelError = True
  539.     CmDialog1.Flags = OFN_HIDEREADONLY
  540.     CmDialog1.DialogTitle = "Open Report"
  541.     CmDialog1.Filter = "Crystal Reports (*.rpt)"
  542.     CmDialog1.Filename = "*.rpt"
  543.     CmDialog1.Action = 1
  544. 'Specify a Report Filename
  545.     If CmDialog1.Filename <> "" Then
  546.        Report1.ReportFileName = CmDialog1.Filename
  547.     End If
  548.     Screen.MousePointer = 11
  549.     C.Caption = "MDIChild - " & Forms.Count
  550.     Report1.WindowParentHandle = C.hWnd
  551.     Report1.Destination = 0
  552.     Result% = Report1.PrintReport
  553.     If Result% <> 0 Then
  554.       MsgBox Report1.LastErrorNumber & ": " & Report1.LastErrorString
  555.     Else
  556.       MenuFileClose.Enabled = True
  557.       Screen.MousePointer = 0
  558.       Exit Sub
  559.     End If
  560. ErrrHandler:
  561.     Exit Sub
  562. End Sub
  563. Sub MenuFileOpenReport_Click ()
  564. Dim C As New Child
  565. 'Invoke common dialogue to choose a report file name
  566.     On Error GoTo ErrorHandler1
  567.     CmDialog1.CancelError = True
  568.     CmDialog1.Flags = OFN_HIDEREADONLY
  569.     CmDialog1.DialogTitle = "Open Report"
  570.     CmDialog1.Filter = "Crystal Reports (*.rpt)"
  571.     CmDialog1.Filename = "*.rpt"
  572.     CmDialog1.Action = 1
  573. 'Specify a Report Filename
  574.     If CmDialog1.Filename <> "" Then
  575.        Main.Report1.ReportFileName = CmDialog1.Filename
  576.        Main!StatusBar.Caption = "Report Opened."
  577.             
  578.             MenuFilePrint.Enabled = True
  579.             MenuFilePrinter.Enabled = True
  580.             MenuFileWindow.Enabled = True
  581.             
  582.             MenuFileExport.Enabled = True
  583.             MenuFormatRPTTitle.Enabled = True
  584.             
  585.             
  586.             MenuFormatGraph.Enabled = True
  587.             MenuFieldsRecordSortField.Enabled = True
  588.             MenuFieldsGroupSortFields.Enabled = True
  589.             MenuFormulasSetFormula.Enabled = True
  590.             MenuFormulasSetSelForm.Enabled = True
  591.             MenuFormulasGroupSel.Enabled = True
  592.             MenuDBLocation.Enabled = True
  593.             MenuLogonInfo.Enabled = True
  594.             MenuSecurity.Enabled = True
  595.             MenuWindowCascade.Enabled = True
  596.             MenuWindowTileH.Enabled = True
  597.             MenuWindowTileV.Enabled = True
  598.             MenuWindowArrange.Enabled = True
  599.             PreviewButton.Enabled = True
  600.             PrintButton.Enabled = True
  601.             SelectionButton.Enabled = True
  602.             SortButton.Enabled = True
  603.             
  604.             HelpButton.Enabled = True
  605.             GraphButton.Enabled = True
  606.             FormulaButton.Enabled = True
  607.             
  608.             ExportButton.Enabled = True
  609.             SQLButton.Enabled = True
  610.     End If
  611.     Exit Sub
  612. ErrorHandler1:
  613.  Exit Sub
  614. End Sub
  615. Sub MenuFilePrinter_Click ()
  616. 'Check to see if Resources are high enough to open the print engine
  617. 'Never let the user drop below 20% resources. If they do they ask them
  618. 'to exit the application, close other applications down, and try running
  619. 'CRPEDemo again
  620.     FreeRes = FreeResourcesAreAbove(20)
  621.     If FreeRes = False Then
  622.       MsgBox "Your System Resources are below 20% Free, the engine cannot be opened! Please exit CRPEDemo, close some of your other Windows applications and try again."
  623.       Exit Sub
  624.     End If
  625. PrintFrm.Show 1
  626. End Sub
  627. Sub MenuFileWindow_Click ()
  628. 'Check to see if Resources are high enough to open the print engine
  629. 'Never let the user drop below 20% resources. If they do they ask them
  630. 'to exit the application, close other applications down, and try running
  631. 'CRPEDemo again
  632.     FreeRes = FreeResourcesAreAbove(20)
  633.     If FreeRes = False Then
  634.       MsgBox "Your System Resources are below 20% Free, the engine cannot be opened! Please exit CRPEDemo, close some of your other Windows applications and try again."
  635.       Exit Sub
  636.     End If
  637. WinFrm.Show 1
  638. End Sub
  639. Sub MenuFormatGraph_Click ()
  640.   Graph.Show 1
  641. End Sub
  642. Sub MenuFormatGroupCond_Click ()
  643.  'GroupCond.Show 1
  644. End Sub
  645. Sub MenuFormatMinSectionHeight_Click ()
  646.  MsgBox "Not Yet Implemented!"
  647. End Sub
  648. Sub MenuFormatRptTitle_Click ()
  649.   RPTTITLE.Show 1
  650. End Sub
  651. Sub MenuFormatSection_Click ()
  652.   'Section.Show 1
  653. End Sub
  654. Sub MenuFormatSetLineHeight_Click ()
  655.  MsgBox "Not Yet Implemented!"
  656. End Sub
  657. Sub MenuFormatSetMargins_Click ()
  658.  MsgBox "Not Yet Implemented!"
  659. End Sub
  660. Sub MenuFormatSetSecFormat_Click ()
  661.  'Section.Show
  662. End Sub
  663. Sub MenuFormatSetSectionFont_Click ()
  664. 'Invoke common dialogue to choose a report file name
  665.     'CMDialog1.Action = 4
  666.      'Font.Show
  667. End Sub
  668. Sub MenuFormulaGroupSel_Click ()
  669.  SetFormula.Show
  670. End Sub
  671. Sub MenuFormulasGroupSel_Click ()
  672.    SetFormula.Show 1
  673. End Sub
  674. Sub MenuFormulasSetFormula_Click ()
  675.  SetFormula.Show 1
  676. End Sub
  677. Sub MenuFormulasSetSelForm_Click ()
  678.   SetFormula.Show 1
  679. End Sub
  680. Sub MenuGroupCond_Click ()
  681.  'GroupCond.Show
  682. End Sub
  683. Sub MenuHelpAbout_Click ()
  684.  About.Show 1
  685. End Sub
  686. Sub MenuHelpCRWHLP_Click ()
  687.  RCode = Shell("Winhelp c:\crw\crw.hlp", 3)
  688. End Sub
  689. Sub MenuHelpWhere_Click ()
  690. 'Declarations
  691.     Dim Response As Integer
  692.     Dim RCode As Integer
  693. 'Allow user to open CRPEDEMO.TXT file if they choose.
  694. 'If the user chooses yes from the message box they will automatically
  695. 'be shelled to notepad with the appropriate text file opened
  696.     Response = MsgBox("A list of the VBX properties is included in the VBXDEMO.TXT. Would you like to view the text file now?", 4, "VBX Properties List")
  697.     If Response = 6 Then
  698.        'shell to notepad
  699.        CRPEDemoPath$ = "NOTEPAD.EXE " & app.Path & "\VBXdemo.txt"
  700.        RCode = Shell(CRPEDemoPath$, 3)
  701.        
  702.     Else
  703.       Exit Sub
  704.     End If
  705. End Sub
  706. Sub MenuLogoff_Click ()
  707. End Sub
  708. Sub MenuLogon_Click ()
  709. End Sub
  710. Sub MenuLogonInfo_Click ()
  711.  SETLOGON.Show 1
  712. End Sub
  713. Sub MenuModSQL_Click ()
  714.  SQLQuery.Show
  715. End Sub
  716. Sub MenuPrintFile_Click ()
  717. End Sub
  718. Sub MenuPrintWindow_Click ()
  719. End Sub
  720. Sub MenuSecurity_Click ()
  721.  Security.Show 1
  722. End Sub
  723. Sub MenuServerManagementLogoffServer_Click ()
  724. End Sub
  725. Sub MenuServerManagementLogonInfo_Click ()
  726.   SETLOGON.Show
  727. End Sub
  728. Sub MenuServerManagementLogonServer_Click ()
  729. End Sub
  730. Sub MenuServerManagementSQLQuery_Click ()
  731.  SQLQuery.Show
  732. End Sub
  733. Sub MenuSQLModify_Click ()
  734.    SQLQuery.Show 1
  735. End Sub
  736. Sub MenuSQLStoredProc_Click ()
  737.   storedproc.Show 1
  738. End Sub
  739. Sub MenuWindowArrange_Click ()
  740.     Me.Arrange ARRANGE_ICONS
  741. End Sub
  742. Sub MenuWindowCascade_Click ()
  743.     Me.Arrange CASCADE
  744. End Sub
  745. Sub MenuWindowTileH_Click ()
  746.     Me.Arrange TILE_HORIZONTAL
  747. End Sub
  748. Sub MenuWindowTileV_Click ()
  749.     Me.Arrange TILE_VERTICAL
  750. End Sub
  751. Sub OpenEngButton_Click ()
  752. End Sub
  753. Sub OpenJobbutton_Click ()
  754. 'Check to see if Resources are high enough to open the print job
  755. 'Never let the user drop below 20% resources. If they do they ask them
  756. 'to exit the application, close other applications down, and try running
  757. 'CRPEDemo again
  758.     FreeRes = FreeResourcesAreAbove(20)
  759.     If FreeRes = False Then
  760.       MsgBox "Your System Resources are below 20% Free, the job cannot be opened! Please exit CRPEDemo, close some of your other Windows applications and try again."
  761.       Exit Sub
  762.     End If
  763. 'Invoke common dialogue to choose a report file name
  764.     On Error GoTo ErrorHandlerb
  765.     CmDialog1.CancelError = True
  766.     CmDialog1.Flags = OFN_HIDEREADONLY
  767.     CmDialog1.DialogTitle = "Open Report"
  768.     CmDialog1.Filter = "Crystal Reports (*.rpt)"
  769.     CmDialog1.Filename = "*.rpt"
  770.     CmDialog1.Action = 1
  771. 'Specify a Report Filename
  772.     If CmDialog1.Filename <> "" Then
  773.        Report1.ReportFileName = CmDialog1.Filename
  774.        Main!StatusBar.Caption = "Report Opened."
  775.             'Activate all menu items once job is opened
  776.             
  777.             MenuFilePrint.Enabled = True
  778.             MenuFilePrinter.Enabled = True
  779.             MenuFileWindow.Enabled = True
  780.             
  781.             MenuFileExport.Enabled = True
  782.             MenuFormatRPTTitle.Enabled = True
  783.             
  784.             
  785.             MenuFormatGraph.Enabled = True
  786.             MenuFieldsRecordSortField.Enabled = True
  787.             MenuFieldsGroupSortFields.Enabled = True
  788.             MenuFormulasSetFormula.Enabled = True
  789.             MenuFormulasSetSelForm.Enabled = True
  790.             MenuFormulasGroupSel.Enabled = True
  791.             MenuDBLocation.Enabled = True
  792.             MenuLogonInfo.Enabled = True
  793.             MenuSecurity.Enabled = True
  794.             MenuSQLModify.Enabled = True
  795.             MenuSQLStoredProc.Enabled = True
  796.             MenuWindowCascade.Enabled = True
  797.             MenuWindowTileH.Enabled = True
  798.             MenuWindowTileV.Enabled = True
  799.             MenuWindowArrange.Enabled = True
  800.             PreviewButton.Enabled = True
  801.             PrintButton.Enabled = True
  802.             SelectionButton.Enabled = True
  803.             SortButton.Enabled = True
  804.             
  805.             HelpButton.Enabled = True
  806.             GraphButton.Enabled = True
  807.             FormulaButton.Enabled = True
  808.             
  809.             ExportButton.Enabled = True
  810.             SQLButton.Enabled = True
  811.     Else
  812.         MsgBox "An error occured trying Open a Report."
  813.     End If
  814.         
  815.         Exit Sub
  816.        
  817.        
  818.        
  819. ErrorHandlerb:
  820.     Exit Sub
  821. End Sub
  822. Sub Preview_Click ()
  823. End Sub
  824. Sub Previewbutton_Click ()
  825. 'Check to see if Resources are high enough to open the print engine
  826. 'Never let the user drop below 20% resources. If they do they ask them
  827. 'to exit the application, close other applications down, and try running
  828. 'CRPEDemo again
  829.     FreeRes = FreeResourcesAreAbove(20)
  830.     If FreeRes = False Then
  831.       MsgBox "Your System Resources are below 20% Free, the engine cannot be opened! Please exit CRPEDemo, close some of your other Windows applications and try again."
  832.       Exit Sub
  833.     End If
  834. WinFrm.Show 1
  835. End Sub
  836. Sub PrintButton_Click ()
  837. 'Check to see if Resources are high enough to open the print engine
  838. 'Never let the user drop below 20% resources. If they do they ask them
  839. 'to exit the application, close other applications down, and try running
  840. 'CRPEDemo again
  841.     FreeRes = FreeResourcesAreAbove(20)
  842.     If FreeRes = False Then
  843.       MsgBox "Your System Resources are below 20% Free, the engine cannot be opened! Please exit CRPEDemo, close some of your other Windows applications and try again."
  844.       Exit Sub
  845.     End If
  846. PrintFrm.Show 1
  847. End Sub
  848. Sub SelectionButton_Click ()
  849. SetFormula.Show 1
  850. End Sub
  851. Sub SortButton_Click ()
  852.   Sort.Show 1
  853. End Sub
  854. Sub SQLButton_Click ()
  855.  SQLQuery.Show 1
  856. End Sub
  857. Sub Timer1_Timer ()
  858.        Dim curhWnd As Integer      'Current hWnd
  859.        Dim p As POINTAPI
  860.        Static LasthWnd As Integer  'Hold previous hWnd
  861.        ' Make sure the program has the input focus:
  862.        If GetActiveWindow() = Main.hWnd Then
  863.           ' Initialize point structure:
  864.           Call GetCursorPos(p)
  865.           ' Which window is the mouse cursor over?
  866.           curhWnd = WindowFromPoint(p.y, p.x)
  867.           ' Same as last window? If so, don't need to redraw:
  868.           If curhWnd <> LasthWnd Then
  869.              ' Store the current hWnd:
  870.              LasthWnd = curhWnd
  871.              ' Decrease timer interval to 5 ms (could choose 1 ms):
  872.              Timer1.Interval = 5
  873.              ' Which control is the cursor over?
  874.              Select Case curhWnd
  875.                 Case OpenJobButton.hWnd
  876.                    DisplayHelp "Open Print Job"
  877.                 Case PreviewButton.hWnd
  878.                    DisplayHelp "Print Preview"
  879.                 Case PrintButton.hWnd
  880.                    DisplayHelp "Print"
  881.                 Case ExportButton.hWnd
  882.                    DisplayHelp "Export"
  883.                 Case GraphButton.hWnd
  884.                    DisplayHelp "Format Graph"
  885.                 Case SortButton.hWnd
  886.                    DisplayHelp "Sort"
  887.                 Case FormulaButton.hWnd
  888.                    DisplayHelp "Formula"
  889.                 Case SelectionButton.hWnd
  890.                    DisplayHelp "Selection Formula"
  891.                 Case HelpButton.hWnd
  892.                    DisplayHelp "Crystal Reports Help"
  893.                 Case SQLButton.hWnd
  894.                    DisplayHelp "Modify SQL"
  895.                 'Case GetWindow(Combo1.hWnd, GW_CHILD) 'Edit box of combo box
  896.                  '  DisplayHelp "Edit Box of Combo Box"
  897.                ' Case hScroll1.hWnd
  898.                  '  DisplayHelp "hScroll Bar"
  899.               '  Case vScroll1.hWnd
  900.                   ' DisplayHelp "vScroll Bar"
  901.                 Case frmHelp.hWnd
  902.                    ' If it moves onto the help window, hide it:
  903.                    frmHelp.Hide
  904.                 Case Else
  905.                    ' Cursor is over the form or something else, so
  906.                    ' change interval back to 1 sec delay:
  907.                    DisplayHelp ""
  908.                    Timer1.Interval = 1000
  909.              End Select
  910.           End If
  911.        End If
  912. End Sub
  913. Sub ZoomButton_Click ()
  914. 'Check if job is open
  915. End Sub
  916.