Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Albert78
committed
May 28, 2010
1 parent
2c24aa0
commit 63a4a4a
Showing
8 changed files
with
231 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 48 additions & 34 deletions
82
MP-II/Resources/GUITestPlugin/Skin/default/screens/gui-test-main.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,50 @@ | ||
<DockPanel | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Include | ||
xmlns="www.team-mediaportal.com/2008/mpf/directx" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
LastChildFill="True"> | ||
<Grid DockPanel.Dock="Center" Margin="30"> | ||
<Grid.Resources> | ||
<Model x:Key="Model" Id="F4FC1599-F412-40d0-82BF-46FC352E93BE"/> <!-- GUI-Test-Model --> | ||
</Grid.Resources> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="50*"/> | ||
<ColumnDefinition Width="50*"/> | ||
</Grid.ColumnDefinitions> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
</Grid.RowDefinitions> | ||
<Button Grid.Column="0" Grid.Row="0" Style="{StaticResource ButtonStyle}" Content="Brushes/transforms test 1" | ||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" | ||
Command="{Command Source={Service ScreenManager},Path=ShowScreen,Parameters=test-brushes-transforms1}"/> | ||
<Button Grid.Column="0" Grid.Row="1" Style="{StaticResource ButtonStyle}" Content="Brushes/transforms test 2" | ||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" | ||
Command="{Command Source={Service ScreenManager},Path=ShowScreen,Parameters=test-brushes-transforms2}"/> | ||
<Button Grid.Column="0" Grid.Row="2" Style="{StaticResource ButtonStyle}" Content="Opacity mask test" | ||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" | ||
Command="{Command Source={Service ScreenManager},Path=ShowScreen,Parameters=test-opacitymask}"/> | ||
<Button Grid.Column="0" Grid.Row="3" Style="{StaticResource ButtonStyle}" Content="Text elements/transforms test" | ||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" | ||
Command="{Command Source={Service ScreenManager},Path=ShowScreen,Parameters=test-text-transforms}"/> | ||
<Button Grid.Column="0" Grid.Row="4" Style="{StaticResource ButtonStyle}" Content="Transforms test" | ||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" | ||
Command="{Command Source={Service ScreenManager},Path=ShowScreen,Parameters=test-transforms}"/> | ||
</Grid> | ||
</DockPanel> | ||
Source="screens\master_menu.xaml" | ||
> | ||
<Include.Resources> | ||
|
||
<!-- Header --> | ||
<ResourceWrapper x:Key="Header_Text" Resource="GUI tests"/> | ||
|
||
<!-- Contents --> | ||
<ResourceWrapper x:Key="Contents_Element"> | ||
<DockPanel LastChildFill="True"> | ||
<Grid DockPanel.Dock="Center" Margin="30"> | ||
<Grid.Resources> | ||
<Model x:Key="Model" Id="F4FC1599-F412-40d0-82BF-46FC352E93BE"/> <!-- GUI-Test-Model --> | ||
</Grid.Resources> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="50*"/> | ||
<ColumnDefinition Width="50*"/> | ||
</Grid.ColumnDefinitions> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
</Grid.RowDefinitions> | ||
<Button Grid.Column="0" Grid.Row="0" Style="{StaticResource ButtonStyle}" Content="Brushes/transforms test 1" | ||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" | ||
Command="{Command Source={Service ScreenManager},Path=ShowScreen,Parameters=test-brushes-transforms1}"/> | ||
<Button Grid.Column="0" Grid.Row="1" Style="{StaticResource ButtonStyle}" Content="Brushes/transforms test 2" | ||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" | ||
Command="{Command Source={Service ScreenManager},Path=ShowScreen,Parameters=test-brushes-transforms2}"/> | ||
<Button Grid.Column="0" Grid.Row="2" Style="{StaticResource ButtonStyle}" Content="Opacity mask test" | ||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" | ||
Command="{Command Source={Service ScreenManager},Path=ShowScreen,Parameters=test-opacitymask}"/> | ||
<Button Grid.Column="0" Grid.Row="3" Style="{StaticResource ButtonStyle}" Content="Text elements/transforms test" | ||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" | ||
Command="{Command Source={Service ScreenManager},Path=ShowScreen,Parameters=test-text-transforms}"/> | ||
<Button Grid.Column="0" Grid.Row="4" Style="{StaticResource ButtonStyle}" Content="Transforms test" | ||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" | ||
Command="{Command Source={Service ScreenManager},Path=ShowScreen,Parameters=test-transforms}"/> | ||
</Grid> | ||
</DockPanel> | ||
</ResourceWrapper> | ||
|
||
</Include.Resources> | ||
</Include> |
33 changes: 33 additions & 0 deletions
33
MP-II/Resources/GUITestPlugin/Skin/default/screens/test-treeview.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<Grid | ||
xmlns="www.team-mediaportal.com/2008/mpf/directx" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
Context="{Model Id=A6C3F942-105C-48cd-AEFF-059DA79773A9}"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="*"/> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
</Grid.RowDefinitions> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*"/> | ||
</Grid.ColumnDefinitions> | ||
<Label Grid.Row="0" Content="TreeView test" Wrap="True"/> | ||
<TreeView Grid.Row="1" Style="{ThemeResource DefaultSingleMarkableTreeViewStyle}" | ||
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" | ||
ForceExpander="True" | ||
ItemsSource="{Binding Path=Tree,Mode=OneTime}"> | ||
<TreeView.Resources> | ||
<!-- Expander_Binding isn't necessary here - the TreeView won't synchronize its opening-state to the underlaying data model; it is static. We use a dummy. --> | ||
<BindingWrapper x:Key="Expander_Binding"/> | ||
|
||
<!-- Command not necessary here. We use a dummy. --> | ||
<ResourceWrapper x:Key="Expander_Command"/> | ||
|
||
<BindingWrapper x:Key="IsChecked_Binding" Binding="{Binding Path=Selected,Mode=TwoWay}"/> | ||
|
||
<!-- Checker_Command isn't necessary here - the selection state will be propagated via the IsChecked_Binding. | ||
We use a dummy. --> | ||
<ResourceWrapper x:Key="Checker_Command"/> | ||
</TreeView.Resources> | ||
</TreeView> | ||
</Grid> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
#region Copyright (C) 2007-2008 Team MediaPortal | ||
|
||
/* | ||
Copyright (C) 2007-2008 Team MediaPortal | ||
http://www.team-mediaportal.com | ||
This file is part of MediaPortal II | ||
MediaPortal II is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
MediaPortal II is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with MediaPortal II. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#endregion | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using MediaPortal.UI.Presentation.DataObjects; | ||
using MediaPortal.UI.Presentation.Models; | ||
using MediaPortal.UI.Presentation.Workflow; | ||
|
||
namespace Test.GUITestPlugin | ||
{ | ||
/// <summary> | ||
/// Model which holds the GUI state for the TreeView state. | ||
/// </summary> | ||
public class TreeViewModel : IWorkflowModel | ||
{ | ||
public const string MODEL_ID_STR = "A6C3F942-105C-48cd-AEFF-059DA79773A9"; | ||
|
||
#region Protected fields | ||
|
||
protected ItemsList _tree = null; | ||
|
||
#endregion | ||
|
||
protected void CreateChildren(TreeItem item, int level, int maxLevel) | ||
{ | ||
if (level > maxLevel) | ||
return; | ||
TreeItem childItem = new TreeItem("Name", "First item, level " + level); | ||
CreateChildren(childItem, level + 1, maxLevel); | ||
item.SubItems.Add(childItem); | ||
childItem = new TreeItem("Name", "Second item, level " + level); | ||
CreateChildren(childItem, level + 1, maxLevel); | ||
item.SubItems.Add(childItem); | ||
childItem = new TreeItem("Name", "Third item, level " + level); | ||
CreateChildren(childItem, level + 1, maxLevel); | ||
item.SubItems.Add(childItem); | ||
} | ||
|
||
protected void InitializeTree() | ||
{ | ||
_tree = new ItemsList(); | ||
TreeItem item = new TreeItem("Name", "First item"); | ||
CreateChildren(item, 2, 3); | ||
_tree.Add(item); | ||
item = new TreeItem("Name", "Second item"); | ||
CreateChildren(item, 2, 4); | ||
_tree.Add(item); | ||
item = new TreeItem("Name", "Third item"); | ||
CreateChildren(item, 2, 5); | ||
_tree.Add(item); | ||
} | ||
|
||
protected void DisposeTree() | ||
{ | ||
_tree = null; | ||
} | ||
|
||
#region Public properties | ||
|
||
public ItemsList Tree | ||
{ | ||
get { return _tree; } | ||
} | ||
|
||
#endregion | ||
|
||
#region IWorkflowModel implementation | ||
|
||
public Guid ModelId | ||
{ | ||
get { return new Guid(MODEL_ID_STR); } | ||
} | ||
|
||
public bool CanEnterState(NavigationContext oldContext, NavigationContext newContext) | ||
{ | ||
return true; | ||
} | ||
|
||
public void EnterModelContext(NavigationContext oldContext, NavigationContext newContext) | ||
{ | ||
InitializeTree(); | ||
} | ||
|
||
public void ExitModelContext(NavigationContext oldContext, NavigationContext newContext) | ||
{ | ||
DisposeTree(); | ||
} | ||
|
||
public void ChangeModelContext(NavigationContext oldContext, NavigationContext newContext, bool push) | ||
{ | ||
// We could initialize some data here when changing the media navigation state | ||
} | ||
|
||
public void Deactivate(NavigationContext oldContext, NavigationContext newContext) | ||
{ | ||
} | ||
|
||
public void ReActivate(NavigationContext oldContext, NavigationContext newContext) | ||
{ | ||
} | ||
|
||
public void UpdateMenuActions(NavigationContext context, IDictionary<Guid, WorkflowAction> actions) | ||
{ | ||
} | ||
|
||
public ScreenUpdateMode UpdateScreen(NavigationContext context, ref string screen) | ||
{ | ||
return ScreenUpdateMode.AutoWorkflowManager; | ||
} | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters