home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form EditPiece
- Caption = "Edit Specifier"
- ClientHeight = 2415
- ClientLeft = 10110
- ClientTop = 1950
- ClientWidth = 4725
- Height = 2820
- Left = 10050
- LinkTopic = "Form2"
- ScaleHeight = 2415
- ScaleWidth = 4725
- Top = 1605
- Width = 4845
- Begin VB.CommandButton CancelCmd
- Caption = "Cancel"
- Height = 375
- Left = 2760
- TabIndex = 6
- Top = 1920
- Width = 1095
- End
- Begin VB.CommandButton OKCmd
- Caption = "OK"
- Default = -1 'True
- Height = 375
- Left = 960
- TabIndex = 5
- Top = 1920
- Width = 1095
- End
- Begin VB.CommandButton DashCmd
- Caption = "&Dash"
- Height = 375
- Left = 2640
- TabIndex = 4
- Top = 240
- Width = 975
- End
- Begin VB.CommandButton SpaceCmd
- Caption = "&Space"
- Height = 375
- Left = 2640
- TabIndex = 3
- Top = 720
- Width = 975
- End
- Begin VB.CommandButton DotCmd
- Caption = "Do&t"
- Height = 375
- Left = 2640
- TabIndex = 2
- Top = 1200
- Width = 975
- End
- Begin VB.TextBox DashLength
- Height = 375
- Left = 3720
- TabIndex = 1
- Text = "DashLength"
- Top = 240
- Width = 855
- End
- Begin VB.TextBox SpaceLength
- Height = 375
- Left = 3720
- TabIndex = 0
- Text = "SpaceLength"
- Top = 720
- Width = 855
- End
- Begin VB.Label ReplacementValue
- Alignment = 2 'Center
- Caption = "DASH 1.75"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 12
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 120
- TabIndex = 10
- Top = 1320
- Width = 2175
- End
- Begin VB.Label Label3
- Alignment = 2 'Center
- Caption = "Replacement Value:"
- Height = 255
- Left = 120
- TabIndex = 9
- Top = 1080
- Width = 2175
- End
- Begin VB.Label CurrentValue
- Alignment = 2 'Center
- Caption = "DASH 1.75"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 12
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 120
- TabIndex = 8
- Top = 360
- Width = 2175
- End
- Begin VB.Label Label1
- Alignment = 2 'Center
- Caption = "Current value is:"
- Height = 255
- Left = 120
- TabIndex = 7
- Top = 120
- Width = 2175
- End
- Attribute VB_Name = "EditPiece"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Dim NewValue As Single
- Dim edStart%
- Sub ShowRepValue()
- ' show current replacement value
- If (NewValue = 0) Then
- ReplacementValue = "DOT"
- End If
- If (NewValue < 0) Then
- ReplacementValue = "SPACE" & Str$(Abs(NewValue))
- End If
- If (NewValue > 0) Then
- ReplacementValue = "DASH" & Str$(Abs(NewValue))
- End If
- End Sub
- Private Sub CancelCmd_Click()
- ' quit without replacing
- Covered = False
- Unload EditPiece
- End Sub
- Private Sub DashCmd_Click()
- ' user chose dash
- NewValue = Abs(Val(DashLength.Text))
- ShowRepValue
- End Sub
- Private Sub DashLength_Change()
- ' user is entering data here,
- ' update the replacement display value
- If Not edStart% Then
- NewValue = Abs(Val(DashLength.Text))
- ShowRepValue
- End If
- End Sub
- Private Sub DotCmd_Click()
- ' user chose dot
- NewValue = 0
- ShowRepValue
- End Sub
- Private Sub Form_Load()
- WindowOnTop hWnd
- Covered = True
- edStart% = True ' show in start up
- EditPiece.Top = (Screen.Height - EditPiece.Height) / 2
- EditPiece.Left = (Screen.Width - EditPiece.Width) / 2
- NewValue = gblEditValue
- ReplacementValue.Caption = ""
- DashLength.Text = Str$(Abs(gblEditValue))
- SpaceLength.Text = Str$(Abs(gblEditValue))
- If (gblEditValue = 0) Then
- CurrentValue = "DOT"
- End If
- If (gblEditValue < 0) Then
- CurrentValue = "SPACE" & Str$(Abs(Val(gblEditValue)))
- End If
- If (gblEditValue > 0) Then
- CurrentValue = "DASH" & Str$(Abs(Val(gblEditValue)))
- End If
- edStart% = False
- End Sub
- Private Sub OKCmd_Click()
- ' replace with the new value and quit
- Covered = False
- gblEditValue = NewValue
- Unload EditPiece
- End Sub
- Private Sub SpaceCmd_Click()
- ' user chose space
- NewValue = -1 * Abs(Val(SpaceLength.Text))
- ShowRepValue
- End Sub
- Private Sub SpaceLength_Change()
- If Not edStart% Then
- NewValue = -1 * Abs(Val(SpaceLength.Text))
- ShowRepValue
- End If
- End Sub
-