Option Strict Off
Option Explicit On
Friend Class TextEditor
	Inherits System.Windows.Forms.Form
	
	Public itemnum As Short
	Public itemlen As Integer
    Public itemdata As IO.MemoryStream
	
    Private Sub Cancel_ClickEvent(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Cancel.Click
        Me.Close()
    End Sub
	
    Public Sub init()
        Dim data As String
        Dim s As String
        Dim i As Short


        'itemlen = App.graphics.itemsize(itemnum)
        'itemdata = App.graphics.itemstr(itemnum)
        itemlen = App.graphics.getgitemsize(itemnum)
        itemdata = App.graphics.getgitemdata(itemnum)
        s = ""
        For i = 1 To itemlen
            'UPGRADE_ISSUE: MidB function is not supported. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="367764E5-F3F8-4E43-AC3E-7FE0B5E074E2"'
            'UPGRADE_ISSUE: AscB function is not supported. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="367764E5-F3F8-4E43-AC3E-7FE0B5E074E2"'
            'UPGRADE_WARNING: Couldn't resolve default property of object data. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            itemdata.Position = i - 1
            data = New IO.BinaryReader(itemdata).ReadByte()
            s = s & Chr(data And &H7F)
            'UPGRADE_WARNING: Couldn't resolve default property of object data. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            If data >= 128 Then
                s = s & Chr(13) & Chr(10)
            End If
        Next

        Text_Renamed.Text = s
    End Sub
	
    Private Sub Ok_ClickEvent(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Ok.Click
        Me.Close()
    End Sub
End Class