home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 Special / chip-cd_2001_spec_05.zip / spec_05 / apps / crystal / disk18 / Xvb383._ / Xvb383.
Text File  |  1999-08-23  |  3KB  |  104 lines

  1. VERSION 5.00
  2. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.1#0"; "RICHTX32.OCX"
  3. Begin VB.Form frmSource 
  4.    Caption         =   "Source Code"
  5.    ClientHeight    =   5685
  6.    ClientLeft      =   1275
  7.    ClientTop       =   1065
  8.    ClientWidth     =   6585
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   5685
  11.    ScaleWidth      =   6585
  12.    Begin VB.CommandButton cmdClose 
  13.       Cancel          =   -1  'True
  14.       Caption         =   "&Close"
  15.       Default         =   -1  'True
  16.       Height          =   375
  17.       Left            =   5235
  18.       TabIndex        =   1
  19.       Top             =   5205
  20.       Width           =   1215
  21.    End
  22.    Begin RichTextLib.RichTextBox rtxtSource 
  23.       Height          =   4875
  24.       Left            =   135
  25.       TabIndex        =   0
  26.       Top             =   135
  27.       Width           =   6300
  28.       _ExtentX        =   11113
  29.       _ExtentY        =   8599
  30.       _Version        =   327680
  31.       ScrollBars      =   3
  32.       TextRTF         =   $"Source.frx":0000
  33.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  34.          Name            =   "Courier New"
  35.          Size            =   9.75
  36.          Charset         =   0
  37.          Weight          =   400
  38.          Underline       =   0   'False
  39.          Italic          =   0   'False
  40.          Strikethrough   =   0   'False
  41.       EndProperty
  42.    End
  43. End
  44. Attribute VB_Name = "frmSource"
  45. Attribute VB_GlobalNameSpace = False
  46. Attribute VB_Creatable = False
  47. Attribute VB_PredeclaredId = True
  48. Attribute VB_Exposed = False
  49. Option Explicit
  50.  
  51. Private m_strFilename As String
  52.  
  53. Private m_blnChanged As Boolean
  54.  
  55. Public Sub Display(strFilename As String)
  56.   On Error GoTo Display_Exit
  57.   
  58.   If strFilename = "" Then
  59.     rtxtSource.Locked = True
  60.     m_strFilename = App.Path & "\source\template.rtf"
  61.   Else
  62.     rtxtSource.Locked = False
  63.     m_strFilename = App.Path & "\source\" & strFilename & ".rtf"
  64.     If Dir(m_strFilename) = "" Then FileCopy App.Path & "\source\template.rtf", m_strFilename
  65.   End If
  66.   
  67.   rtxtSource.filename = m_strFilename
  68.   m_blnChanged = False
  69.   Me.Show vbModal, frmOptions
  70.   
  71. Display_Exit:
  72. End Sub
  73.  
  74. Private Sub cmdClose_Click()
  75.   If m_blnChanged Then
  76.     Select Case MsgBox("Save your changes to " & Me.rtxtSource.filename & "?", vbYesNoCancel, frmSource.Caption)
  77.       Case vbCancel
  78.         GoTo cmdClose_ClickExit
  79.       Case vbYes
  80.         rtxtSource.SaveFile m_strFilename
  81.     End Select
  82.   End If
  83.   Me.Hide
  84.   
  85. cmdClose_ClickExit:
  86. End Sub
  87.  
  88. Private Sub Form_Load()
  89.   Center Me
  90. End Sub
  91.  
  92. Private Sub Form_Resize()
  93.   rtxtSource.Left = 100
  94.   rtxtSource.Top = 100
  95.   rtxtSource.Width = Me.Width - 350
  96.   rtxtSource.Height = Me.Height - 1100
  97.   cmdClose.Left = Me.Width - 1500
  98.   cmdClose.Top = Me.Height - 850
  99. End Sub
  100.  
  101. Private Sub rtxtSource_Change()
  102.   m_blnChanged = True
  103. End Sub
  104.