home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 November / pcwk_11_98a.iso / Wtestowe / SOFTSRC / vtrial15.exe / DATA.1 / EditPiec.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-03-20  |  6.0 KB  |  205 lines

  1. VERSION 4.00
  2. Begin VB.Form EditPiece 
  3.    Caption         =   "Edit Specifier"
  4.    ClientHeight    =   2415
  5.    ClientLeft      =   10110
  6.    ClientTop       =   1950
  7.    ClientWidth     =   4725
  8.    Height          =   2820
  9.    Left            =   10050
  10.    LinkTopic       =   "Form2"
  11.    ScaleHeight     =   2415
  12.    ScaleWidth      =   4725
  13.    Top             =   1605
  14.    Width           =   4845
  15.    Begin VB.CommandButton CancelCmd 
  16.       Caption         =   "Cancel"
  17.       Height          =   375
  18.       Left            =   2760
  19.       TabIndex        =   6
  20.       Top             =   1920
  21.       Width           =   1095
  22.    End
  23.    Begin VB.CommandButton OKCmd 
  24.       Caption         =   "OK"
  25.       Default         =   -1  'True
  26.       Height          =   375
  27.       Left            =   960
  28.       TabIndex        =   5
  29.       Top             =   1920
  30.       Width           =   1095
  31.    End
  32.    Begin VB.CommandButton DashCmd 
  33.       Caption         =   "&Dash"
  34.       Height          =   375
  35.       Left            =   2640
  36.       TabIndex        =   4
  37.       Top             =   240
  38.       Width           =   975
  39.    End
  40.    Begin VB.CommandButton SpaceCmd 
  41.       Caption         =   "&Space"
  42.       Height          =   375
  43.       Left            =   2640
  44.       TabIndex        =   3
  45.       Top             =   720
  46.       Width           =   975
  47.    End
  48.    Begin VB.CommandButton DotCmd 
  49.       Caption         =   "Do&t"
  50.       Height          =   375
  51.       Left            =   2640
  52.       TabIndex        =   2
  53.       Top             =   1200
  54.       Width           =   975
  55.    End
  56.    Begin VB.TextBox DashLength 
  57.       Height          =   375
  58.       Left            =   3720
  59.       TabIndex        =   1
  60.       Text            =   "DashLength"
  61.       Top             =   240
  62.       Width           =   855
  63.    End
  64.    Begin VB.TextBox SpaceLength 
  65.       Height          =   375
  66.       Left            =   3720
  67.       TabIndex        =   0
  68.       Text            =   "SpaceLength"
  69.       Top             =   720
  70.       Width           =   855
  71.    End
  72.    Begin VB.Label ReplacementValue 
  73.       Alignment       =   2  'Center
  74.       Caption         =   "DASH 1.75"
  75.       BeginProperty Font 
  76.          name            =   "MS Sans Serif"
  77.          charset         =   0
  78.          weight          =   700
  79.          size            =   12
  80.          underline       =   0   'False
  81.          italic          =   0   'False
  82.          strikethrough   =   0   'False
  83.       EndProperty
  84.       Height          =   375
  85.       Left            =   120
  86.       TabIndex        =   10
  87.       Top             =   1320
  88.       Width           =   2175
  89.    End
  90.    Begin VB.Label Label3 
  91.       Alignment       =   2  'Center
  92.       Caption         =   "Replacement Value:"
  93.       Height          =   255
  94.       Left            =   120
  95.       TabIndex        =   9
  96.       Top             =   1080
  97.       Width           =   2175
  98.    End
  99.    Begin VB.Label CurrentValue 
  100.       Alignment       =   2  'Center
  101.       Caption         =   "DASH 1.75"
  102.       BeginProperty Font 
  103.          name            =   "MS Sans Serif"
  104.          charset         =   0
  105.          weight          =   700
  106.          size            =   12
  107.          underline       =   0   'False
  108.          italic          =   0   'False
  109.          strikethrough   =   0   'False
  110.       EndProperty
  111.       Height          =   375
  112.       Left            =   120
  113.       TabIndex        =   8
  114.       Top             =   360
  115.       Width           =   2175
  116.    End
  117.    Begin VB.Label Label1 
  118.       Alignment       =   2  'Center
  119.       Caption         =   "Current value is:"
  120.       Height          =   255
  121.       Left            =   120
  122.       TabIndex        =   7
  123.       Top             =   120
  124.       Width           =   2175
  125.    End
  126. Attribute VB_Name = "EditPiece"
  127. Attribute VB_Creatable = False
  128. Attribute VB_Exposed = False
  129. Option Explicit
  130. Dim NewValue As Single
  131. Dim edStart%
  132. Sub ShowRepValue()
  133. '   show current replacement value
  134.     If (NewValue = 0) Then
  135.         ReplacementValue = "DOT"
  136.     End If
  137.     If (NewValue < 0) Then
  138.         ReplacementValue = "SPACE" & Str$(Abs(NewValue))
  139.     End If
  140.     If (NewValue > 0) Then
  141.         ReplacementValue = "DASH" & Str$(Abs(NewValue))
  142.     End If
  143. End Sub
  144. Private Sub CancelCmd_Click()
  145. '   quit without replacing
  146.     Covered = False
  147.     Unload EditPiece
  148. End Sub
  149. Private Sub DashCmd_Click()
  150. '   user chose dash
  151.     NewValue = Abs(Val(DashLength.Text))
  152.     ShowRepValue
  153. End Sub
  154. Private Sub DashLength_Change()
  155. '   user is entering data here,
  156. '   update the replacement display value
  157.     If Not edStart% Then
  158.         NewValue = Abs(Val(DashLength.Text))
  159.         ShowRepValue
  160.     End If
  161. End Sub
  162. Private Sub DotCmd_Click()
  163. '   user chose dot
  164.     NewValue = 0
  165.     ShowRepValue
  166. End Sub
  167. Private Sub Form_Load()
  168.     WindowOnTop hWnd
  169.     Covered = True
  170.     edStart% = True                     ' show in start up
  171.     EditPiece.Top = (Screen.Height - EditPiece.Height) / 2
  172.     EditPiece.Left = (Screen.Width - EditPiece.Width) / 2
  173.     NewValue = gblEditValue
  174.     ReplacementValue.Caption = ""
  175.     DashLength.Text = Str$(Abs(gblEditValue))
  176.     SpaceLength.Text = Str$(Abs(gblEditValue))
  177.     If (gblEditValue = 0) Then
  178.         CurrentValue = "DOT"
  179.     End If
  180.     If (gblEditValue < 0) Then
  181.         CurrentValue = "SPACE" & Str$(Abs(Val(gblEditValue)))
  182.     End If
  183.     If (gblEditValue > 0) Then
  184.         CurrentValue = "DASH" & Str$(Abs(Val(gblEditValue)))
  185.     End If
  186.     edStart% = False
  187. End Sub
  188. Private Sub OKCmd_Click()
  189. '   replace with the new value and quit
  190.     Covered = False
  191.     gblEditValue = NewValue
  192.     Unload EditPiece
  193. End Sub
  194. Private Sub SpaceCmd_Click()
  195. '   user chose space
  196.     NewValue = -1 * Abs(Val(SpaceLength.Text))
  197.     ShowRepValue
  198. End Sub
  199. Private Sub SpaceLength_Change()
  200.     If Not edStart% Then
  201.         NewValue = -1 * Abs(Val(SpaceLength.Text))
  202.         ShowRepValue
  203.     End If
  204. End Sub
  205.