vbAccelerator - Contents of code file: frmAddNew.frm

VERSION 5.00
Begin VB.Form frmAddNew 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Bug Details"
   ClientHeight    =   3225
   ClientLeft      =   5385
   ClientTop       =   3930
   ClientWidth     =   6075
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmAddNew.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3225
   ScaleWidth      =   6075
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "Cancel"
      Height          =   435
      Left            =   4620
      TabIndex        =   9
      Top             =   2640
      Width           =   1335
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "OK"
      Default         =   -1  'True
      Height          =   435
      Left            =   3240
      TabIndex        =   8
      Top             =   2640
      Width           =   1335
   End
   Begin VB.TextBox txtAuthor 
      Height          =   315
      Left            =   1260
      TabIndex        =   7
      Top             =   1860
      Width           =   4695
   End
   Begin VB.TextBox txtHeadline 
      Height          =   795
      Left            =   1260
      MultiLine       =   -1  'True
      TabIndex        =   5
      Top             =   900
      Width           =   4695
   End
   Begin VB.ComboBox cboStatus 
      Height          =   315
      ItemData        =   "frmAddNew.frx":000C
      Left            =   1260
      List            =   "frmAddNew.frx":001C
      Style           =   2  'Dropdown List
      TabIndex        =   3
      Top             =   480
      Width           =   2475
   End
   Begin VB.ComboBox cboType 
      Height          =   315
      ItemData        =   "frmAddNew.frx":0059
      Left            =   1260
      List            =   "frmAddNew.frx":0066
      Style           =   2  'Dropdown List
      TabIndex        =   1
      Top             =   120
      Width           =   2475
   End
   Begin VB.Label lblAuthor 
      Caption         =   "&Author:"
      Height          =   255
      Left            =   120
      TabIndex        =   6
      Top             =   1860
      Width           =   1035
   End
   Begin VB.Label lblHeadline 
      Caption         =   "&Headline:"
      Height          =   255
      Left            =   120
      TabIndex        =   4
      Top             =   900
      Width           =   1035
   End
   Begin VB.Label lblStatus 
      Caption         =   "&Status:"
      Height          =   255
      Left            =   120
      TabIndex        =   2
      Top             =   540
      Width           =   1035
   End
   Begin VB.Label lblType 
      Caption         =   "&Type:"
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   180
      Width           =   1035
   End
End
Attribute VB_Name = "frmAddNew"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private m_sType As String
Private m_sStatus As String
Private m_sHeadline As String
Private m_sAuthor As String
Private m_bShowing As Boolean
Private m_bCancel As Boolean

Private Sub selectComboItem(cbo As ComboBox, ByVal sItem As String)
Dim i As Long
   For i = 0 To cbo.ListCount - 1
      If cbo.List(i) = sItem Then
         cbo.ListIndex = i
         Exit For
      End If
   Next i
End Sub

Public Property Get Cancelled() As Boolean
   Cancelled = m_bCancel
End Property

Public Property Get BugType() As String
   BugType = m_sType
End Property
Public Property Let BugType(ByVal sType As String)
   m_sType = sType
   If (m_bShowing) Then
      selectComboItem cboType, sType
   End If
End Property
Public Property Get BugStatus() As String
   BugStatus = m_sStatus
End Property
Public Property Let BugStatus(ByVal sStatus As String)
   m_sStatus = sStatus
   If (m_bShowing) Then
      selectComboItem cboStatus, sStatus
   End If
End Property
Public Property Get Headline() As String
   Headline = m_sHeadline
End Property
Public Property Let Headline(ByVal sHeadline As String)
   m_sHeadline = sHeadline
   If (m_bShowing) Then
      txtHeadline.Text = sHeadline
   End If
End Property
Public Property Get Author() As String
   Author = m_sAuthor
End Property
Public Property Let Author(ByVal sAuthor As String)
   m_sAuthor = sAuthor
   If (m_bShowing) Then
      txtAuthor.Text = sAuthor
   End If
End Property

Private Sub cmdCancel_Click()
   Unload Me
End Sub

Private Sub cmdOK_Click()
   If (cboType.ListIndex > -1) Then
      If (cboStatus.ListIndex > -1) Then
         If Len(txtHeadline.Text) > 0 Then
            If Len(txtAuthor.Text) > 0 Then
               m_sType = cboType.Text
               m_sStatus = cboStatus.Text
               m_sHeadline = txtHeadline.Text
               m_sAuthor = txtAuthor.Text
               m_bCancel = False
               Unload Me
            Else
               MsgBox "Enter an author", vbInformation
               txtAuthor.SetFocus
            End If
         Else
            MsgBox "Enter a headline", vbInformation
            txtHeadline.SetFocus
         End If
      Else
         MsgBox "Enter the bug's status", vbInformation
         cboStatus.SetFocus
      End If
   Else
      MsgBox "Enter the bug type", vbInformation
      cboType.SetFocus
   End If
End Sub

Private Sub Form_Load()
   
   m_bCancel = True
   
   m_bShowing = True
   txtAuthor.Text = m_sAuthor
   txtHeadline.Text = m_sHeadline
   selectComboItem cboType, m_sType
   selectComboItem cboStatus, m_sStatus
   
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
   '
   '
End Sub