mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 22:23:29 -07:00
- Remove ScaleRange/MoveRangeByRatio from UI
This commit is contained in:
parent
1b92ba5fe4
commit
73b2a712a2
3 changed files with 2 additions and 80 deletions
|
@ -25,8 +25,7 @@
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="0">
|
Grid.Column="0">
|
||||||
|
|
||||||
<graphControl:Grapher x:Name="Graph"
|
<graphControl:Grapher Grid.Row="0"
|
||||||
Grid.Row="0"
|
|
||||||
Margin="4,7,4,4"
|
Margin="4,7,4,4"
|
||||||
EquationsSource="{x:Bind ViewModel.Equations, Mode=OneWay}"
|
EquationsSource="{x:Bind ViewModel.Equations, Mode=OneWay}"
|
||||||
ForceProportionalAxes="True"
|
ForceProportionalAxes="True"
|
||||||
|
@ -50,55 +49,13 @@
|
||||||
Margin="4,0,4,0">
|
Margin="4,0,4,0">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="5*"/>
|
<RowDefinition Height="5*"/>
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="3*"/>
|
<RowDefinition Height="3*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<local:EquationInputArea Grid.Row="0" Equations="{x:Bind ViewModel.Equations}"/>
|
<local:EquationInputArea Grid.Row="0" Equations="{x:Bind ViewModel.Equations}"/>
|
||||||
|
|
||||||
<StackPanel Grid.Row="1" Orientation="Vertical">
|
|
||||||
<TextBlock Text="Move Range By Ratio"/>
|
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<TextBox x:Name="RatioXTextBox"
|
|
||||||
Grid.Column="0"
|
|
||||||
KeyDown="MoveRangeByRatioTextBox_KeyDown"
|
|
||||||
PlaceholderText="RatioX"/>
|
|
||||||
<TextBox x:Name="RatioYTextBox"
|
|
||||||
Grid.Column="1"
|
|
||||||
KeyDown="MoveRangeByRatioTextBox_KeyDown"
|
|
||||||
PlaceholderText="RatioY"/>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<TextBlock Text="Scale Range"/>
|
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<TextBox x:Name="CenterXTextBox"
|
|
||||||
Grid.Column="0"
|
|
||||||
KeyDown="ScaleRangeTextBox_KeyDown"
|
|
||||||
PlaceholderText="CenterX"/>
|
|
||||||
<TextBox x:Name="CenterYTextBox"
|
|
||||||
Grid.Column="1"
|
|
||||||
KeyDown="ScaleRangeTextBox_KeyDown"
|
|
||||||
PlaceholderText="CenterY"/>
|
|
||||||
<TextBox x:Name="ScaleTextBox"
|
|
||||||
Grid.Column="2"
|
|
||||||
KeyDown="ScaleRangeTextBox_KeyDown"
|
|
||||||
PlaceholderText="Scale"/>
|
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<Grid x:Name="ButtonContainerGrid"
|
<Grid x:Name="ButtonContainerGrid"
|
||||||
Grid.Row="2"
|
Grid.Row="1"
|
||||||
Margin="3,0,3,3"
|
Margin="3,0,3,3"
|
||||||
UseLayoutRounding="False">
|
UseLayoutRounding="False">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
|
|
|
@ -27,11 +27,6 @@ using namespace Windows::UI::Xaml::Media::Imaging;
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
constexpr auto sc_ViewModelPropertyName = L"ViewModel";
|
constexpr auto sc_ViewModelPropertyName = L"ViewModel";
|
||||||
|
|
||||||
double valFromTB(TextBox^ tb)
|
|
||||||
{
|
|
||||||
return stod(tb->Text->Data());
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GraphingCalculator::GraphingCalculator()
|
GraphingCalculator::GraphingCalculator()
|
||||||
|
@ -59,30 +54,3 @@ void GraphingCalculator::ViewModel::set(GraphingCalculatorViewModel^ vm)
|
||||||
RaisePropertyChanged(StringReference(sc_ViewModelPropertyName));
|
RaisePropertyChanged(StringReference(sc_ViewModelPropertyName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphingCalculator::ScaleRangeTextBox_KeyDown(Object^ sender, KeyRoutedEventArgs^ e)
|
|
||||||
{
|
|
||||||
if (e->Key == VirtualKey::Enter)
|
|
||||||
{
|
|
||||||
double centerX = valFromTB(CenterXTextBox);
|
|
||||||
double centerY = valFromTB(CenterYTextBox);
|
|
||||||
double scale = valFromTB(ScaleTextBox);
|
|
||||||
|
|
||||||
Graph->ScaleRange(centerX, centerY, scale);
|
|
||||||
|
|
||||||
e->Handled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void GraphingCalculator::MoveRangeByRatioTextBox_KeyDown(Object^ sender, KeyRoutedEventArgs^ e)
|
|
||||||
{
|
|
||||||
if (e->Key == VirtualKey::Enter)
|
|
||||||
{
|
|
||||||
double ratioX = valFromTB(RatioXTextBox);
|
|
||||||
double ratioY = valFromTB(RatioYTextBox);
|
|
||||||
|
|
||||||
Graph->MoveRangeByRatio(ratioX, ratioY);
|
|
||||||
|
|
||||||
e->Handled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -22,9 +22,6 @@ namespace CalculatorApp
|
||||||
private:
|
private:
|
||||||
void GraphingCalculator_DataContextChanged(Windows::UI::Xaml::FrameworkElement^ sender, Windows::UI::Xaml::DataContextChangedEventArgs^ args);
|
void GraphingCalculator_DataContextChanged(Windows::UI::Xaml::FrameworkElement^ sender, Windows::UI::Xaml::DataContextChangedEventArgs^ args);
|
||||||
|
|
||||||
void ScaleRangeTextBox_KeyDown(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e);
|
|
||||||
void MoveRangeByRatioTextBox_KeyDown(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CalculatorApp::ViewModel::GraphingCalculatorViewModel^ m_viewModel;
|
CalculatorApp::ViewModel::GraphingCalculatorViewModel^ m_viewModel;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue