home *** CD-ROM | disk | FTP | other *** search
/ CD Direkt 1995 #6 / CDD_6_95.ISO / cdd / winanw / emedit / replace.frm < prev    next >
Text File  |  1994-04-27  |  6KB  |  205 lines

  1. VERSION 2.00
  2. Begin Form frmReplace 
  3.    Caption         =   "Replace"
  4.    ClientHeight    =   2985
  5.    ClientLeft      =   780
  6.    ClientTop       =   2040
  7.    ClientWidth     =   4905
  8.    Height          =   3390
  9.    Left            =   720
  10.    LinkTopic       =   "Form2"
  11.    ScaleHeight     =   2985
  12.    ScaleWidth      =   4905
  13.    Top             =   1695
  14.    Width           =   5025
  15.    Begin ComboBox comboNewText 
  16.       Height          =   300
  17.       Left            =   1080
  18.       TabIndex        =   2
  19.       Top             =   600
  20.       Width           =   2535
  21.    End
  22.    Begin ComboBox comboText 
  23.       Height          =   300
  24.       Left            =   1080
  25.       TabIndex        =   0
  26.       Top             =   210
  27.       Width           =   2535
  28.    End
  29.    Begin Frame Frame4 
  30.       Caption         =   "Origin"
  31.       Height          =   975
  32.       Left            =   2610
  33.       TabIndex        =   11
  34.       Top             =   1530
  35.       Width           =   2055
  36.       Begin OptionButton optOrigin 
  37.          Caption         =   "&From cursor"
  38.          Height          =   285
  39.          Index           =   1
  40.          Left            =   240
  41.          TabIndex        =   13
  42.          Top             =   240
  43.          Value           =   -1  'True
  44.          Width           =   1575
  45.       End
  46.       Begin OptionButton optOrigin 
  47.          Caption         =   "&Entire Scope"
  48.          Height          =   285
  49.          Index           =   0
  50.          Left            =   240
  51.          TabIndex        =   12
  52.          Top             =   600
  53.          Width           =   1575
  54.       End
  55.    End
  56.    Begin Frame Frame1 
  57.       Caption         =   "Direction"
  58.       Height          =   570
  59.       Left            =   120
  60.       TabIndex        =   7
  61.       Top             =   2310
  62.       Width           =   2175
  63.       Begin OptionButton optDirection 
  64.          Caption         =   "&Down"
  65.          Height          =   252
  66.          Index           =   1
  67.          Left            =   960
  68.          TabIndex        =   9
  69.          Top             =   240
  70.          Value           =   -1  'True
  71.          Width           =   852
  72.       End
  73.       Begin OptionButton optDirection 
  74.          Caption         =   "&Up"
  75.          Height          =   252
  76.          Index           =   0
  77.          Left            =   240
  78.          TabIndex        =   8
  79.          Top             =   240
  80.          Width           =   612
  81.       End
  82.    End
  83.    Begin CheckBox chkCase 
  84.       Caption         =   "Match &Case"
  85.       Height          =   375
  86.       Left            =   240
  87.       TabIndex        =   5
  88.       Top             =   1320
  89.       Width           =   1455
  90.    End
  91.    Begin CommandButton cmdcancel 
  92.       Cancel          =   -1  'True
  93.       Caption         =   "Cancel"
  94.       Height          =   372
  95.       Left            =   3720
  96.       TabIndex        =   4
  97.       Top             =   600
  98.       Width           =   1092
  99.    End
  100.    Begin CommandButton cmdOK 
  101.       Caption         =   "&OK"
  102.       Default         =   -1  'True
  103.       Height          =   372
  104.       Left            =   3720
  105.       TabIndex        =   3
  106.       Top             =   120
  107.       Width           =   1092
  108.    End
  109.    Begin Frame Frame2 
  110.       Caption         =   "Options"
  111.       Height          =   975
  112.       Left            =   120
  113.       TabIndex        =   10
  114.       Top             =   1080
  115.       Width           =   2175
  116.       Begin CheckBox chkWholeWords 
  117.          Caption         =   "&Whole Words Only"
  118.          Height          =   315
  119.          Left            =   120
  120.          TabIndex        =   6
  121.          Top             =   600
  122.          Width           =   1935
  123.       End
  124.    End
  125.    Begin Label Label2 
  126.       Caption         =   "&New Text:"
  127.       Height          =   255
  128.       Left            =   120
  129.       TabIndex        =   14
  130.       Top             =   600
  131.       Width           =   975
  132.    End
  133.    Begin Label Label1 
  134.       Caption         =   "Fi&nd What:"
  135.       Height          =   255
  136.       Index           =   0
  137.       Left            =   120
  138.       TabIndex        =   1
  139.       Top             =   240
  140.       Width           =   975
  141.    End
  142. End
  143. Option Explicit
  144.  
  145. Sub cmdCancel_Click ()
  146. '    gFindString = comboText.Text
  147.     Hide
  148. End Sub
  149.  
  150. Sub cmdOK_Click ()
  151.     Dim TargetText As String
  152.     Dim NewText As String
  153.     Dim MatchCase As Integer
  154.     Dim WholeWordOnly As Integer
  155.  
  156.     Dim UpDirection As Integer
  157.     Dim BeginScope As Integer
  158.     Dim FoundIt As Integer
  159.  
  160.     ' It seems that VB does not let you pass control properties directly, so you are
  161.     ' preventing from writing...
  162.     '    FindIt comboText.Text, MatchCase, WholeWordOnly, optScope(0).Value, optDirection(0).Value, optOrigin(0).Value
  163.     ' ...instead you have to assign the properites to variables and then pass the variables.
  164.     ' Kinda lame.
  165.     TargetText = comboText.Text
  166.     NewText = comboNewText.Text
  167.     BeginScope = optOrigin(0).Value
  168.     UpDirection = optDirection(0).Value
  169.  
  170.     If chkCase.Value = 1 Then
  171.         MatchCase = True
  172.     Else
  173.         MatchCase = False
  174.     End If
  175.     If chkWholeWords.Value = 1 Then
  176.         WholeWordOnly = True
  177.     Else
  178.         WholeWordOnly = False
  179.     End If
  180.     
  181. '    gFindString = comboText.Text
  182.     UpdateComboList comboText, TargetText  ' add text to combo list if not already exists
  183.     UpdateComboList comboNewText, NewText
  184.     Hide
  185.     FoundIt = FindIt(TargetText, MatchCase, WholeWordOnly, UpDirection, BeginScope, NewText, True)
  186. End Sub
  187.  
  188. Sub comboText_Change ()
  189.     If comboText.Text = "" Then
  190.         cmdOK.Enabled = False
  191.     Else
  192.         cmdOK.Enabled = True
  193.     End If
  194. End Sub
  195.  
  196. Sub Form_Load ()
  197.     cmdOK.Enabled = False
  198.     'gFindDirection = 1
  199. End Sub
  200.  
  201. Sub optDirection_Click (Index As Integer)
  202.     'gFindDirection = Index
  203. End Sub
  204.  
  205.