home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 November / pcwk_11_98a.iso / Wtestowe / SOFTSRC / vtrial15.exe / DATA.1 / RenLayer.frm < prev    next >
Text File  |  1997-03-20  |  4KB  |  120 lines

  1. VERSION 4.00
  2. Begin VB.Form RenameForm 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Rename Layer"
  5.    ClientHeight    =   1680
  6.    ClientLeft      =   7050
  7.    ClientTop       =   11100
  8.    ClientWidth     =   4530
  9.    Height          =   2085
  10.    Left            =   6990
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   1680
  15.    ScaleWidth      =   4530
  16.    Top             =   10755
  17.    Width           =   4650
  18.    Begin VB.TextBox NewName 
  19.       Height          =   375
  20.       Left            =   600
  21.       TabIndex        =   2
  22.       Text            =   "NewName"
  23.       Top             =   600
  24.       Width           =   3255
  25.    End
  26.    Begin VB.CommandButton OKCmd 
  27.       Caption         =   "Accept"
  28.       Default         =   -1  'True
  29.       Height          =   375
  30.       Left            =   480
  31.       TabIndex        =   1
  32.       Top             =   1200
  33.       Width           =   1455
  34.    End
  35.    Begin VB.CommandButton CancelCmd 
  36.       Caption         =   "Cancel"
  37.       Height          =   375
  38.       Left            =   2520
  39.       TabIndex        =   0
  40.       Top             =   1200
  41.       Width           =   1455
  42.    End
  43.    Begin VB.Label Label 
  44.       Alignment       =   2  'Center
  45.       Caption         =   "Enter New Name for Layer:"
  46.       Height          =   255
  47.       Left            =   600
  48.       TabIndex        =   3
  49.       Top             =   240
  50.       Width           =   3255
  51.    End
  52. End
  53. Attribute VB_Name = "RenameForm"
  54. Attribute VB_Creatable = False
  55. Attribute VB_Exposed = False
  56. Private Sub CancelCmd_Click()
  57. '
  58. '   forget it
  59. '
  60.     Unload RenameForm
  61. End Sub
  62.  
  63. Private Sub Form_Load()
  64. '
  65. '   rename the current whatever
  66. '
  67. '   if gblMode = 0 then renaming current layer
  68. '   if gblMode = 1 then renaming current linetype
  69. '
  70.     WindowOnTop hWnd
  71.     
  72.     RenameForm.Top = (Screen.Height - RenameForm.Height) / 2
  73.     RenameForm.Left = (Screen.Width - RenameForm.Width) / 2
  74.     
  75.     Select Case gblMode
  76.         Case 0                          ' rename layer
  77.             If (MainForm.LayerList.ListIndex = -1) Then
  78.                 Unload RenameForm
  79.             End If
  80.             RenameForm.Caption = "Rename Layer"
  81.             Label.Caption = "Enter new name for layer"
  82.             NewName.Text = MainForm.LayerList.List(MainForm.LayerList.ListIndex)
  83.  
  84.         Case 1                          ' rename linetype
  85.             If (MainForm.LTList.ListIndex = -1) Then
  86.                 Unload RenameForm
  87.             End If
  88.             RenameForm.Caption = "Rename Linetype"
  89.             Label.Caption = "Enter new name for linetype"
  90.             NewName.Text = LineTypes(MainForm.LTList.ItemData(MainForm.LTList.ListIndex))
  91.             
  92.         Case 2                          '   rename a text style
  93.             If (MainForm.TextStyleList.ListIndex = -1) Then
  94.                 Unload RenameForm
  95.             End If
  96.             RenameForm.Caption = "Rename Text Style"
  97.             Label.Caption = "Enter new name for text style"
  98.             NewName.Text = MainForm.TextStyleList.List(MainForm.TextStyleList.ListIndex)
  99.     End Select
  100. End Sub
  101.  
  102. Private Sub OKCmd_Click()
  103. '
  104. '   rename the layer with the new name
  105. '
  106.     Select Case gblMode
  107.         Case 0                              ' layers
  108.             MainForm.LayerList.List(MainForm.LayerList.ListIndex) = Trim$(NewName.Text)
  109.         
  110.         Case 1                              ' linetypes
  111.             LineTypes(MainForm.LTList.ItemData(MainForm.LTList.ListIndex)) = Trim$(NewName.Text)
  112.  
  113.         Case 2                              ' text style
  114.             MainForm.TextStyleList.List(MainForm.TextStyleList.ListIndex) = Trim$(NewName.Text)
  115.     End Select
  116.     Unload RenameForm
  117. End Sub
  118.  
  119.  
  120.