813,7 → 813,7 |
else |
k++; |
} |
|
_WPisMouseCaptured = false; |
} |
|
GMapMarker _findWPMarker(string name) |
1060,16 → 1060,19 |
int iZoom; |
private void MainMap_StylusDown(object sender, StylusDownEventArgs e) |
{ |
var id = e.StylusDevice.Id; |
e.StylusDevice.Capture(MainMap); |
if (iFirstStylusID == -1) |
if (!_WPisMouseCaptured) |
{ |
iFirstStylusID = id; |
} |
else |
{ |
var id = e.StylusDevice.Id; |
e.StylusDevice.Capture(MainMap); |
if (iFirstStylusID == -1) |
{ |
iFirstStylusID = id; |
} |
else |
{ |
|
MainMap.CanDragMap = false; |
MainMap.CanDragMap = false; |
} |
} |
} |
private void MainMap_StylusUp(object sender, StylusEventArgs e) |
2400,6 → 2403,12 |
iTimeout++; |
} |
} |
Dispatcher.Invoke(() => |
{ |
// MainMap.ZoomAndCenterMarkers(null); |
MainMap.Position = new PointLatLng((double)dtWaypoints.Rows[0][3], (double)dtWaypoints.Rows[0][4]); |
MainMap.Zoom = 19; |
}); |
} |
/// <summary> |
/// Wrapper for _clearCopterWPList() |
2757,6 → 2766,17 |
if (GridWP != null) |
GridWP.Margin = new Thickness(GridWP.Margin.Left, 36 * UIScaleTopSlider.Value, GridWP.Margin.Right, GridWP.Margin.Bottom); |
} |
private void UIScaleOSDSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) |
{ |
if (!_init) |
{ |
if (WPStatus != null && (WPStatus.Visibility == Visibility.Visible)) |
GridOSD.Margin = new Thickness(GridOSD.Margin.Left, 36 * UIScaleTopSlider.Value + 36, GridOSD.Margin.Right, GridOSD.Margin.Bottom); |
else |
GridOSD.Margin = new Thickness(GridOSD.Margin.Left, 36 * UIScaleTopSlider.Value, GridOSD.Margin.Right, GridOSD.Margin.Bottom); |
} |
} |
|
/// <summary> |
/// restore the saved scalings for the fullscreen/normal window mode |
/// </summary> |
3512,9 → 3532,12 |
Dispatcher.Invoke(() => lblWPIndex.Content = k.ToString()); |
Dispatcher.Invoke(() => lblWPCount.Content = k.ToString()); |
Dispatcher.Invoke(() => dgvWP.Items.Refresh()); |
Thread.Sleep(10); |
Thread.Sleep(1); |
} |
_routeUpdate(); |
Dispatcher.Invoke(() => MainMap.Position = new PointLatLng((double)dtWaypoints.Rows[0][3], (double)dtWaypoints.Rows[0][4])); |
Dispatcher.Invoke(() => MainMap.Zoom = 19); |
// Dispatcher.Invoke(() => MainMap.ZoomAndCenterMarkers(null)); |
Dispatcher.Invoke(() => _routeUpdate()); |
} |
} |
} |
3624,6 → 3647,7 |
Dispatcher.Invoke(()=> |
{ |
wpMarker.Shape = new CustomMarkerWP(this, wpMarker, name, type); |
wpMarker.Tag = name; |
wpMarker.Offset = new System.Windows.Point(-11.5, -11.5); |
wpMarker.ZIndex = 100; |
_setMarkerColor(wpMarker, type); |
3630,9 → 3654,50 |
MainMap.Markers.Add(wpMarker); |
if (type == 0 || type == 3) |
wpList.Add(p); |
((CustomMarkerWP)wpMarker.Shape).positionChanged += _updateDTWPPos; |
((CustomMarkerWP)wpMarker.Shape).newPosition += _updateDTWPPosFin; |
((CustomMarkerWP)wpMarker.Shape).mouseCaptured += _WPMouseCatured; |
}); |
return wpMarker; |
} |
bool _WPisMouseCaptured = false; |
void _WPMouseCatured(bool isCaptured) |
{ |
_WPisMouseCaptured = isCaptured; |
MainMap.CanDragMap = !isCaptured; |
} |
void _updateDTWPPos(CustomMarkerWP wp) |
{ |
string sIndex = wp.WPText.Substring(1, wp.WPText.Length - 1); |
int index = Convert.ToInt16(sIndex) -1; |
GMapMarker p = ((GMapMarker)wp.DataContext); |
if (p != null && index < dtWaypoints.Rows.Count) |
{ |
//dtWaypoints.Rows[index][3] = p.Position.Lat; |
//dtWaypoints.Rows[index][4] = p.Position.Lng; |
//Dispatcher.Invoke(() => dgvWP.Items.Refresh()); |
if(wp.WPType == 0 | wp.WPType == 3) |
{ |
wpList[index] = p.Position; |
MainMap.Markers.Remove(mRouteWP); |
_routeUpdate(); |
} |
} |
} |
void _updateDTWPPosFin(CustomMarkerWP wp) |
{ |
string sIndex = wp.WPText.Substring(1, wp.WPText.Length - 1); |
int index = Convert.ToInt16(sIndex) -1; |
GMapMarker p = ((GMapMarker)wp.DataContext); |
if (p != null && index < dtWaypoints.Rows.Count) |
{ |
dtWaypoints.Rows[index][3] = p.Position.Lat; |
dtWaypoints.Rows[index][4] = p.Position.Lng; |
Dispatcher.Invoke(() => dgvWP.Items.Refresh()); |
} |
|
} |
|
void _setMarkerColor(GMapMarker wpMarker,int iType) |
{ |
if(wpMarker != null) |
4360,9 → 4425,11 |
MainMap.Markers.Remove(cWPBound.Tag as GMapMarker); |
|
createCircle(home.Position, dWPMaxRange); |
string s = comboBoxWPMaxRangeColor.SelectionBoxItem.ToString(); |
cWPBound.setColor(s); |
|
if (comboBoxWPMaxRangeColor.SelectionBoxItem != null) |
{ |
string s = comboBoxWPMaxRangeColor.SelectionBoxItem.ToString(); |
cWPBound.setColor(s); |
} |
} |
|
if (checkBoxShowWPMaxRange.IsChecked == false && (cWPBound != null && cWPBound.Tag != null)) |