home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form GetNameForm
- Caption = "Name for ..."
- ClientHeight = 1680
- ClientLeft = 1875
- ClientTop = 6000
- ClientWidth = 5070
- Height = 2085
- Left = 1815
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1680
- ScaleWidth = 5070
- Top = 5655
- Width = 5190
- Begin VB.CommandButton BrowseCmd
- Caption = "&Browse..."
- Height = 375
- Left = 3600
- TabIndex = 4
- Top = 1200
- Width = 1215
- End
- Begin VB.CommandButton CancelCmd
- Cancel = -1 'True
- Caption = "Cancel"
- Height = 375
- Left = 1920
- TabIndex = 3
- Top = 1200
- Width = 1215
- End
- Begin VB.CommandButton OKCmd
- Caption = "OK"
- Default = -1 'True
- Height = 375
- Left = 240
- TabIndex = 2
- Top = 1200
- Width = 1215
- End
- Begin VB.TextBox NewName
- Height = 375
- Left = 120
- TabIndex = 0
- Top = 480
- Width = 4815
- End
- Begin VB.Label label
- Alignment = 2 'Center
- Caption = "Name for new template:"
- Height = 255
- Left = 120
- TabIndex = 1
- Top = 120
- Width = 4815
- End
- Attribute VB_Name = "GetNameForm"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Private Sub BrowseCmd_Click()
- ' bring up a file selection dialog box for the user to
- ' use in selecting file name and path for new dwg file
- WindowOnTop hWnd
- On Error GoTo BrowseCmd_Error
- ComDlg.CancelError = True ' allows user to abort dlg
- ComDlg.DefaultExt = ".Dwg"
- ComDlg.Filter = "Vdraft Template (*.VS)|*.VS|All Files (*.*)|*.*"
- ComDlg.FilterIndex = 1 ' default to .VS extension
- ComDlg.Flags = &H4& + &H2& + &H800&
- ComDlg.Action = 2 ' go
- ' if we get here, then the user did not cancel the dlg
- NewName.Text = ComDlg.filename ' user-chosen file name
- GoTo BrowseCmd_Exit
- BrowseCmd_Error: ' allows user to cancel from dlg
- Resume BrowseCmd_Exit
- BrowseCmd_Exit:
- On Error GoTo 0
- End Sub
- Private Sub CancelCmd_Click()
- ' quit
- gblNewName = ""
- GetNameForm.Hide
- End Sub
- Private Sub Form_Load()
- ' generic template for acquiring a new file
- ' or preset name from the user. Its behavior is
- ' determined by the setting of a global switch:
- ' gblGetNameFlag, where
- ' 1 = get name for "save as template"
- ' 2 = get name for "save as new preset"
- ' 3 =
- ' center form on screen
- GetNameForm.Top = (Screen.Height - GetNameForm.Height) / 2
- GetNameForm.Left = (Screen.Width - GetNameForm.Width) / 2
- Select Case gblGetNameFlag
- Case 1 ' save as template
- GetNameForm.Caption = "Name for Template"
- Label.Caption = "Enter name for the new template:"
- Case 2 ' save as new preset
- GetNameForm.Caption = "Name for New Preset"
- Label.Caption = "Enter name for the new Preset"
- End Select
- End Sub
- Private Sub OKCmd_Click()
- ' done
- gblNewName = Trim$(NewName.Text)
- GetNameForm.Hide
- End Sub
-