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

📄 frmimportproperties.frm

📁 Data monkey是一个强大的是数据传输和转换应用程序。使用DataMonkey用户可以把复杂的文本文件格式
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmImportProperties 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Import Properties"
   ClientHeight    =   5352
   ClientLeft      =   2568
   ClientTop       =   1500
   ClientWidth     =   5448
   Icon            =   "frmImportProperties.frx":0000
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5352
   ScaleWidth      =   5448
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.ComboBox cboDefaultOutput 
      Height          =   315
      Left            =   2040
      Style           =   2  'Dropdown List
      TabIndex        =   25
      Top             =   2880
      Width           =   3255
   End
   Begin VB.CheckBox chkLogToFile 
      Caption         =   "Log errors to file"
      Height          =   195
      Left            =   120
      TabIndex        =   21
      Top             =   540
      Width           =   1455
   End
   Begin VB.TextBox txtLogFile 
      Height          =   285
      Left            =   1680
      TabIndex        =   20
      Top             =   540
      Width           =   3615
   End
   Begin VB.CheckBox chkOverwriteLogfile 
      Caption         =   "Overwrite existing logfile for each new import"
      Height          =   255
      Left            =   1680
      TabIndex        =   19
      Top             =   900
      Width           =   3495
   End
   Begin VB.TextBox txtName 
      Height          =   285
      Left            =   1680
      TabIndex        =   17
      Top             =   120
      Width           =   3615
   End
   Begin VB.Frame fraInputDataInfo 
      Caption         =   "ASCII File information"
      Height          =   1335
      Left            =   120
      TabIndex        =   11
      Top             =   3300
      Width           =   5175
      Begin VB.TextBox txtDelimiter 
         Height          =   285
         Left            =   4440
         TabIndex        =   16
         Text            =   ","
         Top             =   900
         Width           =   615
      End
      Begin VB.CheckBox chkIsDelimited 
         Caption         =   "Generally, data items are separated by this character(s):"
         Height          =   375
         Left            =   120
         TabIndex        =   15
         Top             =   900
         Value           =   1  'Checked
         Width           =   4215
      End
      Begin VB.Frame fraInputLayoutType 
         BorderStyle     =   0  'None
         Height          =   615
         Left            =   120
         TabIndex        =   12
         Top             =   300
         Width           =   3735
         Begin VB.OptionButton rbSingleLineFormat 
            Caption         =   "Each line contains the same kind of data"
            Height          =   195
            Left            =   0
            TabIndex        =   14
            Top             =   60
            Width           =   3255
         End
         Begin VB.OptionButton rbMultiLineFormat 
            Caption         =   "Each line may contain different kinds of data"
            Height          =   195
            Left            =   0
            TabIndex        =   13
            Top             =   300
            Width           =   3495
         End
      End
   End
   Begin VB.Frame fraInputSource 
      Caption         =   "Input Data Source"
      Height          =   1335
      Left            =   120
      TabIndex        =   9
      Top             =   1320
      Width           =   5175
      Begin VB.CommandButton btnInputObjProperties 
         Caption         =   "&Defaults..."
         Height          =   360
         Left            =   4050
         TabIndex        =   23
         Top             =   330
         Width           =   945
      End
      Begin VB.ComboBox cboInputDataSource 
         Height          =   315
         Left            =   120
         Style           =   2  'Dropdown List
         TabIndex        =   22
         Top             =   360
         Width           =   3855
      End
      Begin VB.ComboBox cboExternalInputDataSource 
         Enabled         =   0   'False
         Height          =   315
         Left            =   120
         TabIndex        =   10
         Top             =   840
         Width           =   3855
      End
   End
   Begin VB.PictureBox picOptions 
      BorderStyle     =   0  'None
      Height          =   3780
      Index           =   3
      Left            =   -20000
      ScaleHeight     =   3780
      ScaleWidth      =   5688
      TabIndex        =   5
      TabStop         =   0   'False
      Top             =   480
      Width           =   5685
      Begin VB.Frame fraSample4 
         Caption         =   "Sample 4"
         Height          =   1785
         Left            =   2100
         TabIndex        =   8
         Top             =   840
         Width           =   2055
      End
   End
   Begin VB.PictureBox picOptions 
      BorderStyle     =   0  'None
      Height          =   3780
      Index           =   2
      Left            =   -20000
      ScaleHeight     =   3780
      ScaleWidth      =   5688
      TabIndex        =   4
      TabStop         =   0   'False
      Top             =   480
      Width           =   5685
      Begin VB.Frame fraSample3 
         Caption         =   "Sample 3"
         Height          =   1785
         Left            =   1545
         TabIndex        =   7
         Top             =   675
         Width           =   2055
      End
   End
   Begin VB.PictureBox picOptions 
      BorderStyle     =   0  'None
      Height          =   3780
      Index           =   1
      Left            =   -20000
      ScaleHeight     =   3780
      ScaleWidth      =   5688
      TabIndex        =   3
      TabStop         =   0   'False
      Top             =   480
      Width           =   5685
      Begin VB.Frame fraSample2 
         Caption         =   "Sample 2"
         Height          =   1785
         Left            =   645
         TabIndex        =   6
         Top             =   300
         Width           =   2055
      End
   End
   Begin VB.CommandButton cmdApply 
      Caption         =   "Apply"
      Height          =   375
      Left            =   4440
      TabIndex        =   2
      Top             =   4800
      Width           =   855
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "Cancel"
      Height          =   375
      Left            =   3480
      TabIndex        =   1
      Top             =   4800
      Width           =   855
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "OK"
      Height          =   375
      Left            =   2520
      TabIndex        =   0
      Top             =   4815
      Width           =   855
   End
   Begin VB.Label Label2 
      Caption         =   "Default output selection"
      Height          =   255
      Left            =   120
      TabIndex        =   24
      Top             =   2880
      Width           =   1815
   End
   Begin VB.Label Label1 
      Caption         =   "Name of this Import:"
      Height          =   255
      Left            =   120
      TabIndex        =   18
      Top             =   120
      Width           =   1455
   End
End
Attribute VB_Name = "frmImportProperties"
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

Sub ApplyProperties()
    GImport.name = txtName
    GImport.Delimited = chkIsDelimited.value
    GImport.Delimiter = txtDelimiter
    GImport.SingleLineFormat = rbSingleLineFormat.value
    
    GImport.LogToFile = IIf(Me.chkLogToFile.value = 1, True, False)
    GImport.LogFilePath = Me.txtLogFile
    GImport.OverwriteLogfile = IIf(chkOverwriteLogfile.value = 1, True, False)
    
    GImport.InputSourceType = CLng(Me.cboInputDataSource.ListIndex)
    
    If GImport.InputSourceType <> ASCII Then
        GImport.Delimited = True
        GImport.Delimiter = ","
        GImport.SingleLineFormat = False
    End If
    
    GFormReturnValue = vbOK
    
    ' Reset the imports name in the tree.
    frmDocument.TreeView1.Nodes.item(GImport.GetID).Text = GImport.name
    
End Sub

Private Sub btnInputObjProperties_Click()
    GImport.GetInputObject.EditProperties
End Sub

Private Sub cboInputDataSource_Click()
    Dim index As Integer
    index = cboInputDataSource.ListIndex
    
    Me.fraInputDataInfo.Visible = False
    cboExternalInputDataSource.Enabled = False
    
    If index = eInputType.OTHER Then
        ' Enable the combo box to allow specification of
        ' a user defined input source.
        cboExternalInputDataSource.Enabled = True
    ElseIf index = eInputType.ASCII Then
        ' Show the ASCII input options if the input source is ASCII.
        Me.fraInputDataInfo.Visible = True
    End If
End Sub

Private Sub chkLogToFile_Click()
    Me.txtLogFile.Enabled = IIf(chkLogToFile.value = 1, True, False)
    Me.chkOverwriteLogfile.Enabled = IIf(chkLogToFile.value = 1, True, False)
End Sub

Private Sub cmdApply_Click()
    ApplyProperties
End Sub

Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdOK_Click()
    ApplyProperties
    GFormReturnValue = vbOK
    Unload Me
End Sub

Private Sub Form_Load()
    On Error GoTo eHandler
    
    GFormReturnValue = vbCancel
    
    'center the form
    Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2

    txtName = GImport.name
    chkIsDelimited.value = IIf(GImport.Delimited, 1, 0)
    txtDelimiter = GImport.Delimiter
    rbSingleLineFormat.value = GImport.SingleLineFormat
    rbMultiLineFormat.value = Not GImport.SingleLineFormat
    Me.txtLogFile = GImport.LogFilePath
    Me.chkOverwriteLogfile.value = IIf(GImport.OverwriteLogfile, 1, 0)
    Me.chkLogToFile.value = IIf(GImport.LogToFile, 1, 0)

    Dim i As Long
    For i = 0 To GInputID.GetNumInputTypes - 1
        Me.cboInputDataSource.AddItem GInputID.GetInputTypeDescription(i), i
    Next i
    
    Me.cboDefaultOutput.AddItem "<none>"
    For i = 1 To GImport.GetOutputLinksManager.Count
        Me.cboDefaultOutput.AddItem GImport.GetOutputLinksManager(i).name
    Next i
    Me.cboDefaultOutput.ListIndex = 0
    
    ' Select the correct input source.
    Me.cboInputDataSource.ListIndex = CInt(GImport.InputSourceType)
    
    ' Enable/disable certain items depending on set values.
    Call cboInputDataSource_Click
    Call chkLogToFile_Click
    
    Exit Sub
    
eHandler:
    MsgBox Error(Err)
End Sub

⌨️ 快捷键说明

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