--- a/test/TestMenu/TestMenu/SurfaceWindow1.xaml Wed Aug 05 15:22:24 2009 +0200
+++ b/test/TestMenu/TestMenu/SurfaceWindow1.xaml Wed Aug 05 16:16:03 2009 +0200
@@ -9,6 +9,7 @@
</s:SurfaceWindow.Resources>
<Grid Background="{StaticResource WindowBackground}" >
- <s:SurfaceMenu x:Name="MyMenu" Cursor="None" Height="52" VerticalAlignment="Top" Margin="0,0,165,0"/>
+ <s:SurfaceMenu x:Name="MyMenu" Cursor="None" Height="52" VerticalAlignment="Bottom" Margin="77,0,88,179"/>
+ <s:ElementMenu HorizontalAlignment="Left" Margin="118,109,0,249" Width="122" x:Name="MyMenu2"/>
</Grid>
</s:SurfaceWindow>
--- a/test/TestMenu/TestMenu/SurfaceWindow1.xaml.cs Wed Aug 05 15:22:24 2009 +0200
+++ b/test/TestMenu/TestMenu/SurfaceWindow1.xaml.cs Wed Aug 05 16:16:03 2009 +0200
@@ -41,9 +41,6 @@
// Add handlers for Application activation events
AddActivationHandlers();
- ActionBase action = (new ActionFactory()).GenerateAction(Type.GetType("TestMenu" + ".ActionShowMessage"), "ok");
- if (action != null)
- action.Execute();
}
public SurfaceMenuItem CreateMenuItem(Item item)
@@ -51,10 +48,22 @@
SurfaceMenuItem MItem = new SurfaceMenuItem();
MItem.Header = item.name;
MItem.Visibility = Visibility.Visible;
+ if (item.Items.Count == 0)
+ {
+ MItem.ContactDown += GenerateAction;
+ MItem.Click += GenerateAction;
+ }
foreach (Item elt in item.Items) MItem.Items.Add(CreateMenuItem(elt));
return MItem;
}
+ private void GenerateAction(Object sender, EventArgs Event)
+ {
+ ActionBase action = (new ActionFactory()).GenerateAction(Type.GetType("TestMenu.Action" + ((SurfaceMenuItem)sender).Header), "Tu as cliqué sur " + ((SurfaceMenuItem)sender).Header);
+ if (action != null)
+ action.Execute();
+ }
+
/// <summary>
/// Occurs when the window is about to close.
/// </summary>
--- a/test/TestMenu/TestMenu/TestMenu.csproj Wed Aug 05 15:22:24 2009 +0200
+++ b/test/TestMenu/TestMenu/TestMenu.csproj Wed Aug 05 16:16:03 2009 +0200
@@ -113,6 +113,7 @@
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
+ <Compile Include="SurfaceClick.cs" />
<Compile Include="SurfaceWindow1.xaml.cs">
<DependentUpon>SurfaceWindow1.xaml</DependentUpon>
</Compile>
--- a/test/TestMenu/TestMenu/TestMenu.idc Wed Aug 05 15:22:24 2009 +0200
+++ b/test/TestMenu/TestMenu/TestMenu.idc Wed Aug 05 16:16:03 2009 +0200
@@ -1,1 +1,1 @@
-<Configurations active="Default"><Configuration name="Default"><Command val=""></Command><RunMode val="a host path through a shared folder"></RunMode><ShareFolders val=""></ShareFolders><RemoteDebugMonitor val="C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86\msvsmon.exe"></RemoteDebugMonitor><MonitorName val="VMDebug"></MonitorName><RemoteVM val=""></RemoteVM><StartMode val="No"></StartMode><TerminationMode val="No operation"></TerminationMode><CopyFiles val=""></CopyFiles><PreCommandLine val=""></PreCommandLine><PostCommandLine val=""></PostCommandLine><RecordingToReplay val=""></RecordingToReplay><ReplayVM val=""></ReplayVM><BaseSnapshotForRecording val=""></BaseSnapshotForRecording><HostDllPath val=""></HostDllPath></Configuration></Configurations>
+<Configurations active="Default"><Configuration name="Default"><Command val=""></Command><RunMode val="a host path through a shared folder"></RunMode><ShareFolders val=""></ShareFolders><RemoteDebugMonitor val="C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86\msvsmon.exe"></RemoteDebugMonitor><MonitorName val="VMDebug"></MonitorName><RemoteVM val="C:\Program Files\Microsoft SDKs\Surface\v1.0\Tools\Simulator\SurfaceSimulator.exe"></RemoteVM><StartMode val="No"></StartMode><TerminationMode val="No operation"></TerminationMode><CopyFiles val=""></CopyFiles><PreCommandLine val=""></PreCommandLine><PostCommandLine val=""></PostCommandLine><RecordingToReplay val="<No recordings found>"></RecordingToReplay><ReplayVM val=""></ReplayVM><BaseSnapshotForRecording val="<None>"></BaseSnapshotForRecording><HostDllPath val=""></HostDllPath></Configuration></Configurations>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/TestMenu/TestMenu/test.xml Wed Aug 05 16:16:03 2009 +0200
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Menu xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <Items>
+ <Item>
+ <name>Elt1</name>
+ <Items>
+ <Item>
+ <name>Elt1-1</name>
+ <Items>
+ <Item>
+ <name>ShowMessage</name>
+ <items/>
+ </Item>
+ <Item>
+ <name>Elt1-1_2</name>
+ <items/>
+ </Item>
+ <Item>
+ <name>Elt1-1_3</name>
+ <items/>
+ </Item>
+ </Items>
+ </Item>
+ <Item>
+ <name>Elt1-2</name>
+ <Items>
+ <Item>
+ <name>Elt1-2_1</name>
+ <items/>
+ </Item>
+ </Items>
+ </Item>
+ </Items>
+ </Item>
+ <Item>
+ <name>Elt2</name>
+ <Items>
+ <Item>
+ <name>Elt2-1</name>
+ <Items>
+ <Item>
+ <name>Elt2-1_1</name>
+ <items/>
+ </Item>
+ <Item>
+ <name>Elt2-1_2</name>
+ <items/>
+ </Item>
+ </Items>
+ </Item>
+ </Items>
+ </Item>
+ <Item>
+ <name>Elt3</name>
+ <Items/>
+ </Item>
+ </Items>
+</Menu>
\ No newline at end of file