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

📄 presets.frm

📁 the attached file contains artifitial neural network code
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Presets 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Presets"
   ClientHeight    =   3555
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5175
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "Presets.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3555
   ScaleWidth      =   5175
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.PictureBox Title 
      BackColor       =   &H80000005&
      BorderStyle     =   0  'None
      Height          =   615
      Left            =   0
      ScaleHeight     =   615
      ScaleWidth      =   3495
      TabIndex        =   6
      TabStop         =   0   'False
      Top             =   0
      Width           =   3495
      Begin VB.Line TitleLine 
         BorderColor     =   &H00E0E0E0&
         Index           =   1
         X1              =   600
         X2              =   1560
         Y1              =   495
         Y2              =   495
      End
      Begin VB.Line TitleLine 
         BorderColor     =   &H80000015&
         Index           =   0
         X1              =   120
         X2              =   1080
         Y1              =   480
         Y2              =   480
      End
      Begin VB.Label Label 
         BackColor       =   &H80000005&
         Caption         =   "Load or manage the presets."
         ForeColor       =   &H80000008&
         Height          =   255
         Index           =   0
         Left            =   240
         TabIndex        =   7
         Top             =   180
         Width           =   3375
      End
   End
   Begin VB.CommandButton Command 
      Caption         =   "Rename"
      Enabled         =   0   'False
      Height          =   315
      Index           =   3
      Left            =   1800
      TabIndex        =   2
      Top             =   2640
      Width           =   1575
   End
   Begin VB.CommandButton Command 
      Caption         =   "Delete"
      Enabled         =   0   'False
      Height          =   315
      Index           =   4
      Left            =   3480
      TabIndex        =   3
      Top             =   2640
      Width           =   1575
   End
   Begin VB.CommandButton Command 
      Caption         =   "Add..."
      Height          =   315
      Index           =   2
      Left            =   120
      TabIndex        =   1
      Top             =   2640
      Width           =   1575
   End
   Begin VB.ListBox List 
      Height          =   1815
      Left            =   120
      Sorted          =   -1  'True
      TabIndex        =   0
      Top             =   720
      Width           =   4935
   End
   Begin VB.CommandButton Command 
      Cancel          =   -1  'True
      Caption         =   "Cancel"
      Height          =   375
      Index           =   1
      Left            =   3480
      TabIndex        =   5
      Top             =   3060
      Width           =   1575
   End
   Begin VB.CommandButton Command 
      Caption         =   "Load"
      Default         =   -1  'True
      Enabled         =   0   'False
      Height          =   375
      Index           =   0
      Left            =   120
      TabIndex        =   4
      Top             =   3060
      Width           =   1575
   End
End
Attribute VB_Name = "Presets"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Canceled As Boolean
Private LoadPreset As Integer

Private Sub Command_Click(Index As Integer)
    Select Case Index
    Case 0
        Canceled = False
        If List.ListIndex < 0 Then Exit Sub
        LoadPreset = List.ListIndex + 1
        Me.Hide
    Case 1
        Canceled = True
        Me.Hide
    Case 2
        Call Main.AddPreset(Me)
    Case 3
        If List.ListIndex < 0 Then Exit Sub
        Dim PresetNameOld As String, PresetNameNew As String
        PresetNameOld = PresetList(List.ListIndex + 1)
        Temp = InStrRev(PresetNameOld, "\")
        PresetNameOld = Mid(PresetNameOld, Temp + 1)
        Temp = InStrRev(PresetNameOld, ".")
        PresetNameOld = Mid(PresetNameOld, 1, Temp - 1)
        Call PresetName.Prepare(PresetNameOld)
        PresetName.Show 1, Me
        If PresetName.Extract(PresetNameNew) Then
            Name PresetPath & "\" & PresetNameOld & ".ini" As PresetPath & "\" & PresetNameNew & ".ini"
            Call writeINI(PresetPath & "\" & PresetNameNew & ".ini", "preset", "title", PresetNameNew)
            Call Main.RemovePreset(List.ListIndex + 1)
            Call Main.InitializePreset(PresetPath & "\" & PresetNameNew & ".ini")
        End If
        Call Main.UpdateToolbarPresets
        Call Prepare
    Case 4
        If List.ListIndex < 0 Then Exit Sub
        If MsgBox("Are you sure you would like to delete the preset """ & PresetTitleList(List.ListIndex + 1) & """?", vbQuestion + vbYesNo) = vbYes Then
            Call Kill(PresetList(List.ListIndex + 1))
            Call Main.RemovePreset(List.ListIndex + 1)
        End If
        Call Main.UpdateToolbarPresets
        Call Prepare
    End Select
End Sub

Private Sub Scroll_Change()
    ScrollInner.Top = -Scroll.Value
End Sub

Private Sub Scroll_Scroll()
    Call Scroll_Change
End Sub

Public Sub Prepare()
    List.Clear
    For X = 1 To PresetList.Count
        List.AddItem PresetTitleList(X), X - 1
    Next X
End Sub

Public Function Extract(ByRef PresetIndex As Integer) As Boolean
    If Canceled Then
        PresetIndex = -1
    Else
        PresetIndex = LoadPreset
    End If
    Unload Me
    Extract = Not Canceled
End Function

Private Sub Form_Load()
    Canceled = True
End Sub

Private Sub Form_Resize()
    Title.Width = Me.ScaleWidth
    TitleLine(0).X1 = 0
    TitleLine(0).X2 = Me.ScaleWidth
    TitleLine(0).Y1 = Title.Height - 30
    TitleLine(0).Y2 = Title.Height - 30
    TitleLine(1).X1 = 0
    TitleLine(1).X2 = Me.ScaleWidth
    TitleLine(1).Y1 = Title.Height - 15
    TitleLine(1).Y2 = Title.Height - 15
End Sub

Private Sub List_Click()
    Command(0).Enabled = (List.ListIndex > -1)
    Command(3).Enabled = (List.ListIndex > -1)
    Command(4).Enabled = (List.ListIndex > -1)
End Sub

Private Sub List_DblClick()
    Call Command_Click(0)
End Sub

⌨️ 快捷键说明

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