⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 VC NCombox VC NCombox VC NCombox VC NCombox
💻 FRM
字号:
VERSION 5.00
Object = "{7B914A58-6271-11D2-86B8-0040055C08D9}#1.0#0"; "XPropertiesWnd.ocx"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   6540
   ClientLeft      =   7740
   ClientTop       =   2070
   ClientWidth     =   4920
   LinkTopic       =   "Form1"
   ScaleHeight     =   6540
   ScaleWidth      =   4920
   Begin XPROPERTIESWNDLib.XPropertiesWnd FunctionxProp 
      Height          =   2655
      Left            =   120
      TabIndex        =   3
      Top             =   3360
      Width           =   4695
      _Version        =   65536
      _ExtentX        =   8281
      _ExtentY        =   4683
      _StockProps     =   5
      BackColor       =   8421504
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      PagesAndItems   =   "InheritedClasses#{#}#"
      Animation       =   -1  'True
      BeginProperty ItemFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.CommandButton Open 
      Caption         =   "Open"
      Height          =   375
      Left            =   4200
      TabIndex        =   2
      Top             =   6120
      Width           =   615
   End
   Begin VB.TextBox FileName 
      Height          =   375
      Left            =   120
      TabIndex        =   1
      Text            =   "C:\_users\Mihai\Project\ActiveX\XFloorWnd\Version 1.02\Debug\XFloorWnd.ocx"
      Top             =   6120
      Width           =   3975
   End
   Begin XPROPERTIESWNDLib.XPropertiesWnd TypeLibxProp 
      Height          =   3135
      Left            =   120
      TabIndex        =   0
      TabStop         =   0   'False
      Top             =   120
      Width           =   4695
      _Version        =   65536
      _ExtentX        =   8281
      _ExtentY        =   5530
      _StockProps     =   5
      BackColor       =   8421504
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      AsFloor         =   0   'False
      BeginProperty ItemFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim a As New Lib2Me
Dim l() As LClass
Dim f(100, 100) As LFunction
Dim sKinds As Variant
Dim sInvokeKinds As Variant
Dim sClassKinds As Variant

Private Sub Form_Load()
    FunctionxProp.PagesAndItems = "Inherited#{#}#General#{#ID\Edit\Enable#Kind\Edit\Enable#InvokeKind\Edit\Enable#ParameterCount\Edit\Enable#ReturnType\Edit\Enable#}#Parameters#{#}#"
    TypeLibxProp.AsFloor = False
End Sub

Private Sub Open_Click()
    sKinds = Array("Virtual", "PureVirtual", "NonVirtual", "Static", "Dispatch")
    sInvokeKinds = Array("Method", "Get", "Put", "PutRef")
    sClassKinds = Array("Enum", "Record", "Module", "Interface", "Dispatch", "Coclass", "Alias", "Union", "Max")
    
    Dim li As LClass
    Dim fij As LFunction
    Dim iPage As Integer
    iPage = 0
    Dim s As String
    a.Load FileName
    Dim i As Integer
    i = 0
    TypeLibxProp.Visible = False
    Do
        Set li = a.Class(i)
        If Not (li Is Nothing) Then
            s = li.Name()
            iPage = TypeLibxProp.AddPage(s + " - " + sClassKinds(li.Kind()))
            Dim j As Integer
            Dim iProp As Integer
            j = 0
            Do
                Set fij = li.Function(j)
                If (Not (fij Is Nothing)) Then
                    iProp = TypeLibxProp.InsertProperty(iPage, -1, fij.Name(), "Edit", 2)
                    TypeLibxProp.SetDefaultValue iPage, iProp, fij.Documentation()
                    Set f(i, j) = fij
                    j = j + 1
                    End If
            Loop Until fij Is Nothing
            TypeLibxProp.InsertProperty iPage, -1, "-- Variables --", "Edit", 1
            Dim v As LVariable
            j = 0
            Set v = li.Variable(j)
            While Not (v Is Nothing)
                iProp = TypeLibxProp.InsertProperty(iPage, -1, v.Name(), "Edit", 2)
                TypeLibxProp.SetDefaultValue iPage, iProp, v.Type()
                j = j + 1
                Set v = li.Variable(j)
            Wend
            ReDim Preserve l(i)
            Set l(i) = li
            i = i + 1
        End If
    Loop Until li Is Nothing
    TypeLibxProp.Visible = True
End Sub

Private Sub TypeLibxProp_SelectItem(ByVal nIndexPage As Integer, ByVal nIndexItem As Integer)
    Dim fij As LFunction
    Set fij = f(nIndexPage, nIndexItem)
    If Not (fij Is Nothing) Then
        FunctionxProp.Visible = False
        FunctionxProp.SetDefaultValueByName "Kind", sKinds(fij.Kind())
        FunctionxProp.SetDefaultValueByName "InvokeKind", sInvokeKinds(Log(fij.InvokeKind() / Log(2)))
        FunctionxProp.SetDefaultValueByName "ParameterCount", fij.ParameterCount()
        FunctionxProp.SetDefaultValueByName "ID", fij.ID
        FunctionxProp.SetDefaultValueByName "ReturnType", fij.ReturnType()
        Dim iPage As Integer
        iPage = 2
        Do While FunctionxProp.DeleteProperty(iPage, 0)
        Loop
        Dim i As Integer
        Dim p As LParameter
        Dim iProp As Integer
        i = 0
        Do
            Set p = fij.Parameter(i)
            If Not (p Is Nothing) Then
                iProp = FunctionxProp.InsertProperty(iPage, -1, p.Name(), "Edit", 2)
                FunctionxProp.SetDefaultValue iPage, iProp, p.Type()
                i = i + 1
            End If
        Loop Until p Is Nothing
        FunctionxProp.Visible = True
    End If
End Sub

Private Sub TypeLibxProp_SelectPage(ByVal nIndex As Integer)
    Dim iPage As Integer
    iPage = 0
    If TypeLibxProp.Visible() Then
        Do While FunctionxProp.DeleteProperty(iPage, 0)
        Loop
        Dim i As Integer
        For i = 0 To l(nIndex).CountInheritedClass - 1
            FunctionxProp.InsertProperty iPage, -1, l(nIndex).InheritedClass(i).Name, "Edit", 0
        Next
    End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -