home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form RenameForm
- BorderStyle = 1 'Fixed Single
- Caption = "Rename Layer"
- ClientHeight = 1680
- ClientLeft = 7050
- ClientTop = 11100
- ClientWidth = 4530
- Height = 2085
- Left = 6990
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1680
- ScaleWidth = 4530
- Top = 10755
- Width = 4650
- Begin VB.TextBox NewName
- Height = 375
- Left = 600
- TabIndex = 2
- Text = "NewName"
- Top = 600
- Width = 3255
- End
- Begin VB.CommandButton OKCmd
- Caption = "Accept"
- Default = -1 'True
- Height = 375
- Left = 480
- TabIndex = 1
- Top = 1200
- Width = 1455
- End
- Begin VB.CommandButton CancelCmd
- Caption = "Cancel"
- Height = 375
- Left = 2520
- TabIndex = 0
- Top = 1200
- Width = 1455
- End
- Begin VB.Label Label
- Alignment = 2 'Center
- Caption = "Enter New Name for Layer:"
- Height = 255
- Left = 600
- TabIndex = 3
- Top = 240
- Width = 3255
- End
- Attribute VB_Name = "RenameForm"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Private Sub CancelCmd_Click()
- ' forget it
- Unload RenameForm
- End Sub
- Private Sub Form_Load()
- ' rename the current whatever
- ' if gblMode = 0 then renaming current layer
- ' if gblMode = 1 then renaming current linetype
- WindowOnTop hWnd
- RenameForm.Top = (Screen.Height - RenameForm.Height) / 2
- RenameForm.Left = (Screen.Width - RenameForm.Width) / 2
- Select Case gblMode
- Case 0 ' rename layer
- If (MainForm.LayerList.ListIndex = -1) Then
- Unload RenameForm
- End If
- RenameForm.Caption = "Rename Layer"
- Label.Caption = "Enter new name for layer"
- NewName.Text = MainForm.LayerList.List(MainForm.LayerList.ListIndex)
- Case 1 ' rename linetype
- If (MainForm.LTList.ListIndex = -1) Then
- Unload RenameForm
- End If
- RenameForm.Caption = "Rename Linetype"
- Label.Caption = "Enter new name for linetype"
- NewName.Text = LineTypes(MainForm.LTList.ItemData(MainForm.LTList.ListIndex))
-
- Case 2 ' rename a text style
- If (MainForm.TextStyleList.ListIndex = -1) Then
- Unload RenameForm
- End If
- RenameForm.Caption = "Rename Text Style"
- Label.Caption = "Enter new name for text style"
- NewName.Text = MainForm.TextStyleList.List(MainForm.TextStyleList.ListIndex)
- End Select
- End Sub
- Private Sub OKCmd_Click()
- ' rename the layer with the new name
- Select Case gblMode
- Case 0 ' layers
- MainForm.LayerList.List(MainForm.LayerList.ListIndex) = Trim$(NewName.Text)
-
- Case 1 ' linetypes
- LineTypes(MainForm.LTList.ItemData(MainForm.LTList.ListIndex)) = Trim$(NewName.Text)
- Case 2 ' text style
- MainForm.TextStyleList.List(MainForm.TextStyleList.ListIndex) = Trim$(NewName.Text)
- End Select
- Unload RenameForm
- End Sub
-