'************************************************************************************************************************
' File: PMACSalarm.vb
' Programmer: Ting Chan
' Date: October 25, 2004
'
' Description:
' This form is used to display the switching operations in a datagrid.
' The displayed information includes Date, Time, Load ID, Load status,
' and a brief description of the switching operation.
'
' Revision History:
' 
'************************************************************************************************************************
Option Strict Off
Option Explicit On 
Friend Class PMACSalarm
    Inherits System.Windows.Forms.Form
#Region "Windows Form Designer generated code "
    Public Sub New()
        MyBase.New()
        If m_vb6FormDefInstance Is Nothing Then
            If m_InitializingDefInstance Then
                m_vb6FormDefInstance = Me
            Else
                Try
                    'For the start-up form, the first instance created is the default instance.
                    If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then
                        m_vb6FormDefInstance = Me
                    End If
                Catch
                End Try
            End If
        End If
        'This call is required by the Windows Form Designer.
        InitializeComponent()
        'This form is an MDI child.
        'This code simulates the VB6 
        ' functionality of automatically
        ' loading and showing an MDI
        ' child's parent.
        'Me.MdiParent = Project1.PMACSstartup.DefInstance.DefInstance
        Project1.PMACSstartup.DefInstance.DefInstance.Show()
        'The MDI form in the VB6 project had its
        'AutoShowChildren property set to True
        'To simulate the VB6 behavior, we need to
        'automatically Show the form whenever it
        'is loaded.  If you do not want this behavior
        'then delete the following line of code
        'UPGRADE_NOTE: Remove the next line of code to stop form from automatically showing. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup2018"'
        'Me.Show()
    End Sub
    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean)
        If Disposing Then
            If Not components Is Nothing Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(Disposing)
    End Sub
    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer
    Public ToolTip1 As System.Windows.Forms.ToolTip
    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.
    'Do not modify it using the code editor.
    Friend WithEvents AlarmGridFirstLine As System.Windows.Forms.DataGrid
    Friend WithEvents CheckBoxAutoBottom As System.Windows.Forms.CheckBox
    Friend WithEvents AlarmGrid As marsDataGrid.marsScrollDataGrid
    Public WithEvents DateTime As System.Windows.Forms.Label
    Friend WithEvents Label21 As System.Windows.Forms.Label
    Friend WithEvents ButtonClearEventLog As System.Windows.Forms.Button
    Friend WithEvents Label1 As System.Windows.Forms.Label
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
        Me.AlarmGridFirstLine = New System.Windows.Forms.DataGrid
        Me.CheckBoxAutoBottom = New System.Windows.Forms.CheckBox
        Me.AlarmGrid = New marsDataGrid.marsScrollDataGrid
        Me.DateTime = New System.Windows.Forms.Label
        Me.Label21 = New System.Windows.Forms.Label
        Me.ButtonClearEventLog = New System.Windows.Forms.Button
        Me.Label1 = New System.Windows.Forms.Label
        CType(Me.AlarmGridFirstLine, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.AlarmGrid, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'AlarmGridFirstLine
        '
        Me.AlarmGridFirstLine.AlternatingBackColor = System.Drawing.SystemColors.ScrollBar
        Me.AlarmGridFirstLine.BackColor = System.Drawing.SystemColors.ScrollBar
        Me.AlarmGridFirstLine.CaptionFont = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.AlarmGridFirstLine.CaptionText = "Events"
        Me.AlarmGridFirstLine.ColumnHeadersVisible = False
        Me.AlarmGridFirstLine.DataMember = ""
        Me.AlarmGridFirstLine.Enabled = False
        Me.AlarmGridFirstLine.Font = New System.Drawing.Font("Lucida Console", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.AlarmGridFirstLine.GridLineColor = System.Drawing.SystemColors.ControlLightLight
        Me.AlarmGridFirstLine.HeaderFont = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.AlarmGridFirstLine.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.AlarmGridFirstLine.Location = New System.Drawing.Point(8, 64)
        Me.AlarmGridFirstLine.Name = "AlarmGridFirstLine"
        Me.AlarmGridFirstLine.RowHeadersVisible = False
        Me.AlarmGridFirstLine.Size = New System.Drawing.Size(1256, 152)
        Me.AlarmGridFirstLine.TabIndex = 28
        '
        'CheckBoxAutoBottom
        '
        Me.CheckBoxAutoBottom.BackColor = System.Drawing.Color.Transparent
        Me.CheckBoxAutoBottom.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.CheckBoxAutoBottom.ForeColor = System.Drawing.Color.Yellow
        Me.CheckBoxAutoBottom.Location = New System.Drawing.Point(8, 567)
        Me.CheckBoxAutoBottom.Name = "CheckBoxAutoBottom"
        Me.CheckBoxAutoBottom.Size = New System.Drawing.Size(472, 24)
        Me.CheckBoxAutoBottom.TabIndex = 30
        Me.CheckBoxAutoBottom.Text = "Automatically Scroll to Bottom Row For Switching Operations"
        '
        'AlarmGrid
        '
        Me.AlarmGrid.AlternatingBackColor = System.Drawing.Color.White
        Me.AlarmGrid.BackgroundColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.AlarmGrid.CaptionVisible = False
        Me.AlarmGrid.ColumnHeadersVisible = False
        Me.AlarmGrid.DataMember = ""
        Me.AlarmGrid.Font = New System.Drawing.Font("Lucida Console", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.AlarmGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.AlarmGrid.Location = New System.Drawing.Point(8, 128)
        Me.AlarmGrid.marsDataGridCurrentRow = 0
        Me.AlarmGrid.Name = "AlarmGrid"
        Me.AlarmGrid.RowHeadersVisible = False
        Me.AlarmGrid.Size = New System.Drawing.Size(1256, 408)
        Me.AlarmGrid.TabIndex = 47
        '
        'DateTime
        '
        Me.DateTime.BackColor = System.Drawing.Color.Transparent
        Me.DateTime.Cursor = System.Windows.Forms.Cursors.Default
        Me.DateTime.Font = New System.Drawing.Font("Arial", 20.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.DateTime.ForeColor = System.Drawing.Color.Yellow
        Me.DateTime.Location = New System.Drawing.Point(792, 16)
        Me.DateTime.Name = "DateTime"
        Me.DateTime.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.DateTime.Size = New System.Drawing.Size(464, 33)
        Me.DateTime.TabIndex = 599
        Me.DateTime.Text = "Date"
        Me.DateTime.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'Label21
        '
        Me.Label21.BackColor = System.Drawing.Color.FromArgb(CType(224, Byte), CType(224, Byte), CType(224, Byte))
        Me.Label21.Location = New System.Drawing.Point(784, 8)
        Me.Label21.Name = "Label21"
        Me.Label21.Size = New System.Drawing.Size(480, 48)
        Me.Label21.TabIndex = 600
        '
        'ButtonClearEventLog
        '
        Me.ButtonClearEventLog.BackColor = System.Drawing.Color.FromArgb(CType(224, Byte), CType(224, Byte), CType(224, Byte))
        Me.ButtonClearEventLog.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.ButtonClearEventLog.Location = New System.Drawing.Point(520, 564)
        Me.ButtonClearEventLog.Name = "ButtonClearEventLog"
        Me.ButtonClearEventLog.Size = New System.Drawing.Size(160, 24)
        Me.ButtonClearEventLog.TabIndex = 601
        Me.ButtonClearEventLog.Text = "Clear Events Log"
        '
        'Label1
        '
        Me.Label1.BackColor = System.Drawing.Color.Silver
        Me.Label1.Location = New System.Drawing.Point(516, 560)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(168, 32)
        Me.Label1.TabIndex = 602
        '
        'PMACSalarm
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.BackColor = System.Drawing.Color.Black
        Me.ClientSize = New System.Drawing.Size(1274, 988)
        Me.Controls.Add(Me.ButtonClearEventLog)
        Me.Controls.Add(Me.DateTime)
        Me.Controls.Add(Me.Label21)
        Me.Controls.Add(Me.AlarmGrid)
        Me.Controls.Add(Me.CheckBoxAutoBottom)
        Me.Controls.Add(Me.AlarmGridFirstLine)
        Me.Controls.Add(Me.Label1)
        Me.Cursor = System.Windows.Forms.Cursors.Default
        Me.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
        Me.Location = New System.Drawing.Point(3, 29)
        Me.Name = "PMACSalarm"
        Me.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.StartPosition = System.Windows.Forms.FormStartPosition.WindowsDefaultBounds
        Me.Text = "PMACS Events Log"
        Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
        CType(Me.AlarmGridFirstLine, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.AlarmGrid, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub
#End Region
#Region "Upgrade Support "
    Private Shared m_vb6FormDefInstance As PMACSalarm
    Private Shared m_InitializingDefInstance As Boolean
    Public Shared Property DefInstance() As PMACSalarm
        Get
            If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then
                m_InitializingDefInstance = True
                m_vb6FormDefInstance = New PMACSalarm
                m_InitializingDefInstance = False
            End If
            DefInstance = m_vb6FormDefInstance
        End Get
        Set(ByVal Value As PMACSalarm)
            m_vb6FormDefInstance = Value
        End Set
    End Property
#End Region

#Region "Closing PMACS Events Log"
    '**********************************************************************
    ' Closing the PMACSalarm window
    '**********************************************************************
    Public Sub PMACSalarm_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
        PMACSalarm.DefInstance.Visible = False
        e.Cancel = True

    End Sub
#End Region

#Region "Clear Events Log"
    Private Sub ButtonClearEventLog_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonClearEventLog.Click
        Call ClearOperationsDataGrid()
    End Sub
#End Region
    
End Class