home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form EventDlg
- BorderStyle = 3 'Fixed Double
- Caption = "Communication Demo - Event Settings"
- ClientHeight = 4425
- ClientLeft = 1215
- ClientTop = 1755
- ClientWidth = 6150
- Height = 4830
- Icon = 0
- Left = 1155
- LinkMode = 1 'Source
- LinkTopic = "Form7"
- ScaleHeight = 4425
- ScaleWidth = 6150
- Top = 1410
- Width = 6270
- Begin CommandButton Cancel_Command
- Caption = "Cancel"
- Height = 375
- Left = 4200
- TabIndex = 20
- Top = 3840
- Width = 1815
- End
- Begin CommandButton OK_Command
- Caption = "OK"
- Height = 375
- Left = 2160
- TabIndex = 19
- Top = 3840
- Width = 1815
- End
- Begin CommandButton Reset_Command
- Caption = "Reset"
- Height = 375
- Left = 120
- TabIndex = 18
- Top = 3840
- Width = 1815
- End
- Begin Frame Error_Status_Frame
- Height = 1455
- Left = 2880
- TabIndex = 14
- Top = 2160
- Width = 3135
- Begin CheckBox Printer_Error_Check
- Caption = "Printer Error"
- Height = 255
- Left = 120
- TabIndex = 17
- Top = 960
- Width = 2895
- End
- Begin CheckBox Line_Status_Error_Check
- Caption = "Line Status Error"
- Height = 255
- Left = 120
- TabIndex = 16
- Top = 480
- Width = 2895
- End
- Begin Label Error_Status_Label
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "Error Status"
- Height = 255
- Left = 0
- TabIndex = 15
- Top = 90
- Width = 3135
- End
- End
- Begin Frame Status_Detected_Frame
- Height = 1455
- Left = 120
- TabIndex = 10
- Top = 2160
- Width = 2655
- Begin CheckBox Ring_Indicator_Check
- Caption = "Ring Indicator Detected"
- Height = 255
- Left = 120
- TabIndex = 13
- Top = 960
- Width = 2385
- End
- Begin CheckBox Break_Detected_Check
- Caption = "Break Detected"
- Height = 255
- Left = 120
- TabIndex = 12
- Top = 480
- Width = 2385
- End
- Begin Label Status_Detected_Label
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "Status Detected"
- Height = 255
- Left = 0
- TabIndex = 11
- Top = 90
- Width = 2655
- End
- End
- Begin Frame Events_Received_Frame
- Height = 1935
- Left = 2880
- TabIndex = 5
- Top = 120
- Width = 3135
- Begin CheckBox Last_Character_Sent_Check
- Caption = "Last Character Sent"
- Height = 255
- Left = 120
- TabIndex = 9
- Top = 1440
- Width = 2895
- End
- Begin CheckBox Event_Character_Received_Check
- Caption = "Event Character Received"
- Height = 255
- Left = 120
- TabIndex = 8
- Top = 960
- Width = 2895
- End
- Begin CheckBox Characters_Received_Check
- Caption = "Character Received in Queue"
- Enabled = 0 'False
- Height = 255
- Left = 120
- TabIndex = 7
- Top = 480
- Value = 2 'Grayed
- Width = 2895
- End
- Begin Label Events_Received_Label
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "Events Received"
- Height = 255
- Left = 0
- TabIndex = 6
- Top = 90
- Width = 3135
- End
- End
- Begin Frame Signal_Changes_Frame
- Height = 1935
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 2655
- Begin CheckBox Receive_Line_Detect_Check
- Caption = "Receive Line Detect"
- Height = 255
- Left = 120
- TabIndex = 4
- Top = 1440
- Width = 2385
- End
- Begin CheckBox Data_Set_Ready_Check
- Caption = "Data Set Ready"
- Height = 255
- Left = 120
- TabIndex = 3
- Top = 960
- Width = 2385
- End
- Begin CheckBox Clear_To_Send_Check
- Caption = "Clear To Send"
- Height = 255
- Left = 120
- TabIndex = 2
- Top = 480
- Width = 2385
- End
- Begin Label Signal_Changes_Label
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "Signal Changes"
- Height = 255
- Left = 0
- TabIndex = 1
- Top = 90
- Width = 2655
- End
- End
- Dim WorkEventMask As Integer
- Sub Break_Detected_Check_Click ()
- If Break_Detected_Check.Value Then
- WorkEventMask = WorkEventMask Or EV_BREAK
- Else
- WorkEventMask = WorkEventMask And (EV_ALL - EV_BREAK)
- End If
- End Sub
- Sub Cancel_Command_Click ()
- Unload EventDlg
- End Sub
- Sub Characters_Received_Check_Click ()
- If Characters_Received_Check.Value Then
- WorkEventMask = WorkEventMask Or EV_RXCHAR
- Else
- WorkEventMask = WorkEventMask And (EV_ALL - EV_RXCHAR)
- End If
- End Sub
- Sub Clear_To_Send_Check_Click ()
- If Clear_To_Send_Check.Value Then
- WorkEventMask = WorkEventMask Or EV_CTS
- Else
- WorkEventMask = WorkEventMask And (EV_ALL - EV_CTS)
- End If
- End Sub
- Sub Data_Set_Ready_Check_Click ()
- If Data_Set_Ready_Check.Value Then
- WorkEventMask = WorkEventMask Or EV_DSR
- Else
- WorkEventMask = WorkEventMask And (EV_ALL - EV_DSR)
- End If
- End Sub
- Sub Event_Character_Received_Check_Click ()
- If Event_Character_Received_Check.Value Then
- WorkEventMask = WorkEventMask Or EV_RXFLAG
- Else
- WorkEventMask = WorkEventMask And (EV_ALL - EV_RXFLAG)
- End If
- End Sub
- Sub Form_Load ()
- Remove_Items_From_SysMenu EventDlg
- Initialize
- CenterDialog EventDlg
- End Sub
- Sub Form_Paint ()
- UpdateCaption " DIALOG: " + caption, 0
- End Sub
- Sub Initialize ()
- WorkEventMask = CommEventMask
- Clear_To_Send_Check.Value = Abs((WorkEventMask And EV_CTS) = EV_CTS)
- Data_Set_Ready_Check.Value = Abs((WorkEventMask And EV_DSR) = EV_DSR)
- Receive_Line_Detect_Check.Value = Abs((WorkEventMask And EV_RLSD) = EV_RLSD)
- Characters_Received_Check.Value = Abs((WorkEventMask And EV_RXCHAR) = EV_RXCHAR)
- Event_Character_Received_Check.Value = Abs((WorkEventMask And EV_RXFLAG) = EV_RXFLAG)
- Last_Character_Sent_Check.Value = Abs((WorkEventMask And EV_TXEMPTY) = EV_TXEMPTY)
- Break_Detected_Check.Value = Abs((WorkEventMask And EV_BREAK) = EV_BREAK)
- Ring_Indicator_Check.Value = Abs((WorkEventMask And EV_RING) = EV_RING)
- Line_Status_Error_Check.Value = Abs((WorkEventMask And EV_ERR) = EV_ERR)
- Printer_Error_Check.Value = Abs((WorkEventMask And EV_PERR) = EV_PERR)
- End Sub
- Sub Last_Character_Sent_Check_Click ()
- If Last_Character_Sent_Check.Value Then
- WorkEventMask = WorkEventMask Or EV_TXEMPTY
- Else
- WorkEventMask = WorkEventMask And (EV_ALL - EV_TXEMPTY)
- End If
- End Sub
- Sub Line_Status_Error_Check_Click ()
- If Line_Status_Error_Check.Value Then
- WorkEventMask = WorkEventMask Or EV_ERR
- Else
- WorkEventMask = WorkEventMask And (EV_ALL - EV_ERR)
- End If
- End Sub
- Sub OK_Command_Click ()
- If CommDeviceNum > 0 And CommHandle > -1 Then
- If WorkEventMask = CommEventMask Then
- Unload EventDlg
- Exit Sub
- End If
- UpdateCaption " DIALOG: Change Active Settings (Yes), Post-Pone (No), Return to Dialog (Cancel)", 0
-
- Result% = MsgBox("Port Already Active!" + Chr$(13) + "Activate settings Now?", 3 + 16 + 256, "Terminal Sampler II - Port Active")
- Select Case Result%
- Case 6
- UpdateCaption " Changing Port Settings LIVE!", 0
-
- CommEventMask = WorkEventMask
- PostEventMask = WorkEventMask
- ApiErr% = SetCommEventMask(CommHandle, CommEventMask)
-
- Unload EventDlg
- Case 7
- UpdateCaption " Settings Post-Poned until next CONNECT", 0
-
- PostEventMask = WorkEventMask
-
- Unload EventDlg
- Case Else
- UpdateCaption " DIALOG: " + caption, 0
- End Select
- Else
-
- CommEventMask = WorkEventMask
- PostEventMask = WorkEventMask
- Unload EventDlg
- End If
- End Sub
- Sub Printer_Error_Check_Click ()
- If Printer_Error_Check.Value Then
- WorkEventMask = WorkEventMask Or EV_PERR
- Else
- WorkEventMask = WorkEventMask And (EV_ALL - EV_PERR)
- End If
- End Sub
- Sub Receive_Line_Detect_Check_Click ()
- If Receive_Line_Detect_Check.Value Then
- WorkEventMask = WorkEventMask Or EV_RLSD
- Else
- WorkEventMask = WorkEventMask And (EV_ALL - EV_RLSD)
- End If
- End Sub
- Sub Reset_Command_Click ()
- Initialize
- End Sub
- Sub Ring_Indicator_Check_Click ()
- If Ring_Indicator_Check.Value Then
- WorkEventMask = WorkEventMask Or EV_RING
- Else
- WorkEventMask = WorkEventMask And (EV_ALL - EV_RING)
- End If
- End Sub
-