﻿Imports System
Imports System.Linq
Imports System.Collections.Generic
Imports System.Text
Imports System.Windows.Forms
Imports Microsoft.WindowsCE.Forms
Imports System.Runtime.InteropServices
Imports Bt
Imports Bt.ScanLib
'Imports KDPA2000.BtScanLib
Imports BtScan2

Public Class frm2020
    Inherits System.Windows.Forms.Form
    Private btScanLib As BtScanLib
    Public Shared _frm2020 As frm2020
    Private scanHandler As Boolean = False

    Private Sub sDisp2020()

        wfLocation.Text = gstrctP2000.strLctnStart
        wfName.Text = gstrctKDHT.strUserName

    End Sub

    Private Sub frm2020_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        '// Case QVGA -> resolution to 1/2
        If System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width = 240 Then
            Call resolution.VGAtoQVGA(Me)
        End If

        Dim WKey As Short = 0
        Dim buf As String = ""
        Dim rtn As Integer = 0

        Try

            '' t[€ฬI[v“
            'rtn = WarpFrame1.Open()
            If (rtn <> 0) Then
                Err.Raise(vbObjectError + 1, gAppName, "WarpError")
            End If



#If Not Debug Then
            sSetImgFName(G_CONST_MID_H2020, WarpBox1)
#End If

            sDisp2020()

            ' tH[€EC“ ภs
            sMain()

            '' t[€ฬN[Y
            'rtn = WarpFrame1.Close()
            If (rtn <> 0) Then
                Err.Raise(vbObjectError + 1, gAppName, "WarpError")
            End If

            ' tH[€EN[Y
            'Me.Close()

            Exit Sub

        Catch ex As Exception
            gintStatus = ALL_STATUS.QUIT
            sErrLog(gAppName, "frm2020_Load", ex.ToString)
            Me.Close()
        End Try

    End Sub
    Public Sub sMain()

        'Dim WKey As Short
        'Dim buf As String
        'Dim rtn As Integer

        Try

            '' t[€ฬ—๐ฑฑษLqตทB
            'Do While (True)

            '    ' R[h“—อ
            '    WKey = WarpFrame1.Input(wfKey)

            '    If WKey = WKY_ENT Then

            '        'fSakusei2()

            '    ElseIf WKey = WKY_BCR Then


            '    ElseIf WKey = WKY_F1 Then
            '        gintStatus = ALL_STATUS.NAME
            '        Exit Do

            '    ElseIf WKey = WKY_F2 Then
            '        gintStatus = ALL_STATUS.QUIT
            '        Exit Do

            '    ElseIf WKey = WKY_ERROR Then

            '        f0.WarpCtrl1.MessageBox(G_CONST_EMT_WARP, G_CONST_EM_WARP, MWA_DB_WARNING, MWA_DB_OK)

            '    End If

            'Loop

            'Exit Sub

        Catch ex As Exception
            'gintStatus = ALL_STATUS.QUIT
            sErrLog(gAppName, "sMain", ex.ToString)
        End Try

    End Sub

    Private Sub frm2020_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
        Select Case e.KeyCode.ToString()
            Case "F1"
                gintStatus = ALL_STATUS.NAME
                Me.Close()
                Exit Sub
            Case "F2"
                gintStatus = ALL_STATUS.QUIT
                Me.Close()
                Exit Sub
        End Select
    End Sub
End Class