home *** CD-ROM | disk | FTP | other *** search
/ PC Shareware 2000 January / PCShareware-1-00.iso / trials / Fc7 / ABC.Z / MENU.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-12-16  |  4.9 KB  |  155 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H80000005&
  5.    Caption         =   "Menus DEMO"
  6.    ClientHeight    =   2550
  7.    ClientLeft      =   795
  8.    ClientTop       =   1530
  9.    ClientWidth     =   3975
  10.    BeginProperty Font 
  11.       name            =   "MS Sans Serif"
  12.       charset         =   0
  13.       weight          =   700
  14.       size            =   8.25
  15.       underline       =   0   'False
  16.       italic          =   0   'False
  17.       strikethrough   =   0   'False
  18.    EndProperty
  19.    ForeColor       =   &H80000008&
  20.    Height          =   2955
  21.    Icon            =   "MENU.frx":0000
  22.    Left            =   735
  23.    LinkTopic       =   "Form1"
  24.    ScaleHeight     =   2550
  25.    ScaleWidth      =   3975
  26.    Top             =   1185
  27.    Width           =   4095
  28.    Begin VB.PictureBox Picture1 
  29.       Appearance      =   0  'Flat
  30.       BackColor       =   &H80000005&
  31.       BorderStyle     =   0  'None
  32.       ForeColor       =   &H80000008&
  33.       Height          =   495
  34.       Left            =   255
  35.       Picture         =   "MENU.frx":030A
  36.       ScaleHeight     =   495
  37.       ScaleWidth      =   495
  38.       TabIndex        =   3
  39.       Top             =   915
  40.       Width           =   495
  41.    End
  42.    Begin AbcflowLib.ABC ABC1 
  43.       Height          =   615
  44.       Left            =   0
  45.       TabIndex        =   4
  46.       Top             =   1440
  47.       Width           =   615
  48.       _version        =   65536
  49.       _extentx        =   1085
  50.       _extenty        =   1085
  51.       _stockprops     =   1
  52.    End
  53.    Begin VB.Label Label3 
  54.       Appearance      =   0  'Flat
  55.       BackColor       =   &H80000005&
  56.       Caption         =   "(c) Micrografx Inc., 1995. All Rights Reserved."
  57.       ForeColor       =   &H80000008&
  58.       Height          =   390
  59.       Left            =   885
  60.       TabIndex        =   0
  61.       Top             =   990
  62.       Width           =   3000
  63.    End
  64.    Begin VB.Label Label1 
  65.       Appearance      =   0  'Flat
  66.       BackColor       =   &H80000005&
  67.       Caption         =   "When this VB program is running, a new menu is added to ABC. The menu adds object counting functionality to ABC."
  68.       ForeColor       =   &H80000008&
  69.       Height          =   615
  70.       Left            =   240
  71.       TabIndex        =   2
  72.       Top             =   120
  73.       Width           =   3495
  74.    End
  75.    Begin VB.Label Label2 
  76.       Appearance      =   0  'Flat
  77.       BackColor       =   &H80000005&
  78.       Caption         =   "<---- Double-click on this custom OCX in VB 4.0 edit mode to see the event handling code."
  79.       ForeColor       =   &H80000008&
  80.       Height          =   855
  81.       Left            =   720
  82.       TabIndex        =   1
  83.       Top             =   1560
  84.       Visible         =   0   'False
  85.       Width           =   3015
  86.    End
  87. Attribute VB_Name = "Form1"
  88. Attribute VB_Creatable = False
  89. Attribute VB_Exposed = False
  90. Dim ABC As Object
  91. Const SHAPECOUNT = "Shape Count..."
  92. Const LINECOUNT = "Line Count..."
  93. Private Sub ABC1_AppMenuSUBCLASS(ByVal MenuItem As Object, Override As Boolean)
  94.     ABC.HourGlass = True
  95.     If MenuItem = SHAPECOUNT Then
  96.         CountShapes
  97.     ElseIf ABC1.MenuItem = LINECOUNT Then
  98.         CountLines
  99.     End If
  100.     ABC.HourGlass = False
  101. End Sub
  102. Private Sub ABC1_AppQuitNOTIFY()
  103.     End
  104. End Sub
  105. Private Sub CountLines()
  106.     Dim Objects As Object, Obj As Object
  107.     Lines = 0
  108.     Set Objects = ABC.ActiveChart.Objects
  109.     Do
  110.         Set Obj = Objects.ItemFromAll
  111.         If Obj.Valid And Obj.Type = 1 Then
  112.             Lines = Lines + 1
  113.         End If
  114.     Loop While Obj.Valid
  115.     If Lines = 0 Then
  116.         Message = "There are no lines in this chart."
  117.     ElseIf Lines = 1 Then
  118.         Message = "There is one line in this chart."
  119.     Else
  120.         Message = "There are " & Lines & " lines in this chart."
  121.     End If
  122.     ABC.MsgBox Message
  123. End Sub
  124. Private Sub CountShapes()
  125.     Dim Objects As Object, Obj As Object
  126.     Shapes = 0
  127.     Set Objects = ABC.ActiveChart.Objects
  128.     Do
  129.         Set Obj = Objects.ItemFromAll
  130.         If Obj.Valid And Obj.Type = 0 Then
  131.             Shapes = Shapes + 1
  132.         End If
  133.     Loop While Obj.Valid
  134.     If Shapes = 0 Then
  135.         Message = "There are no shapes in this chart."
  136.     ElseIf Shapes = 1 Then
  137.         Message = "There is one shape in this chart."
  138.     Else
  139.         Message = "There are " & Shapes & " shapes in this chart."
  140.     End If
  141.     ABC.MsgBox Message
  142. End Sub
  143. Private Sub Form_Load()
  144.     Dim Menu As Object
  145.     Set ABC = CreateObject("ABCFlow.application")
  146.     ABC.Visible = True
  147.     ' Get the ABC Quit event so the Menu
  148.     ' sample can unload when ABC Quits
  149.     ABC.RegisterEvent ABC1, Form1.Caption, "AppQuitNOTIFY"
  150.     Set Menu = ABC.AddMenu("Stats", ABC1, Form1.Caption)
  151.     Menu.AppendItem SHAPECOUNT
  152.     Menu.AppendItem LINECOUNT
  153.     Form1.WindowState = 1   ' Minimize Menu Sample Form
  154. End Sub
  155.