home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 53 / IOPROG_53.ISO / soft / c++ / xceedbkp.exe / Samples / Vb6 / frmRollback.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-09-02  |  4.1 KB  |  113 lines

  1. VERSION 5.00
  2. Begin VB.Form frmRollback 
  3.    Caption         =   "Rollback text"
  4.    ClientHeight    =   4125
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   4260
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   4125
  10.    ScaleWidth      =   4260
  11.    StartUpPosition =   2  'CenterScreen
  12.    Begin VB.CommandButton cmdCancel 
  13.       Caption         =   "Cancel"
  14.       Height          =   375
  15.       Left            =   2880
  16.       TabIndex        =   4
  17.       Top             =   3600
  18.       Width           =   1215
  19.    End
  20.    Begin VB.CommandButton cmdRestore 
  21.       Caption         =   "Restore"
  22.       Height          =   375
  23.       Left            =   1560
  24.       TabIndex        =   3
  25.       Top             =   3600
  26.       Width           =   1215
  27.    End
  28.    Begin VB.CheckBox chkLatest 
  29.       Caption         =   "Restore the latest available text"
  30.       Height          =   255
  31.       Left            =   120
  32.       TabIndex        =   2
  33.       Top             =   3120
  34.       Width           =   2655
  35.    End
  36.    Begin VB.ListBox lstFiles 
  37.       Height          =   2205
  38.       Left            =   120
  39.       TabIndex        =   1
  40.       Top             =   840
  41.       Width           =   3975
  42.    End
  43.    Begin VB.Label Label1 
  44.       Caption         =   "Select the date and time of the text you want to rollback to from the available backups below:"
  45.       Height          =   495
  46.       Left            =   120
  47.       TabIndex        =   0
  48.       Top             =   120
  49.       Width           =   3975
  50.    End
  51. Attribute VB_Name = "frmRollback"
  52. Attribute VB_GlobalNameSpace = False
  53. Attribute VB_Creatable = False
  54. Attribute VB_PredeclaredId = True
  55. Attribute VB_Exposed = False
  56. Option Explicit
  57. Dim m_nModalResult As Integer
  58. Dim WithEvents m_xMain As XceedBackup
  59. Attribute m_xMain.VB_VarHelpID = -1
  60. Public Function ShowModal(xMain As XceedBackup, xFileSelection As FileSelection) As Integer
  61.     lstFiles.Clear
  62.     Set m_xMain = xMain
  63. '   Browse the catalogs to find out which version(s) of the text file
  64. '   are available to be restored. The 'xFileSelection' FileSelection
  65. '   control already contains the filename of the text file, so we
  66. '   pass it to the BrowseCatalogs method.
  67.     Call xMain.BrowseCatalogs(xFileSelection, "VB Sample")
  68. '   Update the Restore button's enabled state
  69.     Call UpdateRestoreState
  70. '   Now show the frmRollback form
  71.     Call Me.Show(vbModal)
  72.     If m_nModalResult = vbOK Then
  73.         If chkLatest.Value = vbChecked Then         ' To restore latest file, set date to 9999/12/31
  74.             xFileSelection.MaxDate = DateSerial(9999, 12, 31)
  75.         Else                                        ' Otherwise, set the date to the listbox's selected date
  76.             xFileSelection.MaxDate = CDate(lstFiles.Text)
  77.         End If
  78.     End If
  79.     Set m_xMain = Nothing
  80.     ShowModal = m_nModalResult
  81. End Function
  82. Public Sub UpdateRestoreState()
  83.     cmdRestore.Enabled = (chkLatest.Value = vbChecked) Or (lstFiles.ListIndex >= 0)
  84. End Sub
  85. Private Sub chkLatest_Click()
  86. '   Update the Restore button's enabled state
  87.     Call UpdateRestoreState
  88. End Sub
  89. Private Sub cmdCancel_Click()
  90.     m_nModalResult = vbCancel
  91.     Call Me.Hide
  92. End Sub
  93. Private Sub cmdRestore_Click()
  94.     m_nModalResult = vbOK
  95.     Call Me.Hide
  96. End Sub
  97. Private Sub lstFiles_Click()
  98. '   Update the Restore button's enabled state
  99.     Call UpdateRestoreState
  100. End Sub
  101. Private Sub lstFiles_DblClick()
  102. '   Update the Restore button's enabled state
  103.     Call UpdateRestoreState
  104.     If cmdRestore.Enabled Then
  105.         m_nModalResult = vbOK
  106.         Call Me.Hide
  107.     End If
  108. End Sub
  109. Private Sub m_xMain_BrowsingCatalogEntry(ByVal sFilename As String, ByVal lSize As Long, ByVal xAttributes As XceedBackupLibCtl.bkpFileAttributes, ByVal dtLastModified As Date, ByVal dtLastAccessed As Date, ByVal dtCreated As Date, ByVal lDiskNumber As Long, ByVal sMediaLabel As String)
  110. '   Add the browsed file to the list of available file version(s)
  111.     lstFiles.AddItem (CStr(dtLastModified))
  112. End Sub
  113.