# HG changeset patch # User ymh # Date 1253084847 -7200 # Node ID 5f547156bda62dd50d198d6d36f9bf15de6c02ab # Parent 70cca06f0a323b83b10f8868a5ce1316cd9d202f# Parent 3de4c1346bf474960f052aa4c97a007c624a8bf4 Merge from tip diff -r 70cca06f0a32 -r 5f547156bda6 src/FingersDance.Control.Menu/CustomSurfaceButton.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/FingersDance.Control.Menu/CustomSurfaceButton.cs Wed Sep 16 09:07:27 2009 +0200 @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Surface; +using Microsoft.Surface.Presentation; +using Microsoft.Surface.Presentation.Controls; + +namespace FingersDance.Control.Menu +{ + public class CustomSurfaceButton:SurfaceButton + { + string _Action = ""; + string _Ressource = ""; + + public string Action + { + get { return _Action; } + set { _Action = value; } + } + + public string Ressource + { + get { return _Ressource; } + set { _Ressource = value; } + } + + public CustomSurfaceButton() + { + this.ContactDown += GenerateAction; + this.Click += GenerateAction; + } + + private void GenerateAction(Object sender, EventArgs Event) + { + try + { + ActionFactory.ActionGenerator AG = (new ActionFactory.ActionFactory()).GetGenerator(); + FingersDance.Actions.ActionBase action = AG.GetAction("Action" + ((CustomSurfaceButton)sender).Content, null); + if (action != null) + { + //action.Execute(); + //this.debug.addToList(action.GetType().ToString()); + } + } + catch (Exception e) { } + } + } +} diff -r 70cca06f0a32 -r 5f547156bda6 src/FingersDance.Control.Menu/FingersDance.Control.Menu.csproj --- a/src/FingersDance.Control.Menu/FingersDance.Control.Menu.csproj Wed Sep 16 08:34:32 2009 +0200 +++ b/src/FingersDance.Control.Menu/FingersDance.Control.Menu.csproj Wed Sep 16 09:07:27 2009 +0200 @@ -88,6 +88,7 @@ + diff -r 70cca06f0a32 -r 5f547156bda6 src/FingersDance.Control.Menu/Item.cs --- a/src/FingersDance.Control.Menu/Item.cs Wed Sep 16 08:34:32 2009 +0200 +++ b/src/FingersDance.Control.Menu/Item.cs Wed Sep 16 09:07:27 2009 +0200 @@ -11,5 +11,6 @@ public List Items = new List(); public string Name = ""; public string Action = ""; + public string Ressource = ""; } } diff -r 70cca06f0a32 -r 5f547156bda6 src/FingersDance.Control.Menu/UserControlMenu.xaml --- a/src/FingersDance.Control.Menu/UserControlMenu.xaml Wed Sep 16 08:34:32 2009 +0200 +++ b/src/FingersDance.Control.Menu/UserControlMenu.xaml Wed Sep 16 09:07:27 2009 +0200 @@ -3,24 +3,472 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:Custom="http://schemas.microsoft.com/surface/2008" mc:Ignorable="d" x:Class="FingersDance.Control.Menu.UserControlMenu" x:Name="UserControl" - Width="245" Height="Auto" xmlns:Custom="http://schemas.microsoft.com/surface/2008"> + Width="245" Height="Auto" xmlns:Microsoft_Surface_Presentation_Generic="clr-namespace:Microsoft.Surface.Presentation.Generic;assembly=Microsoft.Surface.Presentation.Generic"> - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + \ No newline at end of file diff -r 70cca06f0a32 -r 5f547156bda6 src/FingersDance.Control.Menu/UserControlMenu.xaml.cs --- a/src/FingersDance.Control.Menu/UserControlMenu.xaml.cs Wed Sep 16 08:34:32 2009 +0200 +++ b/src/FingersDance.Control.Menu/UserControlMenu.xaml.cs Wed Sep 16 09:07:27 2009 +0200 @@ -54,29 +54,28 @@ try { StackPanel MItem = new StackPanel(); - Microsoft.Surface.Presentation.Controls.SurfaceButton ItemButton = new Microsoft.Surface.Presentation.Controls.SurfaceButton(); + CustomSurfaceButton ItemButton = new CustomSurfaceButton(); ItemButton.Content = item.Name; + ItemButton.Style = (Style)FindResource(item.Ressource); if (item.Items.Count > 0) { ItemButton.ContactDown += ButtonMenu_ContactDown; ItemButton.Click += ButtonMenu_ContactDown; MItem.Children.Add(ItemButton); StackPanel Temp = new StackPanel(); - Temp.Margin = new Thickness(15,0,0,0); foreach (Item elt in item.Items) try { Temp.Children.Add(CreateMenuItem(elt)); } catch (Exception) { } - Temp.Name = ItemButton.Content + "Panel"; + Temp.Name = ItemButton.Content.ToString().Replace(' ', '_') + "Panel"; Temp.Visibility = Visibility.Collapsed; MItem.Children.Add(Temp); } else { - ItemButton.ContactDown += GenerateAction; - ItemButton.Click += GenerateAction; + ItemButton.Action = item.Action; MItem.Children.Add(ItemButton); } return MItem; @@ -87,27 +86,12 @@ } } - private void GenerateAction(Object sender, RoutedEventArgs Event) - { - try - { - ActionFactory.ActionGenerator AG = (new ActionFactory.ActionFactory()).GetGenerator(); - FingersDance.Actions.ActionBase action = AG.GetAction("Action" + ((Microsoft.Surface.Presentation.Controls.SurfaceButton)sender).Content, null); - if (action != null) - { - //action.Execute(); - //this.debug.addToList(action.GetType().ToString()); - } - } - catch (Exception e) { } - } - private void ButtonMenu_ContactDown(object sender, RoutedEventArgs e) { - foreach (UIElement Child in ((Panel)((Microsoft.Surface.Presentation.Controls.SurfaceButton)sender).Parent).Children) + foreach (UIElement Child in ((Panel)((CustomSurfaceButton)sender).Parent).Children) try { - if (((StackPanel)Child).Name.Equals(((Microsoft.Surface.Presentation.Controls.SurfaceButton)sender).Content + "Panel")) + if (((StackPanel)Child).Name.Equals(((Microsoft.Surface.Presentation.Controls.SurfaceButton)sender).Content.ToString().Replace(' ', '_') + "Panel")) { if (((StackPanel)Child).Visibility == Visibility.Collapsed) { diff -r 70cca06f0a32 -r 5f547156bda6 src/FingersDance.Control.Pivot/UserControlPivot.xaml.cs --- a/src/FingersDance.Control.Pivot/UserControlPivot.xaml.cs Wed Sep 16 08:34:32 2009 +0200 +++ b/src/FingersDance.Control.Pivot/UserControlPivot.xaml.cs Wed Sep 16 09:07:27 2009 +0200 @@ -20,7 +20,7 @@ public UserControlPivot() { this.InitializeComponent(); - + // Insert code required on object creation below this point. } diff -r 70cca06f0a32 -r 5f547156bda6 src/FingersDance/Resources/menu.xml --- a/src/FingersDance/Resources/menu.xml Wed Sep 16 08:34:32 2009 +0200 +++ b/src/FingersDance/Resources/menu.xml Wed Sep 16 09:07:27 2009 +0200 @@ -8,66 +8,86 @@ Cinematographique - MouvCam1 - - MouvCam1 + Mouv Camera + + + MouvCam1 + + FingersDanceAnnotationButtonNiveau4 + MouvCam1 + + + MouvCam2 + + FingersDanceAnnotationButtonNiveau4 + MouvCam2 + + + FingersDanceAnnotationButtonNiveau3 + MouvCam - MouvCam2 - - MouvCam2 + Axe de Camera + + + Axe camera1 + + FingersDanceAnnotationButtonNiveau4 + Axecamera1 + + + Axe camera2 + + FingersDanceAnnotationButtonNiveau4 + Axecamera2 + + + Axe camera3 + + FingersDanceAnnotationButtonNiveau4 + Axecamera3 + + + Axe camera4 + + FingersDanceAnnotationButtonNiveau4 + Axecamera4 + + + FingersDanceAnnotationButtonNiveau3 + Axecamera + FingersDanceAnnotationButtonNiveau2 Cinematographique - - - Camera - - - Axe camera1 - - Axe camera1 - - - Axe camera2 - - Axe camera2 - - - Axe camera3 - - Axe camera3 - - - Axe camera4 - - Axe camera4 - - - Camera - + Choregraphique ChildChore1 + FingersDanceAnnotationButtonNiveau3 ChildChore1 ChildChore2 + FingersDanceAnnotationButtonNiveau3 ChildChore2 + FingersDanceAnnotationButtonNiveau2 Choregraphique + FingersDanceAnnotationButtonNiveau1 Annotation ButtonRecherche + FingersDanceAnnotationButtonNiveau1 ButtonRecherche