aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-12-15 13:12:20 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-12-15 13:12:20 +0200
commit13c57f7ccabadd3ed75ffaef195d35c15c2a8c68 (patch)
tree938bd6dd844cf2645510aa3d42f3bfbe24e52a7e /Software/Visual_Studio/Tango.Touch
parentd1859415972bb991cba6639482c1cd2a9e19e8d8 (diff)
parent957ca86b8e899eb488626c456d9c37dd4545bd80 (diff)
downloadTango-13c57f7ccabadd3ed75ffaef195d35c15c2a8c68.tar.gz
Tango-13c57f7ccabadd3ed75ffaef195d35c15c2a8c68.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch')
-rw-r--r--Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml76
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardOutputMode.cs14
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs54
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.xaml2
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs16
-rw-r--r--Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj3
6 files changed, 112 insertions, 53 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml
index b5af0a754..ffe3d19dd 100644
--- a/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml
+++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.xaml
@@ -43,6 +43,44 @@
<!--</local:TouchNotificationBar>-->
</DockPanel>
+ <!--Dialogs-->
+ <Grid>
+ <Grid.Style>
+ <Style TargetType="Grid">
+ <!--<Setter Property="Opacity" Value="0"></Setter>-->
+ <Setter Property="Visibility" Value="Hidden"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource TemplatedParent},Path=HasDialog}" Value="True">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ <!--<DataTrigger.EnterActions>
+ <BeginStoryboard>
+ <Storyboard>
+ <DoubleAnimation To="1" Storyboard.TargetProperty="Opacity" Duration="00:00:0.2" />
+ </Storyboard>
+ </BeginStoryboard>
+ </DataTrigger.EnterActions>-->
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Grid.Style>
+
+ <Grid Background="#9E000000">
+ <i:Interaction.Triggers>
+ <i:EventTrigger EventName="MouseDown">
+ <i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentDialog.DataContext.CloseCommand}" />
+ </i:EventTrigger>
+ </i:Interaction.Triggers>
+ </Grid>
+
+ <Border Background="{StaticResource TangoPrimaryBackgroundBrush}" CornerRadius="5" Padding="10" HorizontalAlignment="Center" VerticalAlignment="Center">
+ <Border.Effect>
+ <DropShadowEffect BlurRadius="10" />
+ </Border.Effect>
+
+ <ContentPresenter Content="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentDialog}" />
+ </Border>
+ </Grid>
+
<!--Combo Box PopUp-->
<Grid Background="#9E000000" x:Name="PART_combobox_grid">
<Grid.Style>
@@ -131,44 +169,6 @@
</Grid>
</Grid>
- <!--Dialogs-->
- <Grid>
- <Grid.Style>
- <Style TargetType="Grid">
- <!--<Setter Property="Opacity" Value="0"></Setter>-->
- <Setter Property="Visibility" Value="Hidden"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource TemplatedParent},Path=HasDialog}" Value="True">
- <Setter Property="Visibility" Value="Visible"></Setter>
- <!--<DataTrigger.EnterActions>
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation To="1" Storyboard.TargetProperty="Opacity" Duration="00:00:0.2" />
- </Storyboard>
- </BeginStoryboard>
- </DataTrigger.EnterActions>-->
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Grid.Style>
-
- <Grid Background="#9E000000">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="MouseDown">
- <i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentDialog.DataContext.CloseCommand}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </Grid>
-
- <Border Background="{StaticResource TangoPrimaryBackgroundBrush}" CornerRadius="5" Padding="10" HorizontalAlignment="Center" VerticalAlignment="Center">
- <Border.Effect>
- <DropShadowEffect BlurRadius="10" />
- </Border.Effect>
-
- <ContentPresenter Content="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CurrentDialog}" />
- </Border>
- </Grid>
-
<!--Messages-->
<Grid Background="#9E000000">
<Grid.Style>
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardOutputMode.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardOutputMode.cs
new file mode 100644
index 000000000..978ae61ca
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardOutputMode.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.Touch.Keyboard
+{
+ public enum KeyboardOutputMode
+ {
+ Wpf,
+ Windows,
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs
index 786a1799a..67203b669 100644
--- a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs
@@ -26,6 +26,8 @@ namespace Tango.Touch.Keyboard
[ContentProperty(nameof(View))]
public partial class KeyboardView : Control
{
+ public event EventHandler KeyboardOpened;
+ public event EventHandler KeyboardClosed;
private static KeyboardView _instance;
private List<Object> _has_focus_objects = new List<object>();
@@ -43,6 +45,19 @@ namespace Tango.Touch.Keyboard
#region Properties
+ public static KeyboardView Default
+ {
+ get { return _instance; }
+ }
+
+ public static TouchKeyboard Keyboard
+ {
+ get
+ {
+ return Default.keyboard;
+ }
+ }
+
public bool IsOpened
{
get { return (bool)GetValue(IsOpenedProperty); }
@@ -59,6 +74,14 @@ namespace Tango.Touch.Keyboard
public static readonly DependencyProperty ViewProperty =
DependencyProperty.Register("View", typeof(FrameworkElement), typeof(KeyboardView), new PropertyMetadata(null));
+ public KeyboardOutputMode OutputMode
+ {
+ get { return (KeyboardOutputMode)GetValue(OutputModeProperty); }
+ set { SetValue(OutputModeProperty, value); }
+ }
+ public static readonly DependencyProperty OutputModeProperty =
+ DependencyProperty.Register("OutputMode", typeof(KeyboardOutputMode), typeof(KeyboardView), new PropertyMetadata(KeyboardOutputMode.Wpf));
+
#endregion
#region Attached Properties
@@ -112,21 +135,30 @@ namespace Tango.Touch.Keyboard
{
if (!IsOpened)
{
- if (GetContainer(_lastFocusedElement) != null)
+ if (OutputMode == KeyboardOutputMode.Wpf)
{
- var scrollViewers = this.FindVisualChildren<LightTouchScrollViewer>().ToList();
+ if (GetContainer(_lastFocusedElement) != null)
+ {
+ var scrollViewers = this.FindVisualChildren<LightTouchScrollViewer>().ToList();
- scrollViewers.ForEach(x => x.DisableScrolling = true);
+ scrollViewers.ForEach(x => x.DisableScrolling = true);
- ThicknessAnimation ani = new ThicknessAnimation();
- ani.Completed += (_, __) =>
- {
- scrollViewers.ForEach(x => x.DisableScrolling = false);
- };
- ani.To = new Thickness(0);
- ani.Duration = TimeSpan.FromSeconds(0.2);
- GetContainer(_lastFocusedElement).BeginAnimation(FrameworkElement.MarginProperty, ani);
+ ThicknessAnimation ani = new ThicknessAnimation();
+ ani.Completed += (_, __) =>
+ {
+ scrollViewers.ForEach(x => x.DisableScrolling = false);
+ };
+ ani.To = new Thickness(0);
+ ani.Duration = TimeSpan.FromSeconds(0.2);
+ GetContainer(_lastFocusedElement).BeginAnimation(FrameworkElement.MarginProperty, ani);
+ }
}
+
+ KeyboardClosed?.Invoke(this, new EventArgs());
+ }
+ else
+ {
+ KeyboardOpened?.Invoke(this, new EventArgs());
}
}
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.xaml b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.xaml
index 328820913..8458b4cab 100644
--- a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.xaml
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.xaml
@@ -42,7 +42,7 @@
</Style>
</Grid.Style>
<Border BorderThickness="0 1 0 0" BorderBrush="#404040">
- <local:TouchKeyboard x:Name="PART_Keyboard"></local:TouchKeyboard>
+ <local:TouchKeyboard x:Name="PART_Keyboard" OutputMode="{TemplateBinding OutputMode}"></local:TouchKeyboard>
</Border>
</Grid>
</Grid>
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs
index 1856fd2ac..9a6b7227f 100644
--- a/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs
@@ -67,6 +67,14 @@ namespace Tango.Touch.Keyboard
public static readonly DependencyProperty ModeProperty =
DependencyProperty.Register("Mode", typeof(TouchKeyboardMode), typeof(TouchKeyboard), new PropertyMetadata(TouchKeyboardMode.AlphaNumeric));
+ public KeyboardOutputMode OutputMode
+ {
+ get { return (KeyboardOutputMode)GetValue(OutputModeProperty); }
+ set { SetValue(OutputModeProperty, value); }
+ }
+ public static readonly DependencyProperty OutputModeProperty =
+ DependencyProperty.Register("OutputMode", typeof(KeyboardOutputMode), typeof(TouchKeyboard), new PropertyMetadata(KeyboardOutputMode.Wpf));
+
public KeyboardActionKeyMode ActionKeyMode
{
get { return (KeyboardActionKeyMode)GetValue(ActionKeyModeProperty); }
@@ -489,7 +497,7 @@ namespace Tango.Touch.Keyboard
}
- if (key.Length > 1 || (isSpecialChar && definition.KeysLinesDefinitions.SelectMany(x => x.KeyDefinitions).Select(x => x.StandardText).Contains(key)))
+ if (key.Length > 1 || (isSpecialChar && definition.KeysLinesDefinitions.SelectMany(x => x.KeyDefinitions).Select(x => x.StandardText).Contains(key)) || OutputMode == KeyboardOutputMode.Windows)
{
Core.Threading.ThreadFactory.StartNew(() =>
{
@@ -497,10 +505,14 @@ namespace Tango.Touch.Keyboard
{
Forms.SendKeys.SendWait(key);
}
- else
+ else if (key != " ")
{
Forms.SendKeys.SendWait("{" + key + "}");
}
+ else
+ {
+ Forms.SendKeys.SendWait(" ");
+ }
Forms.SendKeys.Flush();
});
diff --git a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj
index aa9027d6e..145511c55 100644
--- a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj
+++ b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj
@@ -363,6 +363,7 @@
<Compile Include="Keyboard\KeyboardDefinition.cs" />
<Compile Include="Keyboard\KeyboardModeToVisibilityConverter.cs" />
<Compile Include="Keyboard\KeyboardModeToVisibilityInverseConverter.cs" />
+ <Compile Include="Keyboard\KeyboardOutputMode.cs" />
<Compile Include="Keyboard\KeyboardView.cs" />
<Compile Include="Keyboard\KeyDefinition.cs" />
<Compile Include="Keyboard\KeysLineDefinition.cs" />
@@ -421,7 +422,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
+ <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file