home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 September / Chip_2002-09_cd1.bin / zkuste / vbasic / Data / Utils / XZipComp.exe / XceedEncryption.Cab / F112953_Option.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-06-27  |  5.3 KB  |  157 lines

  1. VERSION 5.00
  2. Begin VB.Form frmOption 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Options"
  5.    ClientHeight    =   1395
  6.    ClientLeft      =   0
  7.    ClientTop       =   285
  8.    ClientWidth     =   5445
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   1395
  13.    ScaleWidth      =   5445
  14.    ShowInTaskbar   =   0   'False
  15.    StartUpPosition =   1  'CenterOwner
  16.    Begin VB.ComboBox cboHashSize 
  17.       Height          =   315
  18.       Left            =   1725
  19.       Style           =   2  'Dropdown List
  20.       TabIndex        =   1
  21.       Top             =   525
  22.       Width           =   3615
  23.    End
  24.    Begin VB.ComboBox cboHashingMethod 
  25.       Height          =   315
  26.       Left            =   1725
  27.       Style           =   2  'Dropdown List
  28.       TabIndex        =   0
  29.       Top             =   150
  30.       Width           =   3615
  31.    End
  32.    Begin VB.CommandButton cmdCancel 
  33.       Cancel          =   -1  'True
  34.       Caption         =   "Cancel"
  35.       Height          =   315
  36.       Left            =   4200
  37.       TabIndex        =   3
  38.       Top             =   975
  39.       Width           =   1140
  40.    End
  41.    Begin VB.CommandButton cmdOk 
  42.       Caption         =   "Ok"
  43.       Default         =   -1  'True
  44.       Height          =   315
  45.       Left            =   3000
  46.       TabIndex        =   2
  47.       Top             =   975
  48.       Width           =   1140
  49.    End
  50.    Begin VB.Label lbl 
  51.       Caption         =   "Hash size"
  52.       Height          =   240
  53.       Index           =   3
  54.       Left            =   150
  55.       TabIndex        =   5
  56.       Top             =   525
  57.       Width           =   1515
  58.    End
  59.    Begin VB.Label lbl 
  60.       Caption         =   "Hashing method"
  61.       Height          =   240
  62.       Index           =   4
  63.       Left            =   150
  64.       TabIndex        =   4
  65.       Top             =   150
  66.       Width           =   1515
  67.    End
  68. Attribute VB_Name = "frmOption"
  69. Attribute VB_GlobalNameSpace = False
  70. Attribute VB_Creatable = False
  71. Attribute VB_PredeclaredId = True
  72. Attribute VB_Exposed = False
  73. ' Xceed Encryption Library - Hasher sample
  74. ' Copyright (c) 2001 Xceed Software Inc.
  75. ' [Option.frm]
  76. ' This form module displays available Signing options.
  77. ' This file is part of the Xceed Encryption Library sample applications.
  78. ' The source code in this file is only intended as a supplement to Xceed
  79. ' Encryption Library's documentation, and is provided "as is", without
  80. ' warranty of any kind, either expressed or implied.
  81. Option Explicit
  82. Private m_bOk As Boolean
  83. Public Function ShowForm(ByRef eHashingMethod As enuHashingMethod, _
  84.                          ByRef nHashSize As Integer) As Boolean
  85.     Dim I As Long
  86.     'Fill the Hashing Method combo box
  87.     With cboHashingMethod
  88.         Call .AddItem("SHA", ehmSHA)
  89.         Call .AddItem("Haval", ehmHaval)
  90.         .ListIndex = eHashingMethod
  91.     End With
  92.     DoEvents    'Let the cboHashingMethod_click be handled
  93.     For I = 0 To cboHashSize.ListCount
  94.         If cboHashSize.ItemData(I) = nHashSize Then
  95.             cboHashSize.ListIndex = I
  96.             Exit For
  97.         End If
  98.     Next I
  99.     Call Me.Show(vbModal)
  100.     If m_bOk Then
  101.         'The user clicked OK : return the chosen values
  102.         eHashingMethod = cboHashingMethod.ListIndex
  103.         nHashSize = cboHashSize.ItemData(cboHashSize.ListIndex)
  104.     End If
  105.     ShowForm = m_bOk
  106.     Call Unload(Me)
  107. End Function
  108. Private Sub cboHashingMethod_Click()
  109.     With cboHashSize
  110.         Call .Clear
  111.         Select Case cboHashingMethod.ListIndex
  112.             Case ehmHaval
  113.                 Call .AddItem("128")
  114.                 .ItemData(.ListCount - 1) = 128
  115.                 Call .AddItem("160")
  116.                 .ItemData(.ListCount - 1) = 160
  117.                 Call .AddItem("192")
  118.                 .ItemData(.ListCount - 1) = 192
  119.                 Call .AddItem("224")
  120.                 .ItemData(.ListCount - 1) = 224
  121.                 Call .AddItem("256")
  122.                 .ItemData(.ListCount - 1) = 256
  123.             Case ehmSHA
  124.                 Call .AddItem("160")
  125.                 .ItemData(.ListCount - 1) = 160
  126.                 Call .AddItem("256")
  127.                 .ItemData(.ListCount - 1) = 256
  128.                 Call .AddItem("384")
  129.                 .ItemData(.ListCount - 1) = 384
  130.                 Call .AddItem("512")
  131.                 .ItemData(.ListCount - 1) = 512
  132.         End Select
  133.         .ListIndex = 0
  134.     End With
  135. End Sub
  136. Private Sub cmdCancel_Click()
  137.     Call Me.Hide
  138. End Sub
  139. Private Sub cmdOk_Click()
  140.     m_bOk = True
  141.     Call SaveHashingSetting
  142.     Call Me.Hide
  143. End Sub
  144. Private Sub Form_Load()
  145.     m_bOk = False
  146. End Sub
  147. Private Sub Form_Unload(Cancel As Integer)
  148.     Call cmdCancel_Click
  149. End Sub
  150. '------------------------------------------------------------------------------------
  151. 'Save the current private key file name
  152. '------------------------------------------------------------------------------------
  153. Private Sub SaveHashingSetting()
  154.     Call SaveSetting("XceedHasher", "Hashing", "HashingMethod", cboHashingMethod.ListIndex)
  155.     Call SaveSetting("XceedHasher", "Hashing", "HashSize", cboHashSize.ItemData(cboHashSize.ListIndex))
  156. End Sub
  157.