aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Modules
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2020-06-01 10:02:35 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2020-06-01 10:02:35 +0300
commitfa4b140630ff8b39bfeb85affe5e42bcb53d02e9 (patch)
tree9f2c835903aa6cd3ff0e2b796aaec727e7eb2d8d /Software/Visual_Studio/FSE/Modules
parent0008603819e92278101b84254fce4755a4386538 (diff)
parentac66473a022e6eecf5d8d7a92eaa90a5e334be73 (diff)
downloadTango-fa4b140630ff8b39bfeb85affe5e42bcb53d02e9.tar.gz
Tango-fa4b140630ff8b39bfeb85affe5e42bcb53d02e9.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/FSE/Modules')
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Controls/RemoteDesktopControl.xaml4
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Controls/RemoteDesktopControl.xaml.cs6
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/RemoteDesktopViewVM.cs26
3 files changed, 34 insertions, 2 deletions
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Controls/RemoteDesktopControl.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Controls/RemoteDesktopControl.xaml
index a630dbac6..b3c3dbbc9 100644
--- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Controls/RemoteDesktopControl.xaml
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Controls/RemoteDesktopControl.xaml
@@ -43,8 +43,8 @@
<Grid HorizontalAlignment="Right" VerticalAlignment="Top">
<StackPanel Margin="0 5 27 0" Orientation="Horizontal">
- <controls:IconButton Cursor="Hand" ToolTip="Take snapshot" x:Name="btnSnapshot" Click="BtnSnapshot_Click" Command="{Binding TakeSnapshotCommand}" IsEnabled="{Binding RemoteDesktopProvider.InSession}" Icon="ImagePlus" Width="24" Height="24" Padding="0" />
- <material:PackIcon Margin="2 0 0 0" ToolTip="Active communication channel is active" Visibility="{Binding RemoteDesktopProvider.IsWebRtcActive,Converter={StaticResource BooleanToVisibilityConverter}}" VerticalAlignment="Center" Kind="LightningBoltCircle" Width="16" Height="16" Foreground="{StaticResource FSE_GreenBrush}" />
+ <controls:ToggleIconButton IsChecked="{Binding CursorVisible}" UncheckedIcon="CursorDefault" CheckedIcon="CursorDefault" UncheckedForeground="{StaticResource FSE_GrayBrush}" CheckedForeground="{StaticResource FSE_GreenBrush}" Cursor="Hand" ToolTip="Display remote cursor" IsEnabled="{Binding RemoteDesktopProvider.InSession}" Width="16" Height="16" Padding="0" />
+ <controls:IconButton Margin="7 0 0 0" Cursor="Hand" ToolTip="Take snapshot" x:Name="btnSnapshot" Click="BtnSnapshot_Click" Command="{Binding TakeSnapshotCommand}" IsEnabled="{Binding RemoteDesktopProvider.InSession}" Icon="ImagePlus" Width="24" Height="24" Padding="0" />
<controls:IconButton Margin="5 0 0 0" Cursor="Hand" ToolTip="Open in separate window" Icon="OpenInNew" Width="24" Height="24" Padding="0" Command="{Binding WindowsManager.DetachToWindowCommand}" CommandParameter="{Binding ElementName=remoteDesktopControl}" Visibility="{Binding ElementName=remoteDesktopControl,Path=(win:WindowsManagerHelper.IsDetached),Converter={StaticResource BooleanToVisibilityInverseConverter}}" />
</StackPanel>
</Grid>
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Controls/RemoteDesktopControl.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Controls/RemoteDesktopControl.xaml.cs
index c32ab3048..617c3ec44 100644
--- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Controls/RemoteDesktopControl.xaml.cs
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/Controls/RemoteDesktopControl.xaml.cs
@@ -34,6 +34,7 @@ namespace Tango.FSE.PPCConsole.Controls
img.PreviewMouseMove += Img_PreviewMouseMove;
img.PreviewKeyDown += Img_PreviewKeyDown;
img.PreviewKeyUp += Img_PreviewKeyUp;
+ img.PreviewMouseWheel += Img_PreviewMouseWheel;
}
private void Img_PreviewKeyDown(object sender, KeyEventArgs e)
@@ -73,6 +74,11 @@ namespace Tango.FSE.PPCConsole.Controls
_vm.OnMouseMove(e.GetPosition(img), new Size(img.ActualWidth, img.ActualHeight));
}
+ private void Img_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
+ {
+ _vm.OnMouseScroll(e.Delta, e.GetPosition(img), new Size(img.ActualWidth, img.ActualHeight));
+ }
+
private void BtnSnapshot_Click(object sender, RoutedEventArgs e)
{
rectSnapshot.StartDoubleAnimation(Rectangle.OpacityProperty, TimeSpan.FromSeconds(0.2), 1, 0, null, null, null, true);
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/RemoteDesktopViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/RemoteDesktopViewVM.cs
index b4a0b07ea..bedcf9b7a 100644
--- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/RemoteDesktopViewVM.cs
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.PPCConsole/ViewModels/RemoteDesktopViewVM.cs
@@ -57,6 +57,13 @@ namespace Tango.FSE.PPCConsole.ViewModels
set { _recordingTime = value; RaisePropertyChangedAuto(); }
}
+ private bool _cursorVisible;
+ public bool CursorVisible
+ {
+ get { return _cursorVisible; }
+ set { _cursorVisible = value; RaisePropertyChangedAuto(); SetCursorVisibility(); }
+ }
+
#endregion
#region Commands
@@ -127,6 +134,7 @@ namespace Tango.FSE.PPCConsole.ViewModels
base.OnApplicationStarted();
RemoteDesktopProvider.FrameReceived += RemoteDesktopProvider_FrameReceived;
+ RemoteDesktopProvider.SessionStopped += RemoteDesktopProvider_SessionStopped;
MachineProvider.MachineConnected += MachineProvider_MachineConnected;
}
@@ -162,6 +170,14 @@ namespace Tango.FSE.PPCConsole.ViewModels
private void RemoteDesktopProvider_FrameReceived(object sender, DesktopFrameReceivedEventArgs e)
{
Source = e.Source;
+ _cursorVisible = e.CursorVisible;
+ RaisePropertyChanged(nameof(CursorVisible));
+ }
+
+ private void RemoteDesktopProvider_SessionStopped(object sender, EventArgs e)
+ {
+ _cursorVisible = false;
+ RaisePropertyChanged(nameof(CursorVisible));
}
#endregion
@@ -216,6 +232,11 @@ namespace Tango.FSE.PPCConsole.ViewModels
RemoteDesktopProvider.MouseDoubleClick(changedButton, point, size);
}
+ public void OnMouseScroll(int delta, System.Windows.Point point, System.Windows.Size size)
+ {
+ RemoteDesktopProvider.MouseScroll(delta, point, size);
+ }
+
public void OnKeyboardDown(Key key, bool ctrlDown, bool shitDown, bool altDown)
{
RemoteDesktopProvider.KeyboardDown(key, ctrlDown, shitDown, altDown);
@@ -226,6 +247,11 @@ namespace Tango.FSE.PPCConsole.ViewModels
RemoteDesktopProvider.KeyboardUp(key, ctrlDown, shitDown, altDown);
}
+ private void SetCursorVisibility()
+ {
+ RemoteDesktopProvider.SetRemoteCursorVisibility(CursorVisible);
+ }
+
#endregion
#region Snapshot