📄 frmselectactiontype.frm
字号:
VERSION 5.00
Begin VB.Form frmSelectActionType
BorderStyle = 3 'Fixed Dialog
Caption = "Create New Action"
ClientHeight = 1920
ClientLeft = 48
ClientTop = 336
ClientWidth = 4344
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1920
ScaleWidth = 4344
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton btnCancel
Caption = "&Cancel"
Height = 375
Left = 2280
TabIndex = 3
Top = 1440
Width = 855
End
Begin VB.CommandButton btnCreate
Caption = "C&reate"
Default = -1 'True
Height = 375
Left = 3360
TabIndex = 2
Top = 1440
Width = 855
End
Begin VB.ListBox lstActionTypes
Appearance = 0 'Flat
Height = 792
Left = 120
TabIndex = 0
Top = 480
Width = 4095
End
Begin VB.Label Label1
Caption = "Select an action type"
Height = 255
Left = 120
TabIndex = 1
Top = 120
Width = 3135
End
End
Attribute VB_Name = "frmSelectActionType"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' DataMonkey Data Conversion Application. Written by Theodore L. Ward
' Copyright (C) 2002 AstroComma Incorporated.
'
' This program is free software; you can redistribute it and/or
' modify it under the terms of the GNU General Public License
' as published by the Free Software Foundation; either version 2
' of the License, or (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
' The author may be contacted at:
' TheodoreWard@Hotmail.com or TheodoreWard@Yahoo.com
Option Explicit
Private mActions As CActions
Private mParentName As String
Private mImport As CImport
Private Sub btnCancel_Click()
GFormReturnValue = vbCancel
Unload Me
End Sub
Private Sub btnCreate_Click()
CreateCommand
End Sub
Private Sub CreateCommand()
Dim act As Object
Dim i As Integer
If lstActionTypes.ListIndex < 0 Then
LogError "frmSelectActionType", "btnCreate", "You must select an item to create.", False
Exit Sub
End If
' Create a new item.
Set act = mActions.AddNew(Me.lstActionTypes.ItemData(lstActionTypes.ListIndex))
If act Is Nothing Then Exit Sub
act.index = mActions.Count
' Tell the item to ask the user to configure it.
i = act.EditProperties(mParentName, mImport)
If i = vbOK Then
GFormReturnValue = i
' Make sure the actions are sorted correctly.
mActions.Reorder
Unload Me
Else
' Remove the item we just added.
mActions.Remove mActions.Count
End If
End Sub
Public Sub Initialize(AppliesTo As eCmdApplications, _
NameOfParent As String, ByRef acts As CActions, _
Optional Import As CImport = Nothing)
Dim i As Integer
' If no import object was given, use the global instance.
If Import Is Nothing Then
Set mImport = GImport
Else
Set mImport = Import
End If
Set mActions = acts
mParentName = NameOfParent
'******************************
' Fill in the list of commands.
'******************************
For i = 1 To GCmdHelper.GetNumCommands
If GCmdHelper.CMDGetApplications(i) And AppliesTo Then
With lstActionTypes
' Add the description to the listbox
.AddItem GCmdHelper.GetDescription(i)
' Store the cmdtype as the itemdata
.ItemData(.ListCount - 1) = i
End With
End If
Next i
' Set the caption to be descriptive.
frmSelectActionType.Caption = "Create new action for " + mParentName
End Sub
Private Sub Form_Load()
GFormReturnValue = vbCancel
Me.left = Screen.Width / 2 - Me.Width / 2
Me.top = Screen.Height / 2 - Me.Height / 2
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set mImport = Nothing
End Sub
Private Sub lstActionTypes_DblClick()
CreateCommand
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -