home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 October / CMCD1004.ISO / Software / Shareware / Programare / gpssdk / GPS.NET Global Positioning SDK 1.4.6.msi / Data1.cab / EditWaypointForm.vb3 < prev    next >
Encoding:
Text File  |  2004-08-25  |  22.9 KB  |  555 lines

  1. Imports StormSource.Gps
  2.  
  3. Public Class EditWaypointForm
  4.     Inherits System.Windows.Forms.Form
  5.  
  6. #Region " Windows Form Designer generated code "
  7.  
  8.     Public Sub New()
  9.         MyBase.New()
  10.  
  11.         'This call is required by the Windows Form Designer.
  12.         InitializeComponent()
  13.  
  14.         'Add any initialization after the InitializeComponent() call
  15.  
  16.     End Sub
  17.  
  18.     'Form overrides dispose to clean up the component list.
  19.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  20.         If disposing Then
  21.             If Not (components Is Nothing) Then
  22.                 components.Dispose()
  23.             End If
  24.         End If
  25.         MyBase.Dispose(disposing)
  26.     End Sub
  27.  
  28.     'Required by the Windows Form Designer
  29.     Private components As System.ComponentModel.IContainer
  30.  
  31.     'NOTE: The following procedure is required by the Windows Form Designer
  32.     'It can be modified using the Windows Form Designer.  
  33.     'Do not modify it using the code editor.
  34.     Friend WithEvents btnCancelButton As System.Windows.Forms.Button
  35.     Friend WithEvents WaypointNameLabel As System.Windows.Forms.Label
  36.     Friend WithEvents WaypointName As System.Windows.Forms.TextBox
  37.     Friend WithEvents SymbolLabel As System.Windows.Forms.Label
  38.     Friend WithEvents TabControl As System.Windows.Forms.TabControl
  39.     Friend WithEvents GeneralTab As System.Windows.Forms.TabPage
  40.     Friend WithEvents Position As System.Windows.Forms.TextBox
  41.     Friend WithEvents WaypointDisplayModeComboBox As System.Windows.Forms.ComboBox
  42.     Friend WithEvents WaypointSymbolComboBox As System.Windows.Forms.ComboBox
  43.     Friend WithEvents WaypointColorComboBox As System.Windows.Forms.ComboBox
  44.     Friend WithEvents ColorLabel As System.Windows.Forms.Label
  45.     Friend WithEvents DisplayModeLabel As System.Windows.Forms.Label
  46.     Friend WithEvents Depth As System.Windows.Forms.TextBox
  47.     Friend WithEvents DepthLabel As System.Windows.Forms.Label
  48.     Friend WithEvents Altitude As System.Windows.Forms.TextBox
  49.     Friend WithEvents AltitudeLabel As System.Windows.Forms.Label
  50.     Friend WithEvents City As System.Windows.Forms.TextBox
  51.     Friend WithEvents CityLabel As System.Windows.Forms.Label
  52.     Friend WithEvents Address As System.Windows.Forms.TextBox
  53.     Friend WithEvents AddressLabel As System.Windows.Forms.Label
  54.     Friend WithEvents Country As System.Windows.Forms.TextBox
  55.     Friend WithEvents CountryLabel As System.Windows.Forms.Label
  56.     Friend WithEvents State As System.Windows.Forms.TextBox
  57.     Friend WithEvents StateLabel As System.Windows.Forms.Label
  58.     Friend WithEvents IntersectingRoad As System.Windows.Forms.TextBox
  59.     Friend WithEvents IntersectingRoadLabel As System.Windows.Forms.Label
  60.     Friend WithEvents FacilityLabel As System.Windows.Forms.Label
  61.     Friend WithEvents Facility As System.Windows.Forms.TextBox
  62.     Friend WithEvents SaveButton As System.Windows.Forms.Button
  63.     Friend WithEvents PositionLabel As System.Windows.Forms.Label
  64.     Friend WithEvents Description As System.Windows.Forms.TextBox
  65.     Friend WithEvents DescriptionLabel As System.Windows.Forms.Label
  66.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  67.         Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(EditWaypointForm))
  68.         Me.WaypointDisplayModeComboBox = New System.Windows.Forms.ComboBox()
  69.         Me.WaypointSymbolComboBox = New System.Windows.Forms.ComboBox()
  70.         Me.WaypointNameLabel = New System.Windows.Forms.Label()
  71.         Me.WaypointName = New System.Windows.Forms.TextBox()
  72.         Me.btnCancelButton = New System.Windows.Forms.Button()
  73.         Me.SaveButton = New System.Windows.Forms.Button()
  74.         Me.Position = New System.Windows.Forms.TextBox()
  75.         Me.PositionLabel = New System.Windows.Forms.Label()
  76.         Me.Description = New System.Windows.Forms.TextBox()
  77.         Me.DescriptionLabel = New System.Windows.Forms.Label()
  78.         Me.SymbolLabel = New System.Windows.Forms.Label()
  79.         Me.ColorLabel = New System.Windows.Forms.Label()
  80.         Me.WaypointColorComboBox = New System.Windows.Forms.ComboBox()
  81.         Me.DisplayModeLabel = New System.Windows.Forms.Label()
  82.         Me.Depth = New System.Windows.Forms.TextBox()
  83.         Me.DepthLabel = New System.Windows.Forms.Label()
  84.         Me.Altitude = New System.Windows.Forms.TextBox()
  85.         Me.AltitudeLabel = New System.Windows.Forms.Label()
  86.         Me.City = New System.Windows.Forms.TextBox()
  87.         Me.CityLabel = New System.Windows.Forms.Label()
  88.         Me.Address = New System.Windows.Forms.TextBox()
  89.         Me.AddressLabel = New System.Windows.Forms.Label()
  90.         Me.Country = New System.Windows.Forms.TextBox()
  91.         Me.CountryLabel = New System.Windows.Forms.Label()
  92.         Me.State = New System.Windows.Forms.TextBox()
  93.         Me.StateLabel = New System.Windows.Forms.Label()
  94.         Me.IntersectingRoad = New System.Windows.Forms.TextBox()
  95.         Me.IntersectingRoadLabel = New System.Windows.Forms.Label()
  96.         Me.TabControl = New System.Windows.Forms.TabControl()
  97.         Me.GeneralTab = New System.Windows.Forms.TabPage()
  98.         Me.FacilityLabel = New System.Windows.Forms.Label()
  99.         Me.Facility = New System.Windows.Forms.TextBox()
  100.         Me.TabControl.SuspendLayout()
  101.         Me.GeneralTab.SuspendLayout()
  102.         Me.SuspendLayout()
  103.         '
  104.         'WaypointDisplayModeComboBox
  105.         '
  106.         Me.WaypointDisplayModeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  107.                                 Or System.Windows.Forms.AnchorStyles.Right)
  108.         Me.WaypointDisplayModeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
  109.         Me.WaypointDisplayModeComboBox.Location = New System.Drawing.Point(120, 126)
  110.         Me.WaypointDisplayModeComboBox.Name = "WaypointDisplayModeComboBox"
  111.         Me.WaypointDisplayModeComboBox.Size = New System.Drawing.Size(264, 21)
  112.         Me.WaypointDisplayModeComboBox.Sorted = True
  113.         Me.WaypointDisplayModeComboBox.TabIndex = 11
  114.         '
  115.         'WaypointSymbolComboBox
  116.         '
  117.         Me.WaypointSymbolComboBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  118.                                 Or System.Windows.Forms.AnchorStyles.Right)
  119.         Me.WaypointSymbolComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
  120.         Me.WaypointSymbolComboBox.Location = New System.Drawing.Point(120, 78)
  121.         Me.WaypointSymbolComboBox.Name = "WaypointSymbolComboBox"
  122.         Me.WaypointSymbolComboBox.Size = New System.Drawing.Size(264, 21)
  123.         Me.WaypointSymbolComboBox.Sorted = True
  124.         Me.WaypointSymbolComboBox.TabIndex = 7
  125.         '
  126.         'WaypointNameLabel
  127.         '
  128.         Me.WaypointNameLabel.Location = New System.Drawing.Point(9, 9)
  129.         Me.WaypointNameLabel.Name = "WaypointNameLabel"
  130.         Me.WaypointNameLabel.Size = New System.Drawing.Size(99, 15)
  131.         Me.WaypointNameLabel.TabIndex = 0
  132.         Me.WaypointNameLabel.Text = "Name:"
  133.         '
  134.         'WaypointName
  135.         '
  136.         Me.WaypointName.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  137.                                 Or System.Windows.Forms.AnchorStyles.Right)
  138.         Me.WaypointName.Location = New System.Drawing.Point(120, 6)
  139.         Me.WaypointName.Name = "WaypointName"
  140.         Me.WaypointName.Size = New System.Drawing.Size(264, 20)
  141.         Me.WaypointName.TabIndex = 1
  142.         Me.WaypointName.Text = ""
  143.         '
  144.         'btnCancelButton
  145.         '
  146.         Me.btnCancelButton.Anchor = (System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right)
  147.         Me.btnCancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel
  148.         Me.btnCancelButton.Location = New System.Drawing.Point(339, 396)
  149.         Me.btnCancelButton.Name = "btnCancelButton"
  150.         Me.btnCancelButton.Size = New System.Drawing.Size(72, 24)
  151.         Me.btnCancelButton.TabIndex = 2
  152.         Me.btnCancelButton.Text = "Cancel"
  153.         '
  154.         'SaveButton
  155.         '
  156.         Me.SaveButton.Anchor = (System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right)
  157.         Me.SaveButton.DialogResult = System.Windows.Forms.DialogResult.OK
  158.         Me.SaveButton.Location = New System.Drawing.Point(261, 396)
  159.         Me.SaveButton.Name = "SaveButton"
  160.         Me.SaveButton.Size = New System.Drawing.Size(72, 24)
  161.         Me.SaveButton.TabIndex = 1
  162.         Me.SaveButton.Text = "Save"
  163.         '
  164.         'Position
  165.         '
  166.         Me.Position.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  167.                                 Or System.Windows.Forms.AnchorStyles.Right)
  168.         Me.Position.Location = New System.Drawing.Point(120, 30)
  169.         Me.Position.Name = "Position"
  170.         Me.Position.Size = New System.Drawing.Size(264, 20)
  171.         Me.Position.TabIndex = 3
  172.         Me.Position.Text = ""
  173.         '
  174.         'PositionLabel
  175.         '
  176.         Me.PositionLabel.Location = New System.Drawing.Point(9, 33)
  177.         Me.PositionLabel.Name = "PositionLabel"
  178.         Me.PositionLabel.Size = New System.Drawing.Size(99, 15)
  179.         Me.PositionLabel.TabIndex = 2
  180.         Me.PositionLabel.Text = "Position:"
  181.         '
  182.         'Description
  183.         '
  184.         Me.Description.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  185.                                 Or System.Windows.Forms.AnchorStyles.Right)
  186.         Me.Description.Location = New System.Drawing.Point(120, 54)
  187.         Me.Description.Name = "Description"
  188.         Me.Description.Size = New System.Drawing.Size(264, 20)
  189.         Me.Description.TabIndex = 5
  190.         Me.Description.Text = ""
  191.         '
  192.         'DescriptionLabel
  193.         '
  194.         Me.DescriptionLabel.Location = New System.Drawing.Point(9, 57)
  195.         Me.DescriptionLabel.Name = "DescriptionLabel"
  196.         Me.DescriptionLabel.Size = New System.Drawing.Size(99, 15)
  197.         Me.DescriptionLabel.TabIndex = 4
  198.         Me.DescriptionLabel.Text = "Description:"
  199.         '
  200.         'SymbolLabel
  201.         '
  202.         Me.SymbolLabel.Location = New System.Drawing.Point(9, 81)
  203.         Me.SymbolLabel.Name = "SymbolLabel"
  204.         Me.SymbolLabel.Size = New System.Drawing.Size(99, 15)
  205.         Me.SymbolLabel.TabIndex = 6
  206.         Me.SymbolLabel.Text = "Symbol:"
  207.         '
  208.         'ColorLabel
  209.         '
  210.         Me.ColorLabel.Location = New System.Drawing.Point(9, 105)
  211.         Me.ColorLabel.Name = "ColorLabel"
  212.         Me.ColorLabel.Size = New System.Drawing.Size(99, 15)
  213.         Me.ColorLabel.TabIndex = 8
  214.         Me.ColorLabel.Text = "Color:"
  215.         '
  216.         'WaypointColorComboBox
  217.         '
  218.         Me.WaypointColorComboBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  219.                                 Or System.Windows.Forms.AnchorStyles.Right)
  220.         Me.WaypointColorComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
  221.         Me.WaypointColorComboBox.Location = New System.Drawing.Point(120, 102)
  222.         Me.WaypointColorComboBox.Name = "WaypointColorComboBox"
  223.         Me.WaypointColorComboBox.Size = New System.Drawing.Size(264, 21)
  224.         Me.WaypointColorComboBox.Sorted = True
  225.         Me.WaypointColorComboBox.TabIndex = 9
  226.         '
  227.         'DisplayModeLabel
  228.         '
  229.         Me.DisplayModeLabel.Location = New System.Drawing.Point(9, 129)
  230.         Me.DisplayModeLabel.Name = "DisplayModeLabel"
  231.         Me.DisplayModeLabel.Size = New System.Drawing.Size(99, 15)
  232.         Me.DisplayModeLabel.TabIndex = 10
  233.         Me.DisplayModeLabel.Text = "Display Mode:"
  234.         '
  235.         'Depth
  236.         '
  237.         Me.Depth.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  238.                                 Or System.Windows.Forms.AnchorStyles.Right)
  239.         Me.Depth.Location = New System.Drawing.Point(120, 174)
  240.         Me.Depth.Name = "Depth"
  241.         Me.Depth.Size = New System.Drawing.Size(264, 20)
  242.         Me.Depth.TabIndex = 15
  243.         Me.Depth.Text = ""
  244.         '
  245.         'DepthLabel
  246.         '
  247.         Me.DepthLabel.Location = New System.Drawing.Point(9, 177)
  248.         Me.DepthLabel.Name = "DepthLabel"
  249.         Me.DepthLabel.Size = New System.Drawing.Size(99, 15)
  250.         Me.DepthLabel.TabIndex = 14
  251.         Me.DepthLabel.Text = "Depth:"
  252.         '
  253.         'Altitude
  254.         '
  255.         Me.Altitude.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  256.                                 Or System.Windows.Forms.AnchorStyles.Right)
  257.         Me.Altitude.Location = New System.Drawing.Point(120, 150)
  258.         Me.Altitude.Name = "Altitude"
  259.         Me.Altitude.Size = New System.Drawing.Size(264, 20)
  260.         Me.Altitude.TabIndex = 13
  261.         Me.Altitude.Text = ""
  262.         '
  263.         'AltitudeLabel
  264.         '
  265.         Me.AltitudeLabel.Location = New System.Drawing.Point(9, 153)
  266.         Me.AltitudeLabel.Name = "AltitudeLabel"
  267.         Me.AltitudeLabel.Size = New System.Drawing.Size(99, 15)
  268.         Me.AltitudeLabel.TabIndex = 12
  269.         Me.AltitudeLabel.Text = "Altitude:"
  270.         '
  271.         'City
  272.         '
  273.         Me.City.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  274.                                 Or System.Windows.Forms.AnchorStyles.Right)
  275.         Me.City.Location = New System.Drawing.Point(120, 246)
  276.         Me.City.Name = "City"
  277.         Me.City.Size = New System.Drawing.Size(264, 20)
  278.         Me.City.TabIndex = 21
  279.         Me.City.Text = ""
  280.         '
  281.         'CityLabel
  282.         '
  283.         Me.CityLabel.Location = New System.Drawing.Point(9, 249)
  284.         Me.CityLabel.Name = "CityLabel"
  285.         Me.CityLabel.Size = New System.Drawing.Size(99, 15)
  286.         Me.CityLabel.TabIndex = 20
  287.         Me.CityLabel.Text = "City:"
  288.         '
  289.         'Address
  290.         '
  291.         Me.Address.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  292.                                 Or System.Windows.Forms.AnchorStyles.Right)
  293.         Me.Address.Location = New System.Drawing.Point(120, 222)
  294.         Me.Address.Name = "Address"
  295.         Me.Address.Size = New System.Drawing.Size(264, 20)
  296.         Me.Address.TabIndex = 19
  297.         Me.Address.Text = ""
  298.         '
  299.         'AddressLabel
  300.         '
  301.         Me.AddressLabel.Location = New System.Drawing.Point(9, 225)
  302.         Me.AddressLabel.Name = "AddressLabel"
  303.         Me.AddressLabel.Size = New System.Drawing.Size(99, 15)
  304.         Me.AddressLabel.TabIndex = 18
  305.         Me.AddressLabel.Text = "Address:"
  306.         '
  307.         'Country
  308.         '
  309.         Me.Country.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  310.                                 Or System.Windows.Forms.AnchorStyles.Right)
  311.         Me.Country.Location = New System.Drawing.Point(120, 294)
  312.         Me.Country.MaxLength = 2
  313.         Me.Country.Name = "Country"
  314.         Me.Country.Size = New System.Drawing.Size(264, 20)
  315.         Me.Country.TabIndex = 25
  316.         Me.Country.Text = ""
  317.         '
  318.         'CountryLabel
  319.         '
  320.         Me.CountryLabel.Location = New System.Drawing.Point(9, 297)
  321.         Me.CountryLabel.Name = "CountryLabel"
  322.         Me.CountryLabel.Size = New System.Drawing.Size(99, 15)
  323.         Me.CountryLabel.TabIndex = 24
  324.         Me.CountryLabel.Text = "Country:"
  325.         '
  326.         'State
  327.         '
  328.         Me.State.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  329.                                 Or System.Windows.Forms.AnchorStyles.Right)
  330.         Me.State.Location = New System.Drawing.Point(120, 270)
  331.         Me.State.MaxLength = 2
  332.         Me.State.Name = "State"
  333.         Me.State.Size = New System.Drawing.Size(264, 20)
  334.         Me.State.TabIndex = 23
  335.         Me.State.Text = ""
  336.         '
  337.         'StateLabel
  338.         '
  339.         Me.StateLabel.Location = New System.Drawing.Point(9, 273)
  340.         Me.StateLabel.Name = "StateLabel"
  341.         Me.StateLabel.Size = New System.Drawing.Size(99, 15)
  342.         Me.StateLabel.TabIndex = 22
  343.         Me.StateLabel.Text = "State:"
  344.         '
  345.         'IntersectingRoad
  346.         '
  347.         Me.IntersectingRoad.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  348.                                 Or System.Windows.Forms.AnchorStyles.Right)
  349.         Me.IntersectingRoad.Location = New System.Drawing.Point(120, 318)
  350.         Me.IntersectingRoad.Name = "IntersectingRoad"
  351.         Me.IntersectingRoad.Size = New System.Drawing.Size(264, 20)
  352.         Me.IntersectingRoad.TabIndex = 27
  353.         Me.IntersectingRoad.Text = ""
  354.         '
  355.         'IntersectingRoadLabel
  356.         '
  357.         Me.IntersectingRoadLabel.Location = New System.Drawing.Point(9, 321)
  358.         Me.IntersectingRoadLabel.Name = "IntersectingRoadLabel"
  359.         Me.IntersectingRoadLabel.Size = New System.Drawing.Size(99, 15)
  360.         Me.IntersectingRoadLabel.TabIndex = 26
  361.         Me.IntersectingRoadLabel.Text = "Intersecting Road:"
  362.         '
  363.         'TabControl
  364.         '
  365.         Me.TabControl.Anchor = (((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
  366.                                 Or System.Windows.Forms.AnchorStyles.Left) _
  367.                                 Or System.Windows.Forms.AnchorStyles.Right)
  368.         Me.TabControl.Controls.AddRange(New System.Windows.Forms.Control() {Me.GeneralTab})
  369.         Me.TabControl.Location = New System.Drawing.Point(9, 9)
  370.         Me.TabControl.Name = "TabControl"
  371.         Me.TabControl.SelectedIndex = 0
  372.         Me.TabControl.Size = New System.Drawing.Size(405, 375)
  373.         Me.TabControl.TabIndex = 0
  374.         '
  375.         'GeneralTab
  376.         '
  377.         Me.GeneralTab.Controls.AddRange(New System.Windows.Forms.Control() {Me.FacilityLabel, Me.Facility, Me.CountryLabel, Me.State, Me.StateLabel, Me.AddressLabel, Me.Address, Me.CityLabel, Me.City, Me.Country, Me.IntersectingRoad, Me.WaypointColorComboBox, Me.WaypointDisplayModeComboBox, Me.DisplayModeLabel, Me.WaypointNameLabel, Me.IntersectingRoadLabel, Me.PositionLabel, Me.Depth, Me.WaypointSymbolComboBox, Me.WaypointName, Me.Position, Me.Description, Me.AltitudeLabel, Me.DepthLabel, Me.SymbolLabel, Me.Altitude, Me.ColorLabel, Me.DescriptionLabel})
  378.         Me.GeneralTab.Location = New System.Drawing.Point(4, 22)
  379.         Me.GeneralTab.Name = "GeneralTab"
  380.         Me.GeneralTab.Size = New System.Drawing.Size(397, 349)
  381.         Me.GeneralTab.TabIndex = 0
  382.         Me.GeneralTab.Text = "General"
  383.         '
  384.         'FacilityLabel
  385.         '
  386.         Me.FacilityLabel.Location = New System.Drawing.Point(9, 201)
  387.         Me.FacilityLabel.Name = "FacilityLabel"
  388.         Me.FacilityLabel.Size = New System.Drawing.Size(99, 15)
  389.         Me.FacilityLabel.TabIndex = 16
  390.         Me.FacilityLabel.Text = "Facility Name:"
  391.         '
  392.         'Facility
  393.         '
  394.         Me.Facility.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  395.                                 Or System.Windows.Forms.AnchorStyles.Right)
  396.         Me.Facility.Location = New System.Drawing.Point(120, 198)
  397.         Me.Facility.Name = "Facility"
  398.         Me.Facility.Size = New System.Drawing.Size(264, 20)
  399.         Me.Facility.TabIndex = 17
  400.         Me.Facility.Text = ""
  401.         '
  402.         'EditWaypointForm
  403.         '
  404.         Me.AcceptButton = Me.SaveButton
  405.         Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
  406.         Me.CancelButton = Me.btnCancelButton
  407.         Me.ClientSize = New System.Drawing.Size(423, 433)
  408.         Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.TabControl, Me.btnCancelButton, Me.SaveButton})
  409.         Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
  410.         Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
  411.         Me.MaximizeBox = False
  412.         Me.MinimizeBox = False
  413.         Me.Name = "EditWaypointForm"
  414.         Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
  415.         Me.Text = "Edit Waypoint"
  416.         Me.TabControl.ResumeLayout(False)
  417.         Me.GeneralTab.ResumeLayout(False)
  418.         Me.ResumeLayout(False)
  419.  
  420.     End Sub
  421.  
  422. #End Region
  423.  
  424.     Private pWaypoint As Waypoint
  425.  
  426.     ' Returns/sets the waypoint being edited by this form
  427.     Public Property Waypoint() As Waypoint
  428.         Get
  429.             Return pWaypoint
  430.         End Get
  431.         Set(ByVal Value As Waypoint)
  432.             ' Remember the waypoint for editing later on
  433.             pWaypoint = Value
  434.  
  435.             ' Update the form with the values
  436.             WaypointName.Text = pWaypoint.Name
  437.             Position.Text = pWaypoint.ToString
  438.             Description.Text = pWaypoint.Description
  439.             Facility.Text = pWaypoint.Facility
  440.             Address.Text = pWaypoint.Address
  441.             City.Text = pWaypoint.City
  442.             State.Text = pWaypoint.State
  443.             Country.Text = pWaypoint.Country
  444.             IntersectingRoad.Text = pWaypoint.IntersectingRoad
  445.  
  446.             ' Update the altitude depth. Are we using the Imperial or Metric system?
  447.             If System.Globalization.RegionInfo.CurrentRegion.IsMetric Then
  448.                 ' Yes. Use meters
  449.                 Altitude.Text = pWaypoint.Altitude.ToMeters.ToString
  450.             Else
  451.                 ' No. Use feet
  452.                 Altitude.Text = pWaypoint.Altitude.ToFeet.ToString
  453.             End If
  454.  
  455.             ' Update the waypoint depth.  Are we using the Imperial or Metric system?
  456.             If System.Globalization.RegionInfo.CurrentRegion.IsMetric Then
  457.                 ' Yes. Use meters
  458.                 Depth.Text = pWaypoint.Depth.ToMeters.ToString
  459.             Else
  460.                 ' No. Use feet
  461.                 Depth.Text = pWaypoint.Depth.ToFeet.ToString
  462.             End If
  463.  
  464.             ' Populate the combo box with the list of available waypoint symbols
  465.             WaypointSymbolComboBox.Items.Clear()
  466.             WaypointSymbolComboBox.Items.AddRange(pWaypoint.Device.GetSymbols)
  467.  
  468.             ' Set the selected item to that of the waypoint
  469.             WaypointSymbolComboBox.SelectedIndex = WaypointSymbolComboBox.FindString(pWaypoint.Symbol.ToString)
  470.  
  471.             ' Populate the color combo box with the list of available waypoint symbols
  472.             WaypointColorComboBox.Items.Clear()
  473.             WaypointColorComboBox.Items.AddRange(pWaypoint.Device.GetColors)
  474.  
  475.             ' Set the selected item to that of the waypoint
  476.             WaypointColorComboBox.SelectedIndex = WaypointColorComboBox.FindString(pWaypoint.Color.ToString)
  477.  
  478.             ' Populate the display mode box with the list of available waypoint symbols
  479.             WaypointDisplayModeComboBox.Items.Clear()
  480.             WaypointDisplayModeComboBox.Items.AddRange(pWaypoint.Device.GetDisplayModes)
  481.  
  482.             ' Set the selected item to that of the waypoint
  483.             WaypointDisplayModeComboBox.SelectedIndex = WaypointDisplayModeComboBox.FindString(pWaypoint.DisplayMode.ToString)
  484.  
  485.             ' Now, enable/disable features based on the capabilities of the device
  486.             Description.Enabled = pWaypoint.Device.SupportsWaypointComment
  487.             Address.Enabled = pWaypoint.Device.SupportsWaypointAddress
  488.             WaypointSymbolComboBox.Enabled = pWaypoint.Device.SupportsWaypointSymbol
  489.             WaypointColorComboBox.Enabled = pWaypoint.Device.SupportsWaypointColor
  490.             WaypointDisplayModeComboBox.Enabled = pWaypoint.Device.SupportsWaypointDisplayMode
  491.             Facility.Enabled = pWaypoint.Device.SupportsWaypointFacility
  492.             Address.Enabled = pWaypoint.Device.SupportsWaypointAddress
  493.             City.Enabled = pWaypoint.Device.SupportsWaypointCity
  494.             State.Enabled = pWaypoint.Device.SupportsWaypointState
  495.             Country.Enabled = pWaypoint.Device.SupportsWaypointCountry
  496.             IntersectingRoad.Enabled = pWaypoint.Device.SupportsWaypointIntersectingRoad
  497.         End Set
  498.     End Property
  499.  
  500.     Private Sub SaveButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveButton.Click
  501.         Try
  502.             ' Update the waypoint with values from the form
  503.             Waypoint.Name = Me.WaypointName.Text
  504.             ' Update the position
  505.             Dim NewPosition As Position = StormSource.Gps.Position.Parse(Position.Text)
  506.             Waypoint.Latitude = NewPosition.Latitude
  507.             Waypoint.Longitude = NewPosition.Longitude
  508.             ' Update the comment
  509.             Waypoint.Description = Me.Description.Text
  510.             ' Update the symbol
  511.             Waypoint.Symbol = System.Enum.Parse(GetType(WaypointSymbol), WaypointSymbolComboBox.Text)
  512.             ' Update the color
  513.             Waypoint.Color = System.Enum.Parse(GetType(WaypointColor), WaypointColorComboBox.Text)
  514.             ' Update the symbol
  515.             Waypoint.DisplayMode = System.Enum.Parse(GetType(WaypointDisplayMode), WaypointDisplayModeComboBox.Text)
  516.             ' Update the altitude
  517.             Dim NewAltitude As Distance = Distance.Parse(Me.Altitude.Text)
  518.             Waypoint.Altitude = NewAltitude
  519.             ' Update the depth
  520.             Dim NewDepth As Distance = Distance.Parse(Me.Depth.Text)
  521.             Waypoint.Depth = NewDepth
  522.             ' Update the facility
  523.             Waypoint.Facility = Me.Facility.Text
  524.             ' Update the address
  525.             Waypoint.Address = Me.Address.Text
  526.             Waypoint.City = Me.City.Text
  527.             Waypoint.State = Me.State.Text
  528.             Waypoint.Country = Me.Country.Text
  529.             ' Update the intersecting road/intersection
  530.             Waypoint.IntersectingRoad = Me.IntersectingRoad.Text
  531.         Catch ex As Exception
  532.             ' Some error occurred while try to update waypoint information
  533.             MessageBox.Show(ex.Message, "Form Information is Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  534.             Exit Sub
  535.         End Try
  536.         Try
  537.             ' Save changes to this waypoint
  538.             Waypoint.Save()
  539.             ' Refresh the waypoints collection
  540.             Waypoint.Device.Receiver.Waypoints.Refresh()
  541.             ' Unload this form
  542.             Close()
  543.         Catch ex As Exception
  544.             ' Notify of the problem saving the waypoint
  545.             MessageBox.Show(ex.Message, "Unable to Save Waypoint", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  546.             Exit Sub
  547.         End Try
  548.     End Sub
  549.  
  550.     ' Raised when editing of a waypoint has been cancelled
  551.     Private Sub CancelButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancelButton.Click
  552.         Close()
  553.     End Sub
  554. End Class
  555.