home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 35 / hot35.iso / ficheros / LVB / T2W32543.ZIP / _CMBLSB.FRM < prev    next >
Text File  |  1998-05-21  |  9KB  |  345 lines

  1. VERSION 5.00
  2. Begin VB.Form frmComboList 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Combo - List"
  5.    ClientHeight    =   5190
  6.    ClientLeft      =   1110
  7.    ClientTop       =   1365
  8.    ClientWidth     =   7830
  9.    MaxButton       =   0   'False
  10.    MDIChild        =   -1  'True
  11.    PaletteMode     =   1  'UseZOrder
  12.    ScaleHeight     =   5190
  13.    ScaleWidth      =   7830
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.PictureBox Picture1 
  16.       Align           =   2  'Align Bottom
  17.       BorderStyle     =   0  'None
  18.       Height          =   465
  19.       Left            =   0
  20.       ScaleHeight     =   465
  21.       ScaleWidth      =   7830
  22.       TabIndex        =   6
  23.       Top             =   4725
  24.       Width           =   7830
  25.       Begin VB.CommandButton Command2 
  26.          Caption         =   "&Reset"
  27.          Height          =   285
  28.          Left            =   6840
  29.          TabIndex        =   12
  30.          Top             =   105
  31.          Width           =   825
  32.       End
  33.       Begin VB.TextBox Text1 
  34.          Height          =   285
  35.          Left            =   2040
  36.          TabIndex        =   7
  37.          Tag             =   "A/BC/DEF/GHIJ/KLMNOP/"
  38.          Top             =   90
  39.          Width           =   4710
  40.       End
  41.       Begin VB.Label Label1 
  42.          Caption         =   "&Enter a dir/file to search"
  43.          Height          =   255
  44.          Left            =   90
  45.          TabIndex        =   8
  46.          Top             =   120
  47.          Width           =   1875
  48.       End
  49.    End
  50.    Begin VB.Frame Frame1 
  51.       Height          =   570
  52.       Left            =   0
  53.       TabIndex        =   3
  54.       Top             =   -90
  55.       Width           =   7830
  56.       Begin VB.CommandButton cmdNP 
  57.          Caption         =   ">"
  58.          Height          =   285
  59.          Index           =   1
  60.          Left            =   7470
  61.          TabIndex        =   11
  62.          Top             =   195
  63.          Width           =   285
  64.       End
  65.       Begin VB.CommandButton cmdNP 
  66.          Caption         =   "<"
  67.          Height          =   285
  68.          Index           =   0
  69.          Left            =   6570
  70.          TabIndex        =   10
  71.          Top             =   195
  72.          Width           =   285
  73.       End
  74.       Begin VB.CommandButton Command1 
  75.          Caption         =   "&Go"
  76.          Default         =   -1  'True
  77.          Height          =   285
  78.          Left            =   6930
  79.          TabIndex        =   9
  80.          Top             =   195
  81.          Width           =   465
  82.       End
  83.       Begin VB.ComboBox cmb_Function 
  84.          Height          =   315
  85.          Left            =   1365
  86.          TabIndex        =   4
  87.          Top             =   180
  88.          Width           =   5115
  89.       End
  90.       Begin VB.Label Label2 
  91.          Caption         =   "&Select a function"
  92.          Height          =   255
  93.          Left            =   90
  94.          TabIndex        =   5
  95.          Top             =   210
  96.          Width           =   1275
  97.       End
  98.    End
  99.    Begin VB.ListBox List1 
  100.       Height          =   1815
  101.       Left            =   120
  102.       TabIndex        =   2
  103.       Top             =   2760
  104.       Width           =   7575
  105.    End
  106.    Begin VB.ComboBox Combo1 
  107.       Height          =   315
  108.       Left            =   120
  109.       TabIndex        =   1
  110.       Top             =   2280
  111.       Width           =   7575
  112.    End
  113.    Begin VB.TextBox txt_Result 
  114.       BackColor       =   &H00C0C0C0&
  115.       BorderStyle     =   0  'None
  116.       Height          =   1485
  117.       Left            =   120
  118.       Locked          =   -1  'True
  119.       MultiLine       =   -1  'True
  120.       ScrollBars      =   2  'Vertical
  121.       TabIndex        =   0
  122.       Top             =   600
  123.       Width           =   7575
  124.    End
  125. End
  126. Attribute VB_Name = "frmComboList"
  127. Attribute VB_GlobalNameSpace = False
  128. Attribute VB_Creatable = False
  129. Attribute VB_PredeclaredId = True
  130. Attribute VB_Exposed = False
  131. Option Explicit
  132. Option Base 1
  133.  
  134. Private Const Iteration = 1
  135.  
  136. Dim IsLoaded         As Integer
  137.  
  138. Dim TimerStartOk     As Integer
  139. Dim TimerCloseOk     As Integer
  140.  
  141. Dim TimerHandle      As Integer
  142. Dim TimerValue       As Long
  143.  
  144. Private Sub cmdNP_Click(Index As Integer)
  145.  
  146.    Text1.Text = ""
  147.    
  148.    Call sub_NextPrev(cmb_Function, Index)
  149.  
  150. End Sub
  151.  
  152.  
  153. Private Sub cmb_Function_Click()
  154.    
  155.    If (IsLoaded = False) Then Exit Sub
  156.    
  157.    Call cDisableFI(mdiT2W.Picture1)
  158.    
  159.    txt_Result = ""
  160.    
  161.    DoEvents
  162.    
  163.    Combo1.Clear
  164.    List1.Clear
  165.    
  166.    Select Case cmb_Function.ListIndex
  167.       Case 0
  168.          Call TestComboListDir
  169.       Case 1
  170.          Call TestComboListFile
  171.       Case 2
  172.          Call TestComboListFileAttrib
  173.    End Select
  174.    
  175.    DoEvents
  176.    Call cEnableFI(mdiT2W.Picture1)
  177.    
  178. End Sub
  179.  
  180.  
  181. Private Sub Form_Activate()
  182.  
  183.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  184.  
  185. End Sub
  186.  
  187. Private Sub Form_Load()
  188.  
  189.    IsLoaded = False
  190.    
  191.    Show
  192.  
  193.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_cmblst.t2w")
  194.    
  195.    IsLoaded = True
  196.    
  197. End Sub
  198.  
  199. Private Sub Command1_Click()
  200.    
  201.    Call cmb_Function_Click
  202.    
  203. End Sub
  204.  
  205.  
  206. Private Sub TestComboListDir()
  207.  
  208.    Dim lResult          As Long
  209.    Dim strResult        As String
  210.    Dim strDisplay       As String
  211.    
  212.    Dim i                As Integer
  213.    
  214.    If (Text1.Text = "") Then Text1.Text = "?y*tem*"
  215.             
  216.    strResult = Text1.Text
  217.    
  218.    DoEvents
  219.    
  220.    strDisplay = strDisplay & "Search all directory occurences of '" & strResult & "' on drive C:" & vbCrLf & vbCrLf
  221.    strDisplay = strDisplay & "   number of dirs show in the ComboBox is '" & cComboSearchDir(Combo1.hwnd, "c:\", strResult) & "'" & vbCrLf & vbCrLf
  222.    strDisplay = strDisplay & "   number of dirs show in the ListBox is '" & cListSearchDir(List1.hwnd, "c:\", strResult) & "'" & vbCrLf & vbCrLf
  223.    
  224.    txt_Result = strDisplay
  225.  
  226.    If (List1.ListCount > 0) Then List1.ListIndex = 0
  227.    If (Combo1.ListCount > 0) Then Combo1.ListIndex = 0
  228.    
  229.    'time the function
  230.    
  231.    Combo1.Clear
  232.  
  233.    TimerHandle = cTimerOpen()
  234.    TimerStartOk = cTimerStart(TimerHandle)
  235.    
  236.    For i = 1 To Iteration
  237.       lResult = cComboSearchDir(Combo1.hwnd, "c:\", strResult)
  238.    Next i
  239.    
  240.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  241.    
  242.    TimerCloseOk = cTimerClose(TimerHandle)
  243.  
  244.    If (Combo1.ListCount > 0) Then Combo1.ListIndex = 0
  245.    
  246. End Sub
  247.  
  248. Private Sub Command2_Click()
  249.  
  250.    Select Case cmb_Function.ListIndex
  251.       Case 0   'TestComboListDir
  252.          Text1.Text = "?y*tem*"
  253.       Case 1   'TestComboListFile
  254.          Text1.Text = "t?w*.d?l"
  255.    End Select
  256.    
  257. End Sub
  258.  
  259.  
  260.  
  261.  
  262. Private Sub TestComboListFile()
  263.  
  264.    Dim lResult          As Long
  265.    Dim strResult        As String
  266.    Dim strDisplay       As String
  267.    
  268.    Dim i                As Integer
  269.    
  270.    If (Text1.Text = "") Then Text1.Text = "t?w*.d?l"
  271.    
  272.    strResult = Text1.Text
  273.    
  274.    DoEvents
  275.    
  276.    strDisplay = strDisplay & "Search all file occurences of '" & strResult & "' on drive C:" & vbCrLf & vbCrLf
  277.    strDisplay = strDisplay & "   number of files show in the ComboBox is '" & cComboSearchFile(Combo1.hwnd, "c:\", strResult) & "'" & vbCrLf & vbCrLf
  278.    strDisplay = strDisplay & "   number of files show in the ListBox is '" & cListSearchFile(List1.hwnd, "c:\", strResult) & "'" & vbCrLf & vbCrLf
  279.    
  280.    txt_Result = strDisplay
  281.  
  282.    If (List1.ListCount > 0) Then List1.ListIndex = 0
  283.    If (Combo1.ListCount > 0) Then Combo1.ListIndex = 0
  284.    
  285.    'time the function
  286.    
  287.    Combo1.Clear
  288.  
  289.    TimerHandle = cTimerOpen()
  290.    TimerStartOk = cTimerStart(TimerHandle)
  291.    
  292.    For i = 1 To Iteration
  293.       lResult = cComboSearchFile(Combo1.hwnd, "c:\", strResult)
  294.    Next i
  295.    
  296.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  297.    
  298.    TimerCloseOk = cTimerClose(TimerHandle)
  299.  
  300.    If (Combo1.ListCount > 0) Then Combo1.ListIndex = 0
  301.    
  302. End Sub
  303.  
  304. Private Sub TestComboListFileAttrib()
  305.  
  306.    Dim lResult          As Long
  307.    Dim strResult        As String
  308.    Dim strDisplay       As String
  309.    
  310.    Dim i                As Integer
  311.    
  312.    If (Text1.Text = "") Then Text1.Text = "t?w*.d?l"
  313.    
  314.    strResult = Text1.Text
  315.    
  316.    DoEvents
  317.    
  318.    strDisplay = strDisplay & "Search all file occurences of '" & strResult & "' on drive C:" & vbCrLf & vbCrLf
  319.    strDisplay = strDisplay & "   number of files (Archive, Hidden) show in the ComboBox is '" & cComboSearchFileAttrib(Combo1.hwnd, "c:\", strResult, A_ARCHIVE Or A_HIDDEN) & "'" & vbCrLf & vbCrLf
  320.    strDisplay = strDisplay & "   number of files (Archive, Hidden) show in the ListBox is '" & cListSearchFileAttrib(List1.hwnd, "c:\", strResult, A_ARCHIVE Or A_HIDDEN) & "'" & vbCrLf & vbCrLf
  321.    
  322.    txt_Result = strDisplay
  323.  
  324.    If (List1.ListCount > 0) Then List1.ListIndex = 0
  325.    If (Combo1.ListCount > 0) Then Combo1.ListIndex = 0
  326.    
  327.    'time the function
  328.    
  329.    Combo1.Clear
  330.  
  331.    TimerHandle = cTimerOpen()
  332.    TimerStartOk = cTimerStart(TimerHandle)
  333.    
  334.    For i = 1 To Iteration
  335.       lResult = cComboSearchFileAttrib(Combo1.hwnd, "c:\", strResult, A_ARCHIVE Or A_HIDDEN)
  336.    Next i
  337.    
  338.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  339.    
  340.    TimerCloseOk = cTimerClose(TimerHandle)
  341.  
  342.    If (Combo1.ListCount > 0) Then Combo1.ListIndex = 0
  343.    
  344. End Sub
  345.