Skip to content

Commit

Permalink
v115
Browse files Browse the repository at this point in the history
some updates
  • Loading branch information
dkxce committed Jan 19, 2022
1 parent 8e87932 commit 830be27
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 28 deletions.
72 changes: 47 additions & 25 deletions MultiPointRouteForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 39 additions & 1 deletion MultiPointRouteForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace KMZRebuilder
public partial class MultiPointRouteForm : Form
{
public List<NaviMapNet.MapPoint> OnMapPoints = new List<NaviMapNet.MapPoint>();
public bool EnableSorting = true;

object temp;
int trackingItem;
Expand All @@ -29,6 +30,20 @@ public MultiPointRouteForm()
this.DialogResult = DialogResult.Cancel;
}

public void SetListOfSearchResults()
{
this.Text = "OSM Search";
this.labelTop.Text = "OSM Search Results:";
this.labelBottom.Text = "Double click on item to show on map";
this.EnableSorting = false;
this.Width += 300;
this.pbox.Width += 300;
this.buttonCancel.Left += 300;
this.buttonOk.Left += 300;
this.pbox.ContextMenuStrip = this.contextMenuStrip2;
pbox.ItemCheck += (delegate(object sender, ItemCheckEventArgs e) { e.NewValue = CheckState.Checked; });
}

private const int WS_SYSMENU = 0x80000;
protected override CreateParams CreateParams
{
Expand Down Expand Up @@ -97,6 +112,7 @@ public void MoveDown()

public void MoveItem(int direction)
{
if (!EnableSorting) return;
if (pbox.SelectedItem == null || pbox.SelectedIndex < 0) return;
int newIndex = pbox.SelectedIndex + direction;
if (newIndex < 0 || newIndex >= pbox.Items.Count) return;
Expand All @@ -121,7 +137,8 @@ private void pbox_MouseDown(object sender, MouseEventArgs e)
if (pbox.SelectedIndex < 0) return;

if ((Control.ModifierKeys & Keys.Alt) == Keys.Alt)
{
{
if (!EnableSorting) return;
pbox.Cursor = Cursors.Hand;
trackingItem = pbox.SelectedIndex;
if (trackingItem >= 0)
Expand Down Expand Up @@ -321,6 +338,27 @@ public static string RemoveXMLNamespaces(string xml)
return outerXml;
}

private void pbox_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (pbox.SelectedIndex < 0) return;
if (onItemDoubleClick != null) onItemDoubleClick(this, e);
}

public EventHandler onSaveOnMap;
public MouseEventHandler onItemDoubleClick;
public int SelectedIndex { get { return pbox.SelectedIndex; } }
public object SelectedItem { get { return pbox.SelectedIndex < 0 ? null : pbox.SelectedItem; } }

private void contextMenuStrip2_Opening(object sender, CancelEventArgs e)
{
savePointToMapToolStripMenuItem.Enabled = pbox.SelectedIndex >= 0;
}

private void savePointToMapToolStripMenuItem_Click(object sender, EventArgs e)
{
if (pbox.SelectedIndex < 0) return;
if (onSaveOnMap != null) onSaveOnMap(this, e);
}
}


Expand Down
3 changes: 3 additions & 0 deletions MultiPointRouteForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,7 @@
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="contextMenuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>162, 17</value>
</metadata>
</root>
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("22.1.18.113")]
[assembly: AssemblyFileVersion("22.1.18.113")]
[assembly: AssemblyVersion("22.1.19.115")]
[assembly: AssemblyFileVersion("22.1.19.115")]
Binary file modified bin/Debug/KMZViewer.exe
Binary file not shown.

0 comments on commit 830be27

Please sign in to comment.