home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 November / pcwk_11_98a.iso / Wtestowe / SOFTSRC / vtrial15.exe / DATA.1 / RenLayer.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-03-20  |  3.7 KB  |  104 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. Attribute VB_Name = "RenameForm"
  53. Attribute VB_Creatable = False
  54. Attribute VB_Exposed = False
  55. Private Sub CancelCmd_Click()
  56. '   forget it
  57.     Unload RenameForm
  58. End Sub
  59. Private Sub Form_Load()
  60. '   rename the current whatever
  61. '   if gblMode = 0 then renaming current layer
  62. '   if gblMode = 1 then renaming current linetype
  63.     WindowOnTop hWnd
  64.     RenameForm.Top = (Screen.Height - RenameForm.Height) / 2
  65.     RenameForm.Left = (Screen.Width - RenameForm.Width) / 2
  66.     Select Case gblMode
  67.         Case 0                          ' rename layer
  68.             If (MainForm.LayerList.ListIndex = -1) Then
  69.                 Unload RenameForm
  70.             End If
  71.             RenameForm.Caption = "Rename Layer"
  72.             Label.Caption = "Enter new name for layer"
  73.             NewName.Text = MainForm.LayerList.List(MainForm.LayerList.ListIndex)
  74.         Case 1                          ' rename linetype
  75.             If (MainForm.LTList.ListIndex = -1) Then
  76.                 Unload RenameForm
  77.             End If
  78.             RenameForm.Caption = "Rename Linetype"
  79.             Label.Caption = "Enter new name for linetype"
  80.             NewName.Text = LineTypes(MainForm.LTList.ItemData(MainForm.LTList.ListIndex))
  81.             
  82.         Case 2                          '   rename a text style
  83.             If (MainForm.TextStyleList.ListIndex = -1) Then
  84.                 Unload RenameForm
  85.             End If
  86.             RenameForm.Caption = "Rename Text Style"
  87.             Label.Caption = "Enter new name for text style"
  88.             NewName.Text = MainForm.TextStyleList.List(MainForm.TextStyleList.ListIndex)
  89.     End Select
  90. End Sub
  91. Private Sub OKCmd_Click()
  92. '   rename the layer with the new name
  93.     Select Case gblMode
  94.         Case 0                              ' layers
  95.             MainForm.LayerList.List(MainForm.LayerList.ListIndex) = Trim$(NewName.Text)
  96.         
  97.         Case 1                              ' linetypes
  98.             LineTypes(MainForm.LTList.ItemData(MainForm.LTList.ListIndex)) = Trim$(NewName.Text)
  99.         Case 2                              ' text style
  100.             MainForm.TextStyleList.List(MainForm.TextStyleList.ListIndex) = Trim$(NewName.Text)
  101.     End Select
  102.     Unload RenameForm
  103. End Sub
  104.