Option Strict Off
Option Explicit On
Imports Microsoft.VisualBasic.PowerPacks
Friend Class ButtonGraphicInfoEditor
	Inherits System.Windows.Forms.Form
	
	'UPGRADE_WARNING: Arrays can't be declared with New. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="CC9D3AE5-6B95-4B43-91C7-28276302A5E8"'
    Private buttongroups() As decorationinfo = ADGEDotNetUt.ArrayUt(Of decorationinfo).NewArray1(4)
	Public selectedgroup As Short
	Public selectedlocation As Short
	Public selecteddoor As Integer
	'Public selectedsublocation As Integer
	Public subchange As Boolean
	Public subclickchange As Boolean
	Public selectedimage As Short
	Public tracking As Boolean
	Public savedx As Short
	Public savedy As Short
	Public savedw As Short
	Public savedh As Short
	
	
	'UPGRADE_NOTE: graphics was upgraded to graphics_Renamed. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
    Public Sub init()
        Dim i As Short

        'CBGraphic.Clear
        'CBGraphic.AddItem "-"
        'CBGraphic.ListIndex = 0

        'graphics.resetmodifiedcolorarray
        'CeilingGraphic.Picture = graphics.loadgraphic(77, 0)
        'Floorgraphic.Picture = graphics.loadgraphic(76, 0)
        '360 to 445
        'For i = 1 To 1
        '    CBGraphic.AddItem mapfile.getname(315 + i)
        'Next

        CGLocationList.Items.Clear()
        CGLocationList.Items.Add("00").SubItems.Add("D3 Right")
        CGLocationList.Items.Add("01").SubItems.Add("D3 Center")
        CGLocationList.Items.Add("02").SubItems.Add("D2 Center")
        CGLocationList.Items.Add("03").SubItems.Add("D1 Center")

        CGDoorList.Items.Clear()
        CGDoorList.Items.Add("00").SubItems.Add("Porticullas")
        CGDoorList.Items.Add("01").SubItems.Add("Wooden")
        CGDoorList.Items.Add("02").SubItems.Add("Iron")
        CGDoorList.Items.Add("03").SubItems.Add("Ra")
        'CGSubLocationList.Clear
        'CGSubLocationList.AddItem
        'CGSubLocationList.List(0, 0) = "00"
        'CGSubLocationList.List(0, 1) = "Far Left"
        'CGSubLocationList.AddItem
        'CGSubLocationList.List(1, 0) = "01"
        'CGSubLocationList.List(1, 1) = "Far Right"
        'CGSubLocationList.AddItem
        'CGSubLocationList.List(2, 0) = "02"
        'CGSubLocationList.List(2, 1) = "Near Right"
        'CGSubLocationList.AddItem
        'CGSubLocationList.List(3, 0) = "03"
        'CGSubLocationList.List(3, 1) = "Near Left"
        'CGSubLocationList.AddItem
        'CGSubLocationList.List(4, 0) = "04"
        'CGSubLocationList.List(4, 1) = "Center"

        For i = 1 To 4
            'UPGRADE_WARNING: Couldn't resolve default property of object graphics.f558. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            buttongroups(i).x1 = graphics.f558.buttonloc(i).x1
            'UPGRADE_WARNING: Couldn't resolve default property of object graphics.f558. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            buttongroups(i).x2 = graphics.f558.buttonloc(i).x2
            'UPGRADE_WARNING: Couldn't resolve default property of object graphics.f558. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            buttongroups(i).y1 = graphics.f558.buttonloc(i).y1
            'UPGRADE_WARNING: Couldn't resolve default property of object graphics.f558. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            buttongroups(i).y2 = graphics.f558.buttonloc(i).y2
            'UPGRADE_WARNING: Couldn't resolve default property of object graphics.f558. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            buttongroups(i).Width = graphics.f558.buttonloc(i).Width
            'UPGRADE_WARNING: Couldn't resolve default property of object graphics.f558. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            buttongroups(i).Height = graphics.f558.buttonloc(i).Height
        Next

        subchange = True
        'selectgroup (1)
        selectlocation((1))
        selectdoor((1))
        'selectsublocation (1)
        subchange = False

        update_Renamed()
    End Sub
	
    Private Sub Cancel_ClickEvent(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Cancel.Click
        Me.Close()
    End Sub
	
	'Private Sub CBGraphic_Click()
	'
	'    If subchange = True Then
	'        Exit Sub
	'    End If
	'
	'    subchange = True
	'    'selectedimage = 315 + CBGraphic.ListIndex
	'
	'    Dim i As Integer
	'    Dim j As Integer
	'
	'    'graphics.resetmodifiedcolorarray
	'
	'    'ButtonGraphic.Picture = graphics.loadgraphic(selectedimage, 0)
	'    'ButtonGraphic.Width = buttongroups(selectedlocation).Width * 4
	'    'ButtonGraphic.Height = buttongroups(selectedlocation).Height * 2
	'
	'
	'    'update
	'    subchange = False
	'End Sub
	
    Private Sub CGLocationList_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles CGLocationList.SelectedIndexChanged
        If CGLocationList.FocusedItem Is Nothing Then Exit Sub

        If subchange = True Then
            Exit Sub
        End If
        subchange = True
        selectlocation((CGLocationList.FocusedItem.Index + 1))
        subchange = False
    End Sub
    Private Sub CGDoorList_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles CGDoorList.SelectedIndexChanged
        If CGDoorList.FocusedItem Is Nothing Then Exit Sub

        If subchange = True Then
            Exit Sub
        End If
        subchange = True
        selectdoor((CGDoorList.FocusedItem.Index + 1))
        subchange = False
    End Sub
	
	'Private Sub CGSubLocationList_Click()
	'
	'    If subchange = True Then
	'        Exit Sub
	'    End If
	'    subchange = True
	'    selectsublocation (CGSubLocationList.ListIndex + 1)
	'    subchange = False
	'End Sub
	
	
	
    Private Sub GLocPointer_MouseDownEvent(ByVal eventSender As System.Object, ByVal eventArgs As MouseEventArgs) Handles GLocPointer.MouseDown

        If eventArgs.Button And Windows.Forms.MouseButtons.Left Then
            tracking = True
            savedx = buttongroups(selectedlocation).x1
            savedy = buttongroups(selectedlocation).y1
            savedw = buttongroups(selectedlocation).x2 - buttongroups(selectedlocation).x1
            savedh = buttongroups(selectedlocation).y2 - buttongroups(selectedlocation).y1
        End If

    End Sub
	
	'Private Sub ImageA_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
	'
	'    If Button = 2 Then
	'        X = X * 2
	'        X = X / 3
	'        Y = Y * 2
	'        Y = Y / 3
	'
	'        If selectedlocation = 2 Or selectedlocation = 5 Or selectedlocation = 8 Or selectedlocation = 10 Then
	'            X = X + 100
	'        End If
	'        If selectedlocation = 3 Or selectedlocation = 6 Or selectedlocation = 9 Or selectedlocation = 11 Then
	'            X = X - 100
	'        End If
	'
	'        If X > 255 Then
	'            X = 255
	'        End If
	'        If X < 0 Then
	'            X = 0
	'        End If
	'        If Y > 255 Then
	'            Y = 255
	'        End If
	'        If Y < 0 Then
	'            Y = 0
	'        End If
	'
	'
	'
	'        buttongroups(selectedgroup, selectedlocation).setloc selectedsublocation, 1, X
	'        buttongroups(selectedgroup, selectedlocation).setloc selectedsublocation, 2, Y
	'
	'        update
	'        'MsgBox "x=" + Str(X) + " y=" + Str(Y)
	'    End If
	'
	'End Sub
	
	
	
    Private Sub GLocPointer_MouseMoveEvent(ByVal eventSender As System.Object, ByVal eventArgs As MouseEventArgs) Handles GLocPointer.MouseMove
        Dim x2 As Single
        Dim y2 As Single
        If tracking = True Then
            subclickchange = True
#If False Then
            x2 = eventArgs.X * 4
            x2 = x2 / 3
            y2 = eventArgs.y * 4
            y2 = y2 / 3
#Else
            x2 = eventArgs.X
            y2 = eventArgs.Y
#End If
            x2 = x2 - 4
            y2 = y2 - 4
            x2 = x2 / 2
            y2 = y2 / 2

            x2 = x2 + savedx
            y2 = y2 + savedy
            If x2 < 0 Then
                x2 = 0
            End If
            If x2 + savedw > 255 Then
                x2 = 255 - savedw
            End If

            If y2 < 0 Then
                y2 = 0
            End If
            If y2 + savedh > 255 Then
                y2 = 255 - savedh
            End If

            buttongroups(selectedlocation).x1 = x2
            buttongroups(selectedlocation).y1 = y2
            buttongroups(selectedlocation).x2 = buttongroups(selectedlocation).x1 + savedw
            buttongroups(selectedlocation).y2 = buttongroups(selectedlocation).y1 + savedh
            'XCoord.Text = Str(x2)
            'YCoord.Text = Str(y2)

            update_Renamed()
            subclickchange = False
        End If

    End Sub
	
	
    Private Sub GLocPointer_MouseUpEvent(ByVal eventSender As System.Object, ByVal eventArgs As MouseEventArgs) Handles GLocPointer.MouseUp
        tracking = False
        'MsgBox "aasdf"
        update_Renamed()
    End Sub
	
    Private Sub Ok_ClickEvent(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Ok.Click
        Dim i As Short

        For i = 1 To 4
            graphics.f558.buttonloc(i).x1 = buttongroups(i).x1
            graphics.f558.buttonloc(i).x2 = buttongroups(i).x2
            graphics.f558.buttonloc(i).y1 = buttongroups(i).y1
            graphics.f558.buttonloc(i).y2 = buttongroups(i).y2
            graphics.f558.buttonloc(i).Width = buttongroups(i).Width
            graphics.f558.buttonloc(i).Height = buttongroups(i).Height
        Next
        Me.Close()
        App.graphics.f558.update()

    End Sub
	'Public Sub selectgroup(ByVal num As Integer)
	'    selectedgroup = num
	'    CGGroupList.ListIndex = num - 1
	'    update
	'End Sub
	
	Public Sub selectlocation(ByVal num As Short)
		selectedlocation = num
        CGLocationList.Items(num - 1).Focused = True
        MyUt.CheckSel(CGLocationList, num - 1, "BlueGem")
		X1Coord.Text = Str(buttongroups(selectedlocation).x1)
		X2Coord.Text = Str(buttongroups(selectedlocation).x2)
		Y1Coord.Text = Str(buttongroups(selectedlocation).y1)
		Y2Coord.Text = Str(buttongroups(selectedlocation).y2)
		GWidth.Text = Str(buttongroups(selectedlocation).width)
		GHeight.Text = Str(buttongroups(selectedlocation).height)
		update_Renamed()
	End Sub
	Public Sub selectdoor(ByVal num As Short)
		selecteddoor = num
        CGDoorList.Items(num - 1).Focused = True
        MyUt.CheckSel(CGDoorList, num - 1, "Topaz")
		update_Renamed()
	End Sub
	
	'Public Sub selectsublocation(ByVal num As Integer)
	'    selectedsublocation = num
	'    CGSubLocationList.ListIndex = num - 1
	'    update
	'End Sub
	
	'UPGRADE_NOTE: graphics was upgraded to graphics_Renamed. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
	'UPGRADE_NOTE: update was upgraded to update_Renamed. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
	Public Sub update_Renamed()
        Dim x2, x1, y2, y1 As Integer
        Dim i As Short
		
		'UPGRADE_WARNING: Couldn't resolve default property of object graphics.curPalette. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
		'UPGRADE_WARNING: Couldn't resolve default property of object graphics.gPALETTE_MAIN. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        graphics.curPalette = graphics.gPALETTE_MAIN
        Dim offscreen As Bitmap = New Bitmap(Graphic.ClientSize.Width, Graphic.ClientSize.Height)
        Using cv As Drawing.Graphics = Drawing.Graphics.FromImage(offscreen)
            graphics.fill(cv, 0, 0, Graphic.Width, Graphic.Height, System.Drawing.Color.Black)
            graphics.stretchbmpby(cv, 76, 0, 0, 0, 0, 200, 200)
            graphics.stretchbmpby(cv, 75, 0, 132, 0, 0, 200, 200)
            i = 107 + 3 * (selecteddoor - 1) + selectedlocation - 1
            If selectedlocation = 1 Then
                i = i + 1
                ' this is back right, different routine for drawing
                '107, 106, then 104
                graphics.drawgrect(cv, 107, -1, 10, 200)
                graphics.drawgrect(cv, 106, -1, 10, 200)
                graphics.drawgrect(cv, 104, -1, 10, 200)
                'door = 61
                graphics.drawgrect(cv, 61, i, 10, 200)
            Else
                'draw a strait corridor
                'draw 107, 108, far back left/right walls
                graphics.drawgrect(cv, 107, -1, 10, 200)
                graphics.drawgrect(cv, 108, -1, 10, 200)
                'if d3, draw 102,103
                If selectedlocation <= 2 Then
                    graphics.drawgrect(cv, 102, -1, 10, 200)
                    graphics.drawgrect(cv, 103, -1, 10, 200)
                    'door = 71
                    graphics.drawgrect(cv, 71, i, 10, 200)
                End If
                'draw 110, 111, medium left/right walls
                graphics.drawgrect(cv, 110, -1, 10, 200)
                graphics.drawgrect(cv, 111, -1, 10, 200)
                'if d2, draw 100,101
                If selectedlocation = 3 Then
                    graphics.drawgrect(cv, 100, -1, 10, 200)
                    graphics.drawgrect(cv, 101, -1, 10, 200)
                    'top part 95
                    graphics.drawgrect(cv, 95, -1, 10, 200)
                    'door = 41
                    graphics.drawgrect(cv, 41, i, 10, 200)
                End If
                'draw 113, 114, close left/right walls
                graphics.drawgrect(cv, 113, -1, 10, 200)
                graphics.drawgrect(cv, 114, -1, 10, 200)
                'if d1, draw 98, 99
                If selectedlocation = 4 Then
                    graphics.drawgrect(cv, 98, -1, 10, 200)
                    graphics.drawgrect(cv, 99, -1, 10, 200)
                    'top part 92
                    graphics.drawgrect(cv, 92, -1, 10, 200)
                    'door = 11
                    graphics.drawgrect(cv, 11, i, 10, 200)
                End If
                'draw 116, 117, immidiate left/right walls
                graphics.drawgrect(cv, 116, -1, 10, 200)
                graphics.drawgrect(cv, 117, -1, 10, 200)
                'Graphic.Refresh

            End If

            'UPGRADE_WARNING: Couldn't resolve default property of object x1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            x1 = buttongroups(selectedlocation).x1
            'UPGRADE_WARNING: Couldn't resolve default property of object y1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            y1 = buttongroups(selectedlocation).y1
            'UPGRADE_WARNING: Couldn't resolve default property of object x2. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            x2 = buttongroups(selectedlocation).x2
            y2 = buttongroups(selectedlocation).y2


            'UPGRADE_WARNING: Couldn't resolve default property of object x1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            X1Coord.Text = Str(x1)
            'UPGRADE_WARNING: Couldn't resolve default property of object y1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            Y1Coord.Text = Str(y1)
            'UPGRADE_WARNING: Couldn't resolve default property of object x2. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            X2Coord.Text = Str(x2)
            Y2Coord.Text = Str(y2)

            'If X > 0 Or Y > 0 Or subclickchange = True Then

            'UPGRADE_WARNING: Couldn't resolve default property of object x1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            x1 = x1 * 2
            'UPGRADE_WARNING: Couldn't resolve default property of object y1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            y1 = y1 * 2
            'UPGRADE_WARNING: Couldn't resolve default property of object x2. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            x2 = x2 * 2
            y2 = y2 * 2

            'UPGRADE_WARNING: Couldn't resolve default property of object Ix1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            GSelectBox.Left = x1 - 16
            'UPGRADE_WARNING: Couldn't resolve default property of object y1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            GSelectBox.Top = y1 - 16
            If subclickchange = False Then
                'UPGRADE_WARNING: Couldn't resolve default property of object x1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                GLocPointer.Left = x1 - 16
                'UPGRADE_WARNING: Couldn't resolve default property of object y1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                GLocPointer.Top = y1 - 16
            End If

            GSelectBox.Visible = True
            GLocPointer.Visible = True
            'Else
            '    HLine.Visible = False
            '    VLine.Visible = False
            '    SelectBox.Visible = False
            '    LocPointer.Visible = False
            'End If
            '164 close, 103 medium, 84 long
            'so at medium, the height is 62% of the normal
            'at long, the height is 50% of the normal
            'If CBGraphic.ListIndex > 0 Then

            'UPGRADE_WARNING: Couldn't resolve default property of object y1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            If y2 < y1 Then
                'UPGRADE_WARNING: Couldn't resolve default property of object y1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                y2 = y1 + 1
            End If
            'UPGRADE_WARNING: Couldn't resolve default property of object x1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            'UPGRADE_WARNING: Couldn't resolve default property of object x2. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            If x2 < x1 Then
                'UPGRADE_WARNING: Couldn't resolve default property of object x1. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                'UPGRADE_WARNING: Couldn't resolve default property of object x2. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                x2 = x1 + 1
            End If
            'ButtonGraphic.height = y2 - y1 + 1
            'ButtonGraphic.width = x2 - x1 + 1
            'ButtonGraphic.Left = ImageA.Left + x1
            'ButtonGraphic.Top = ImageA.Top + y1
            'ButtonGraphic.Visible = True

            graphics.stretchtransparentbmp(cv, 315, x1, y1, x2 - x1 + 2, y2 - y1 + 2, 0, 0, 10)
            'Else
            'ButtonGraphic.Visible = False
            'End If

        End Using
        Graphic.BackgroundImage = offscreen
        Graphic.BackgroundImageLayout = ImageLayout.None
        Graphic.Refresh()
	End Sub
	
	'UPGRADE_WARNING: Event X1Coord.TextChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub X1Coord_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles X1Coord.TextChanged
		If subchange = True Then
			Exit Sub
		End If
		subchange = True
		buttongroups(selectedlocation).x1 = App.EFChange8(X1Coord, 0, 255)
		update_Renamed()
		subchange = False
	End Sub
	
	'UPGRADE_WARNING: Event Y1Coord.TextChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub Y1Coord_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Y1Coord.TextChanged
		If subchange = True Then
			Exit Sub
		End If
		subchange = True
		buttongroups(selectedlocation).y1 = App.EFChange8(Y1Coord, 0, 255)
		update_Renamed()
		subchange = False
	End Sub
	
	
	
	'UPGRADE_WARNING: Event X2Coord.TextChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub X2Coord_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles X2Coord.TextChanged
		If subchange = True Then
			Exit Sub
		End If
		subchange = True
		buttongroups(selectedlocation).x2 = App.EFChange8(X2Coord, 0, 255)
		update_Renamed()
		subchange = False
	End Sub
	
	'UPGRADE_WARNING: Event Y2Coord.TextChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub Y2Coord_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Y2Coord.TextChanged
		If subchange = True Then
			Exit Sub
		End If
		subchange = True
		buttongroups(selectedlocation).y2 = App.EFChange8(Y2Coord, 0, 255)
		update_Renamed()
		subchange = False
	End Sub
	
	
	'UPGRADE_WARNING: Event Gheight.TextChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub Gheight_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Gheight.TextChanged
		If subchange = True Then
			Exit Sub
		End If
		subchange = True
		buttongroups(selectedlocation).height = App.EFChange8(GHeight, 0, 255)
		subchange = False
	End Sub
	'UPGRADE_WARNING: Event Gwidth.TextChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub Gwidth_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Gwidth.TextChanged
		If subchange = True Then
			Exit Sub
		End If
		subchange = True
		buttongroups(selectedlocation).width = App.EFChange8(GWidth, 0, 255)
		subchange = False
	End Sub

    Private Sub ButtonGraphicInfoEditor_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
        If e.CloseReason = CloseReason.UserClosing Then
            e.Cancel = True
            Hide()
        End If
    End Sub

    Private Sub ButtonGraphicInfoEditor_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        CGLocationList.SmallImageList = App.JewelIL
        CGDoorList.SmallImageList = App.JewelIL
    End Sub
End Class