Skip to content

Commit

Permalink
Merge pull request #10 from cinnamon-msft/cinnamon/general-xaml
Browse files Browse the repository at this point in the history
Add interaction page
  • Loading branch information
cinnamon-msft authored Jul 27, 2020
2 parents 2864818 + b97af15 commit 932ceda
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/TerminalSettings/TerminalSettings/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "MainPage.h"
#include "Globals.h"
#include "Launch.h"
#include "Interaction.h"
#include "Profiles.h"
#include "ColorSchemes.h"
#include "Keybindings.h"
Expand Down
18 changes: 18 additions & 0 deletions src/TerminalSettings/TerminalSettings/Interaction.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "pch.h"
#include "Interaction.h"
#include "Interaction.g.cpp"

using namespace winrt;
using namespace Windows::UI::Xaml;

namespace winrt::SettingsControl::implementation
{
Interaction::Interaction()
{
InitializeComponent();
}

void Interaction::ClickHandler(IInspectable const&, RoutedEventArgs const&)
{
}
}
23 changes: 23 additions & 0 deletions src/TerminalSettings/TerminalSettings/Interaction.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#pragma once

#include "Interaction.g.h"

namespace winrt::SettingsControl::implementation
{
struct Interaction : InteractionT<Interaction>
{
Interaction();

int32_t MyProperty();
void MyProperty(int32_t value);

void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
};
}

namespace winrt::SettingsControl::factory_implementation
{
struct Interaction : InteractionT<Interaction, implementation::Interaction>
{
};
}
8 changes: 8 additions & 0 deletions src/TerminalSettings/TerminalSettings/Interaction.idl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace SettingsControl
{
[default_interface]
runtimeclass Interaction : Windows.UI.Xaml.Controls.Page
{
Interaction();
}
}
30 changes: 30 additions & 0 deletions src/TerminalSettings/TerminalSettings/Interaction.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Page
x:Class="SettingsControl.Interaction"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SettingsControl"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Controls="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
Margin="0,12,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<TextBlock Text="Interaction"
Style="{StaticResource HeaderTextBlockStyle}"
Margin="0,0,0,10" />
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,0,100,0">
<CheckBox Content="Copy after selection is made" />
<CheckBox Content="Copy formatting" />
<TextBox Header="Word delimiters" Margin="0,0,0,10" />
</StackPanel>
</Grid>
</Page>
10 changes: 0 additions & 10 deletions src/TerminalSettings/TerminalSettings/Launch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ namespace winrt::SettingsControl::implementation
InitializeComponent();
}

int32_t Launch::MyProperty()
{
throw hresult_not_implemented();
}

void Launch::MyProperty(int32_t /* value */)
{
throw hresult_not_implemented();
}

void Launch::ClickHandler(IInspectable const&, RoutedEventArgs const&)
{
}
Expand Down
1 change: 0 additions & 1 deletion src/TerminalSettings/TerminalSettings/Launch.idl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ namespace SettingsControl
runtimeclass Launch : Windows.UI.Xaml.Controls.Page
{
Launch();
Int32 MyProperty;
}
}
5 changes: 5 additions & 0 deletions src/TerminalSettings/TerminalSettings/MainPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "MainPage.g.cpp"
#include "Globals.h"
#include "Launch.h"
#include "Interaction.h"
#include "Profiles.h"
#include "ColorSchemes.h"
#include "Keybindings.h"
Expand Down Expand Up @@ -83,6 +84,10 @@ namespace winrt::SettingsControl::implementation
{
contentFrame().Navigate(xaml_typename<SettingsControl::Launch>());
}
else if (clickedItemTag == interactionSubpage)
{
contentFrame().Navigate(xaml_typename<SettingsControl::Interaction>());
}
else if (clickedItemTag == globalprofileSubpage)
{
contentFrame().Navigate(xaml_typename<SettingsControl::Profiles>());
Expand Down
13 changes: 13 additions & 0 deletions src/TerminalSettings/TerminalSettings/SettingsControl.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@
<DependentUpon>Globals.xaml</DependentUpon>
<SubType>Code</SubType>
</ClInclude>
<ClInclude Include="Interaction.h">
<DependentUpon>Interaction.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Keybindings.h">
<DependentUpon>Keybindings.xaml</DependentUpon>
<SubType>Code</SubType>
Expand Down Expand Up @@ -144,6 +147,9 @@
<Page Include="Globals.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="Interaction.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="Keybindings.xaml">
<SubType>Designer</SubType>
</Page>
Expand Down Expand Up @@ -192,6 +198,9 @@
<DependentUpon>Globals.xaml</DependentUpon>
<SubType>Code</SubType>
</ClCompile>
<ClCompile Include="Interaction.cpp">
<DependentUpon>Interaction.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Keybindings.cpp">
<DependentUpon>Keybindings.xaml</DependentUpon>
<SubType>Code</SubType>
Expand Down Expand Up @@ -234,6 +243,10 @@
<DependentUpon>Launch.xaml</DependentUpon>
<SubType>Code</SubType>
</Midl>
<Midl Include="Interaction.idl">
<DependentUpon>Interaction.xaml</DependentUpon>
<SubType>Code</SubType>
</Midl>
<Midl Include="Keybindings.idl">
<DependentUpon>Keybindings.xaml</DependentUpon>
<SubType>Code</SubType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<Page Include="ColorSchemes.xaml" />
<Page Include="Keybindings.xaml" />
<Page Include="Launch.xaml" />
<Page Include="Interaction.xaml" />
</ItemGroup>
<ItemGroup>
<Midl Include="App.idl" />
Expand Down

0 comments on commit 932ceda

Please sign in to comment.