Module ShowRoutines
    
    Function ShowTabs(ByRef intStart As Short) As Short

        On Error Resume Next

        Dim i As Short
        Dim intCurTabs As Short
        Dim intWidth As Short
        Dim intTab As Short
        Dim TabArray(1) As TabPage

        ShowTabs = ER_NOERROR

        'need to clear out any existing tabs.
        intCurTabs = frmSELibrary.tabData.TabPages.Count
        If intCurTabs > intTotalTabs Then
            For i = 1 To intCurTabs - 1
                frmSELibrary.tabData.Controls.Item(1).Dispose()
                System.Windows.Forms.Application.DoEvents()
            Next
        End If
        ' display the first tab
        If intStart < 1 Then
            intStart = 1
        End If

        intTab = 1

        TabArray(0) = frmSELibrary.tabData.TabPages.Item(0)
        TabArray(0).Text = SEData(intTabArray(intStart - 1) - 1).Type

        ReDim TabArray(intTotalTabs)
        For i = intStart To intTotalTabs - 1
            TabArray(i) = New TabPage
            frmSELibrary.tabData.Controls.Add(TabArray(i))
            TabArray(i).Text = SEData(intTabArray(i) - 1).Type
        Next

        System.Windows.Forms.Application.DoEvents()

        frmSELibrary.tabData.SelectedIndex = 0

        ShowTabControls()

        System.Windows.Forms.Application.DoEvents()
    End Function
    Sub ShowHelp()

        On Error Resume Next

        frmHelp.Text = LH_HELPCAPTION


    End Sub
    Function ShowAbout() As Short

        On Error Resume Next
        frmAbout.Text = LA_ABOUTCAPTION
        frmAbout.labAbout1.Text = LA_TEXT1
        frmAbout.labAbout2.Text = LA_LIC1 & LA_LIC2 & LA_LIC3 & LA_LIC4

    End Function
    

    Sub ShowTabControls()

        On Error Resume Next

        intCurrentTab = intFirstTab + frmSELibrary.tabData.SelectedIndex
        'need to load class data in the class combobox.
        If LoadClassList() = ER_FATALERROR Then
            ' errors handled in function
        End If

        frmSELibrary.lblMessage.Text = ""
    End Sub
    Function ShowGraphic(ByRef intPartID As Short) As Short

        On Error Resume Next
        Dim strFile As String = ""
        Dim i, PartBase As Short

        ShowGraphic = ER_NOERROR

        If frmSELibrary.btnViewer.Text = LS_VIEWPART Then
            strFile = strGlobalPath & SEData(intPartID).DraftName
        Else
            strFile = strGlobalPath & SEData(intPartID).BasePart
        End If

        If CheckForFile(strFile) = ER_FILENOTFOUND Then
            ShowGraphic = ER_FILENOTFOUND
            frmSELibrary.vwrFile.Visible = False
            frmSELibrary.lblNoGraphic.Text = LS_NODRAWING
        Else
            frmSELibrary.vwrFile.Filename = strFile
            frmSELibrary.vwrFile.Visible = True
        End If

        System.Windows.Forms.Application.DoEvents()

    End Function
   
End Module
