Equation button updates: Enable/Disable on click, button content f1, f2, f3..., visibility icon on hover (#804)
* Added enable/disable line functionality * Update EquationTextBox to change the opacity of functions have are not visible. Update the function label for the EquationTextBox to increment the label to show f1, f2, f3, etc * rebase key-graph-features and fix issue where removing an equation box and adding a new one repopulates the previous equation * Added visibility icon for the equation button hover * updated EquationButton to be a toggle button to better handle the LineHidden state and other PR comment fixes. * Updated EquationButton style to use a toggle button and to have placeholder icons for the show/hide states * Updated equation button after pulling the refactor work into the branch. Fixed the Equation Button in KGF UI * Fixed Pepe's bugs * Uncomment temporary.pfx in calculator.vcxproj
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:Controls="using:CalculatorApp.Controls"
|
||||
xmlns:common="using:CalculatorApp.Common"
|
||||
xmlns:converters="using:CalculatorApp.Converters"
|
||||
xmlns:local="using:CalculatorApp">
|
||||
|
||||
<Application.Resources>
|
||||
@@ -15,6 +14,8 @@
|
||||
<ResourceDictionary x:Key="Default">
|
||||
<Thickness x:Key="HighContrastThicknessTop">0,0,0,0</Thickness>
|
||||
<x:Double x:Key="HighContrastStrokeThickness">0</x:Double>
|
||||
<x:Double x:Key="EquationButtonOverlayPointerOverOpacity">0.3</x:Double>
|
||||
<x:Double x:Key="EquationButtonOverlayPressedOpacity">0.5</x:Double>
|
||||
<Color x:Key="AltHighColor">#FF000000</Color>
|
||||
<Color x:Key="ChromeMediumLowColor">#FF2B2B2B</Color>
|
||||
<SolidColorBrush x:Key="SystemControlBackgroundAltHighBrush" Color="{StaticResource AltHighColor}"/>
|
||||
@@ -51,6 +52,13 @@
|
||||
<SolidColorBrush x:Key="EquationBoxPointerOverBackgroundBrush" Color="{ThemeResource SystemControlBackgroundAltMediumBrush}"/>
|
||||
<SolidColorBrush x:Key="EquationBoxHoverButtonForegroundBrush" Color="{ThemeResource SystemBaseHighColor}"/>
|
||||
<SolidColorBrush x:Key="EquationBoxBorderBrush" Color="{ThemeResource TextControlBackground}"/>
|
||||
<SolidColorBrush x:Key="EquationButtonOverlayBackgroundBrush" Color="White"/>
|
||||
<SolidColorBrush x:Key="EquationButtonHideLineBackgroundBrush"
|
||||
Opacity="0.4"
|
||||
Color="#FFFFFF"/>
|
||||
<SolidColorBrush x:Key="EquationButtonHideLineForegroundBrush"
|
||||
Opacity="0.6"
|
||||
Color="{StaticResource SystemChromeWhiteColor}"/>
|
||||
<SolidColorBrush x:Key="AppControlTransparentButtonBackgroundBrush" Color="Transparent"/>
|
||||
|
||||
<SolidColorBrush x:Key="EquationBrush1" Color="#FF0078D7"/>
|
||||
@@ -75,6 +83,8 @@
|
||||
<x:Double x:Key="HighContrastStrokeThickness">0</x:Double>
|
||||
<Color x:Key="AltHighColor">#FFF2F2F2</Color>
|
||||
<Color x:Key="ChromeMediumLowColor">#FFE0E0E0</Color>
|
||||
<x:Double x:Key="EquationButtonOverlayPointerOverOpacity">0.2</x:Double>
|
||||
<x:Double x:Key="EquationButtonOverlayPressedOpacity">0.4</x:Double>
|
||||
<SolidColorBrush x:Key="SystemControlBackgroundAltHighBrush" Color="{StaticResource SystemAltHighColor}"/>
|
||||
<SolidColorBrush x:Key="SystemControlBackgroundChromeMediumLowBrush" Color="{StaticResource ChromeMediumLowColor}"/>
|
||||
<SolidColorBrush x:Key="TitleBarForegroundBaseHighBrush" Color="{StaticResource SystemBaseHighColor}"/>
|
||||
@@ -108,6 +118,11 @@
|
||||
<SolidColorBrush x:Key="EquationBoxPointerOverBackgroundBrush" Color="{ThemeResource SystemControlBackgroundAltMediumBrush}"/>
|
||||
<SolidColorBrush x:Key="EquationBoxHoverButtonForegroundBrush" Color="{ThemeResource SystemBaseHighColor}"/>
|
||||
<SolidColorBrush x:Key="EquationBoxBorderBrush" Color="{ThemeResource TextControlBackground}"/>
|
||||
<SolidColorBrush x:Key="EquationButtonOverlayBackgroundBrush" Color="Black"/>
|
||||
<SolidColorBrush x:Key="EquationButtonHideLineBackgroundBrush"
|
||||
Opacity="0.4"
|
||||
Color="#000000"/>
|
||||
<SolidColorBrush x:Key="EquationButtonHideLineForegroundBrush" Color="{StaticResource SystemChromeWhiteColor}"/>
|
||||
<SolidColorBrush x:Key="AppControlTransparentButtonBackgroundBrush" Color="Transparent"/>
|
||||
|
||||
<SolidColorBrush x:Key="EquationBrush1" Color="#FF0078D7"/>
|
||||
@@ -130,6 +145,8 @@
|
||||
<ResourceDictionary x:Key="HighContrast">
|
||||
<Thickness x:Key="HighContrastThicknessTop">0,1,0,0</Thickness>
|
||||
<x:Double x:Key="HighContrastStrokeThickness">2</x:Double>
|
||||
<x:Double x:Key="EquationButtonOverlayPointerOverOpacity">1.0</x:Double>
|
||||
<x:Double x:Key="EquationButtonOverlayPressedOpacity">1.0</x:Double>
|
||||
<SolidColorBrush x:Key="SystemControlBackgroundAltHighBrush" Color="{ThemeResource SystemColorButtonFaceColor}"/>
|
||||
<SolidColorBrush x:Key="SystemControlBackgroundChromeMediumLowBrush" Color="{ThemeResource SystemColorButtonFaceColor}"/>
|
||||
<SolidColorBrush x:Key="TitleBarForegroundBaseHighBrush" Color="{ThemeResource SystemColorCaptionTextColor}"/>
|
||||
@@ -152,7 +169,9 @@
|
||||
<SolidColorBrush x:Key="EquationBoxPointerOverBackgroundBrush" Color="{ThemeResource SystemColorHighlightColor}"/>
|
||||
<SolidColorBrush x:Key="EquationBoxHoverButtonForegroundBrush" Color="{ThemeResource SystemColorButtonTextColor}"/>
|
||||
<SolidColorBrush x:Key="AppControlTransparentButtonBackgroundBrush" Color="{ThemeResource SystemColorButtonFaceColor}"/>
|
||||
|
||||
<SolidColorBrush x:Key="EquationButtonHideLineBackgroundBrush" Color="{ThemeResource SystemColorButtonFaceColor}"/>
|
||||
<SolidColorBrush x:Key="EquationButtonOverlayBackgroundBrush" Color="Transparent"/>
|
||||
<SolidColorBrush x:Key="EquationButtonHideLineForegroundBrush" Color="{StaticResource SystemColorGrayTextColor}"/>
|
||||
<!-- TODO: Figure out what colors we can use in high contrast -->
|
||||
<SolidColorBrush x:Key="EquationBrush1" Color="{ThemeResource SystemColorGrayTextColor}"/>
|
||||
<SolidColorBrush x:Key="EquationBrush2" Color="{ThemeResource SystemColorHighlightColor}"/>
|
||||
@@ -1477,6 +1496,7 @@
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
|
||||
</VisualStateGroup>
|
||||
|
||||
<VisualStateGroup x:Name="ButtonStates">
|
||||
@@ -1496,19 +1516,116 @@
|
||||
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
|
||||
<Button x:Name="EquationButton"
|
||||
MinWidth="44"
|
||||
MinHeight="44"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="{TemplateBinding EquationColor}"
|
||||
Foreground="{StaticResource SystemChromeWhiteColor}"
|
||||
Content="ƒₓ">
|
||||
<Button.Resources>
|
||||
<SolidColorBrush x:Name="ButtonBackgroundPointerOver" Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=EquationColor.Color}"/>
|
||||
<SolidColorBrush x:Name="ButtonForegroundPointerOver" Color="{ThemeResource SystemChromeWhiteColor}"/>
|
||||
<SolidColorBrush x:Name="ButtonBorderBrushPointerOver" Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=EquationColor.Color}"/>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<ToggleButton x:Name="EquationButton"
|
||||
MinWidth="44"
|
||||
MinHeight="44"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="{TemplateBinding EquationColor}"
|
||||
Foreground="{StaticResource SystemChromeWhiteColor}"
|
||||
BorderBrush="{TemplateBinding EquationColor}">
|
||||
<ToggleButton.Content>
|
||||
<StackPanel x:Name="FunctionNumberLabel"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock Text="ƒ"/>
|
||||
<TextBlock Margin="0,10,0,0"
|
||||
FontSize="9"
|
||||
Text="{TemplateBinding EquationButtonContentIndex}"/>
|
||||
</StackPanel>
|
||||
</ToggleButton.Content>
|
||||
<ToggleButton.Resources>
|
||||
<SolidColorBrush x:Name="ButtonBackgroundBrush" Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=EquationColor.Color}"/>
|
||||
<SolidColorBrush x:Name="ButtonBorderBrush" Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=EquationColor.Color}"/>
|
||||
</ToggleButton.Resources>
|
||||
<ToggleButton.Style>
|
||||
<Style TargetType="ToggleButton">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<Grid x:Name="RootGrid"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootGrid.Background" Value="{ThemeResource ButtonBackgroundBrush}"/>
|
||||
<Setter Target="RootGrid.BorderBrush" Value="{ThemeResource ButtonBorderBrush}"/>
|
||||
<Setter Target="Overlay.Opacity" Value="0.0"/>
|
||||
<Setter Target="ContentPresenter.Visibility" Value="Visible"/>
|
||||
<Setter Target="ShowHideIcon.Visibility" Value="Collapsed"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="PointerOver">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootGrid.Background" Value="{ThemeResource ButtonBackgroundBrush}"/>
|
||||
<Setter Target="RootGrid.BorderBrush" Value="{ThemeResource ButtonBorderBrush}"/>
|
||||
<Setter Target="Overlay.Opacity" Value="{StaticResource EquationButtonOverlayPointerOverOpacity}"/>
|
||||
<Setter Target="ContentPresenter.Visibility" Value="Collapsed"/>
|
||||
<Setter Target="ShowHideIcon.Visibility" Value="Visible"/>
|
||||
<Setter Target="ShowHideIcon.Glyph" Value=""/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Pressed">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootGrid.Background" Value="{ThemeResource ButtonBackgroundBrush}"/>
|
||||
<Setter Target="RootGrid.BorderBrush" Value="{ThemeResource ButtonBorderBrush}"/>
|
||||
<Setter Target="Overlay.Opacity" Value="{StaticResource EquationButtonOverlayPressedOpacity}"/>
|
||||
<Setter Target="ContentPresenter.Visibility" Value="Collapsed"/>
|
||||
<Setter Target="ShowHideIcon.Visibility" Value="Visible"/>
|
||||
<Setter Target="ShowHideIcon.Glyph" Value=""/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Checked">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootGrid.Background" Value="{ThemeResource EquationButtonHideLineBackgroundBrush}"/>
|
||||
<Setter Target="RootGrid.BorderBrush" Value="{ThemeResource EquationButtonHideLineBackgroundBrush}"/>
|
||||
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource EquationButtonHideLineForegroundBrush}"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="CheckedPointerOver">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootGrid.Background" Value="{ThemeResource EquationButtonHideLineBackgroundBrush}"/>
|
||||
<Setter Target="RootGrid.BorderBrush" Value="{ThemeResource EquationButtonHideLineBackgroundBrush}"/>
|
||||
<Setter Target="ShowHideIcon.Foreground" Value="{ThemeResource EquationButtonHideLineForegroundBrush}"/>
|
||||
<Setter Target="Overlay.Opacity" Value="{StaticResource EquationButtonOverlayPointerOverOpacity}"/>
|
||||
<Setter Target="ContentPresenter.Visibility" Value="Collapsed"/>
|
||||
<Setter Target="ShowHideIcon.Visibility" Value="Visible"/>
|
||||
<Setter Target="ShowHideIcon.Glyph" Value=""/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="CheckedPressed">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootGrid.Background" Value="{ThemeResource EquationButtonHideLineBackgroundBrush}"/>
|
||||
<Setter Target="RootGrid.BorderBrush" Value="{ThemeResource EquationButtonHideLineBackgroundBrush}"/>
|
||||
<Setter Target="ShowHideIcon.Foreground" Value="{ThemeResource EquationButtonHideLineForegroundBrush}"/>
|
||||
<Setter Target="Overlay.Opacity" Value="{StaticResource EquationButtonOverlayPressedOpacity}"/>
|
||||
<Setter Target="ContentPresenter.Visibility" Value="Collapsed"/>
|
||||
<Setter Target="ShowHideIcon.Visibility" Value="Visible"/>
|
||||
<Setter Target="ShowHideIcon.Glyph" Value=""/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Rectangle x:Name="Overlay"
|
||||
Fill="{ThemeResource EquationButtonOverlayBackgroundBrush}"
|
||||
Opacity="0"
|
||||
IsHitTestVisible="False"/>
|
||||
<ContentPresenter x:Name="ContentPresenter"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
IsHitTestVisible="False"/>
|
||||
<FontIcon x:Name="ShowHideIcon"
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
Visibility="Collapsed"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ToggleButton.Style>
|
||||
</ToggleButton>
|
||||
<Border x:Name="EquationBoxBorder"
|
||||
Grid.Column="1"
|
||||
Background="{ThemeResource TextControlBackground}"
|
||||
|
@@ -1489,5 +1489,11 @@
|
||||
<ItemGroup>
|
||||
<CopyFileToFolders Include="$(GraphingImplDll)" />
|
||||
<CopyFileToFolders Include="$(GraphingEngineDll)" />
|
||||
<CopyFileToFolders Include="$(GraphingImplDll)" />
|
||||
<CopyFileToFolders Include="$(GraphingEngineDll)" />
|
||||
<CopyFileToFolders Include="$(GraphingImplDll)" />
|
||||
<CopyFileToFolders Include="$(GraphingEngineDll)" />
|
||||
<CopyFileToFolders Include="$(GraphingImplDll)" />
|
||||
<CopyFileToFolders Include="$(GraphingEngineDll)" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@@ -21,10 +21,12 @@ using namespace Windows::UI::Xaml::Controls::Primitives;
|
||||
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(EquationTextBox, EquationColor);
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(EquationTextBox, ColorChooserFlyout);
|
||||
DEPENDENCY_PROPERTY_INITIALIZATION(EquationTextBox, EquationButtonContentIndex);
|
||||
|
||||
|
||||
void EquationTextBox::OnApplyTemplate()
|
||||
{
|
||||
m_equationButton = dynamic_cast<Button ^>(GetTemplateChild("EquationButton"));
|
||||
m_equationButton = dynamic_cast<ToggleButton ^>(GetTemplateChild("EquationButton"));
|
||||
m_richEditBox = dynamic_cast<MathRichEditBox ^>(GetTemplateChild("EquationTextBox"));
|
||||
m_deleteButton = dynamic_cast<Button ^>(GetTemplateChild("DeleteButton"));
|
||||
m_removeButton = dynamic_cast<Button ^>(GetTemplateChild("RemoveButton"));
|
||||
@@ -187,6 +189,13 @@ void EquationTextBox::OnRemoveButtonClicked(Object ^ sender, RoutedEventArgs ^ e
|
||||
{
|
||||
m_functionButton->IsEnabled = false;
|
||||
}
|
||||
|
||||
if (m_equationButton)
|
||||
{
|
||||
m_equationButton->IsChecked = false;
|
||||
}
|
||||
|
||||
VisualStateManager::GoToState(this, "Normal", true);
|
||||
}
|
||||
|
||||
void EquationTextBox::OnColorChooserButtonClicked(Object ^ sender, RoutedEventArgs ^ e)
|
||||
|
@@ -21,6 +21,7 @@ namespace CalculatorApp
|
||||
DEPENDENCY_PROPERTY_OWNER(EquationTextBox);
|
||||
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Media::SolidColorBrush^, EquationColor);
|
||||
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Controls::Flyout^, ColorChooserFlyout);
|
||||
DEPENDENCY_PROPERTY(Platform::String ^, EquationButtonContentIndex);
|
||||
|
||||
PROPERTY_R(bool, HasFocus);
|
||||
|
||||
@@ -60,7 +61,7 @@ namespace CalculatorApp
|
||||
void OnColorFlyoutClosed(Platform::Object^ sender, Platform::Object^ e);
|
||||
|
||||
CalculatorApp::Controls::MathRichEditBox^ m_richEditBox;
|
||||
Windows::UI::Xaml::Controls::Button^ m_equationButton;
|
||||
Windows::UI::Xaml::Controls::Primitives::ToggleButton^ m_equationButton;
|
||||
Windows::UI::Xaml::Controls::Button^ m_deleteButton;
|
||||
Windows::UI::Xaml::Controls::Button^ m_removeButton;
|
||||
Windows::UI::Xaml::Controls::Button^ m_functionButton;
|
||||
|
@@ -2,6 +2,7 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:CalculatorApp.Controls"
|
||||
xmlns:converters="using:CalculatorApp.Converters"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:CalculatorApp"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
@@ -49,6 +50,8 @@
|
||||
Margin="1,0,1,0"
|
||||
Style="{StaticResource EquationTextBoxStyle}"
|
||||
EquationColor="{x:Bind LineColor, Mode=OneWay}"
|
||||
EquationButtonClicked="EquationTextBox_EquationButtonClicked"
|
||||
EquationButtonContentIndex="{x:Bind FunctionLabelIndex, Mode=OneWay}"
|
||||
EquationSubmitted="InputTextBox_Submitted"
|
||||
GotFocus="InputTextBox_GotFocus"
|
||||
Loaded="EquationTextBoxLoaded"
|
||||
|
@@ -68,7 +68,8 @@ void EquationInputArea::AddNewEquation()
|
||||
m_lastLineColorIndex = (m_lastLineColorIndex + 1) % AvailableColors->Size;
|
||||
|
||||
eq->LineColor = AvailableColors->GetAt(m_lastLineColorIndex);
|
||||
|
||||
eq->IsLineEnabled = true;
|
||||
eq->FunctionLabelIndex = ++m_lastFunctionLabelIndex;
|
||||
Equations->Append(eq);
|
||||
EquationInputList->ScrollIntoView(eq);
|
||||
}
|
||||
@@ -102,6 +103,11 @@ void EquationInputArea::EquationTextBox_RemoveButtonClicked(Object ^ sender, Rou
|
||||
unsigned int index;
|
||||
if (Equations->IndexOf(eq, &index))
|
||||
{
|
||||
if (eq->FunctionLabelIndex == m_lastFunctionLabelIndex)
|
||||
{
|
||||
m_lastFunctionLabelIndex--;
|
||||
}
|
||||
|
||||
Equations->RemoveAt(index);
|
||||
}
|
||||
}
|
||||
@@ -116,6 +122,9 @@ void EquationInputArea::EquationTextBox_KeyGraphFeaturesButtonClicked(Object ^ s
|
||||
|
||||
void EquationInputArea::EquationTextBox_EquationButtonClicked(Object ^ sender, RoutedEventArgs ^ e)
|
||||
{
|
||||
auto tb = static_cast<EquationTextBox ^>(sender);
|
||||
auto eq = static_cast<EquationViewModel ^>(tb->DataContext);
|
||||
eq->IsLineEnabled = !eq->IsLineEnabled;
|
||||
}
|
||||
|
||||
void EquationInputArea::EquationTextBoxLoaded(Object ^ sender, RoutedEventArgs ^ e)
|
||||
|
@@ -10,6 +10,7 @@
|
||||
#include "CalcViewModel/Common/KeyboardShortcutManager.h"
|
||||
#include "Controls/EquationTextBox.h"
|
||||
#include "Converters/BooleanNegationConverter.h"
|
||||
#include "Controls/MathRichEditBox.h"
|
||||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
@@ -22,7 +23,6 @@ namespace CalculatorApp
|
||||
OBSERVABLE_PROPERTY_RW(Windows::Foundation::Collections::IObservableVector< ViewModel::EquationViewModel^ >^, Equations);
|
||||
OBSERVABLE_PROPERTY_RW_ALWAYS_NOTIFY(ViewModel::EquationViewModel ^, EquationVM);
|
||||
OBSERVABLE_PROPERTY_RW(Windows::Foundation::Collections::IObservableVector<Windows::UI::Xaml::Media::SolidColorBrush ^> ^, AvailableColors);
|
||||
|
||||
event Windows::UI::Xaml::RoutedEventHandler ^ KeyGraphFeaturesRequested;
|
||||
|
||||
private:
|
||||
@@ -42,6 +42,7 @@ namespace CalculatorApp
|
||||
private:
|
||||
Windows::UI::ViewManagement::AccessibilitySettings ^ m_accessibilitySettings;
|
||||
int m_lastLineColorIndex;
|
||||
int m_lastFunctionLabelIndex;
|
||||
void EquationTextBox_RemoveButtonClicked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
|
||||
void EquationTextBox_KeyGraphFeaturesButtonClicked(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||
void EquationTextBox_EquationButtonClicked(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||
|
@@ -150,36 +150,39 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Button x:Name="EquationButton"
|
||||
MinWidth="44"
|
||||
MinHeight="44"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="{TemplateBinding EquationColor}"
|
||||
Foreground="{StaticResource SystemChromeWhiteColor}"
|
||||
BorderThickness="0">
|
||||
<Button.Content>
|
||||
<StackPanel Margin="5,0"
|
||||
VerticalAlignment="Top"
|
||||
Orientation="Horizontal">
|
||||
<ToggleButton x:Name="EquationButton"
|
||||
MinWidth="44"
|
||||
MinHeight="44"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="{TemplateBinding EquationColor}"
|
||||
Foreground="{StaticResource SystemChromeWhiteColor}"
|
||||
BorderThickness="0">
|
||||
<ToggleButton.Content>
|
||||
<StackPanel x:Name="FunctionNumberLabel"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
Orientation="Horizontal"
|
||||
Margin="5,0">
|
||||
<FontIcon VerticalAlignment="Center"
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Glyph=""/>
|
||||
<TextBlock Margin="12,-4,0,0"
|
||||
VerticalAlignment="Top"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontSize="16"
|
||||
Text="ƒₓ"/>
|
||||
<TextBlock Text="ƒ" Margin="12,0,0,0"/>
|
||||
<TextBlock Margin="0,10,0,0"
|
||||
FontSize="9"
|
||||
Text="{TemplateBinding EquationButtonContentIndex}"/>
|
||||
</StackPanel>
|
||||
</Button.Content>
|
||||
<Button.Resources>
|
||||
|
||||
</ToggleButton.Content>
|
||||
<ToggleButton.Resources>
|
||||
<SolidColorBrush x:Name="ButtonBackgroundPointerOver"
|
||||
Opacity="0.7"
|
||||
Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=EquationColor.Color}"/>
|
||||
<SolidColorBrush x:Name="ButtonForegroundPointerOver" Color="{ThemeResource SystemChromeWhiteColor}"/>
|
||||
<SolidColorBrush x:Name="ButtonBorderBrushPointerOver" Color="Transparent"/>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
</ToggleButton.Resources>
|
||||
</ToggleButton>
|
||||
|
||||
<controls:MathRichEditBox x:Name="EquationTextBox"
|
||||
Grid.Column="1"
|
||||
@@ -431,6 +434,8 @@
|
||||
BorderThickness="0"
|
||||
DataContext="{x:Bind ViewModel, Mode=OneWay}"
|
||||
EquationButtonClicked="EquationButtonClicked"
|
||||
EquationButtonContentIndex="{x:Bind ViewModel.FunctionLabelIndex, Mode=OneWay}"
|
||||
EquationColor="{x:Bind ViewModel.LineColor, Mode=OneWay}"
|
||||
Loaded="EquationInputTextBox_Loaded"/>
|
||||
<TextBlock x:Uid="KeyGraphFeaturesLabel"
|
||||
Grid.Row="1"
|
||||
|
@@ -14,9 +14,7 @@ using namespace Windows::UI::Xaml;
|
||||
using namespace Windows::UI::Xaml::Controls;
|
||||
|
||||
KeyGraphFeaturesPanel::KeyGraphFeaturesPanel()
|
||||
|
||||
{
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
@@ -49,5 +47,4 @@ void KeyGraphFeaturesPanel::EquationInputTextBox_Loaded(Object ^ sender, RoutedE
|
||||
void KeyGraphFeaturesPanel::SetEquationTextBoxProperties()
|
||||
{
|
||||
EquationInputTextBox->SetEquationText(ViewModel->Expression);
|
||||
EquationInputTextBox->EquationColor = ViewModel->LineColor;
|
||||
}
|
||||
|
@@ -18,7 +18,6 @@ public
|
||||
|
||||
OBSERVABLE_OBJECT_CALLBACK(OnPropertyChanged);
|
||||
OBSERVABLE_PROPERTY_RW_ALWAYS_NOTIFY(CalculatorApp::ViewModel::EquationViewModel ^, ViewModel);
|
||||
|
||||
event Windows::UI::Xaml::RoutedEventHandler ^ KeyGraphFeaturesClosed;
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user