diff --git a/src/Calculator/Calculator.vcxproj b/src/Calculator/Calculator.vcxproj index 4e19aab2..64e4ad06 100644 --- a/src/Calculator/Calculator.vcxproj +++ b/src/Calculator/Calculator.vcxproj @@ -234,12 +234,9 @@ - - - @@ -372,8 +369,6 @@ - - diff --git a/src/Calculator/Calculator.vcxproj.filters b/src/Calculator/Calculator.vcxproj.filters index cc25a224..a888b192 100644 --- a/src/Calculator/Calculator.vcxproj.filters +++ b/src/Calculator/Calculator.vcxproj.filters @@ -271,12 +271,6 @@ - - Controls - - - Controls - Controls @@ -321,9 +315,6 @@ Common - - Controls - Controls @@ -370,12 +361,6 @@ - - Controls - - - Controls - Controls diff --git a/src/Calculator/Controls/AppBar.h b/src/Calculator/Controls/AppBar.h deleted file mode 100644 index b6ac3740..00000000 --- a/src/Calculator/Controls/AppBar.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#pragma once - -#include "Common/KeyboardShortcutManager.h" - -namespace CalculatorApp -{ - namespace Controls - { - public ref class AppBar sealed : public Windows::UI::Xaml::Controls::AppBar - { - public: - AppBar() - {} - - protected: - virtual void OnKeyDown(Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e) override - { - Windows::UI::Xaml::Controls::AppBar::OnKeyDown(e); - if (e->Key == Windows::System::VirtualKey::Escape) - { - Common::KeyboardShortcutManager::IgnoreEscape(true); - } - } - }; - } -} diff --git a/src/Calculator/Controls/OperandTextBox.cpp b/src/Calculator/Controls/OperandTextBox.cpp deleted file mode 100644 index 31e814c2..00000000 --- a/src/Calculator/Controls/OperandTextBox.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#include "pch.h" -#include "OperandTextBox.h" -#include "regex" - -using namespace CalculatorApp; -using namespace CalculatorApp::Controls; - -using namespace Platform; -using namespace std; -using namespace Windows::Foundation; -using namespace Windows::Foundation::Collections; -using namespace Windows::Devices::Input; -using namespace Windows::System; -using namespace Windows::UI::Xaml; -using namespace Windows::UI::Xaml::Controls; -using namespace Windows::UI::Xaml::Controls::Primitives; -using namespace Windows::UI::Xaml::Data; -using namespace Windows::UI::Xaml::Input; -using namespace Windows::UI::Xaml::Media; -using namespace Windows::UI::Xaml::Navigation; - -void OperandTextBox::OnApplyTemplate() -{ - this->IsEnabled = false; - this->IsHitTestVisible = false; - this->IsTapEnabled = false; - this->MaxLength = 50; - this->IsRightTapEnabled = false; - this->IsTabStop = false; - auto parent = VisualTreeHelper::GetParent(this); - ListViewItem^ listViewItem; - ListView^ listView; - while (parent != nullptr) - { - if (listViewItem == nullptr) - { - listViewItem = dynamic_cast(parent); - } - - listView = dynamic_cast(parent); - if (listView != nullptr) - { - break; - } - parent = VisualTreeHelper::GetParent(parent); - } - - if (listView != nullptr) - { - listViewItem->IsEnabled = false; - listViewItem->IsHitTestVisible = false; - listViewItem->IsTapEnabled = false; - } - TextBox::OnApplyTemplate(); -} diff --git a/src/Calculator/Controls/OperandTextBox.h b/src/Calculator/Controls/OperandTextBox.h deleted file mode 100644 index a8508e12..00000000 --- a/src/Calculator/Controls/OperandTextBox.h +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#pragma once - -namespace CalculatorApp -{ - namespace Controls - { - public ref class OperandTextBox sealed : public Windows::UI::Xaml::Controls::TextBox - { - public: - OperandTextBox() { } - - protected: - virtual void OnApplyTemplate() override; - }; - } -} diff --git a/src/Calculator/Controls/OperatorTextBox.cpp b/src/Calculator/Controls/OperatorTextBox.cpp deleted file mode 100644 index 53153504..00000000 --- a/src/Calculator/Controls/OperatorTextBox.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#include "pch.h" -#include "OperatorTextBox.h" -#include "regex" - -using namespace CalculatorApp; -using namespace CalculatorApp::Controls; - -using namespace Platform; -using namespace std; -using namespace Windows::Foundation; -using namespace Windows::Foundation::Collections; -using namespace Windows::Devices::Input; -using namespace Windows::System; -using namespace Windows::UI::Xaml; -using namespace Windows::UI::Xaml::Controls; -using namespace Windows::UI::Xaml::Controls::Primitives; -using namespace Windows::UI::Xaml::Data; -using namespace Windows::UI::Xaml::Input; -using namespace Windows::UI::Xaml::Media; -using namespace Windows::UI::Xaml::Navigation; - -void OperatorTextBox::OnApplyTemplate() -{ - this->IsEnabled = false; - this->IsHitTestVisible = false; - this->IsTapEnabled = false; - this->MaxLength = 50; - this->IsReadOnly = true; - this->IsRightTapEnabled = false; - this->IsTabStop = false; - auto parent = VisualTreeHelper::GetParent(this); - ListViewItem^ listViewItem; - ListView^ listView; - while (parent != nullptr) - { - if (listViewItem == nullptr) - { - listViewItem = dynamic_cast(parent); - } - - listView = dynamic_cast(parent); - if (listView != nullptr) - { - break; - } - parent = VisualTreeHelper::GetParent(parent); - } - - if (listView != nullptr) - { - listViewItem->IsEnabled = false; - listViewItem->IsHitTestVisible = false; - listViewItem->IsTapEnabled = false; - } - TextBox::OnApplyTemplate(); -} diff --git a/src/Calculator/Controls/OperatorTextBox.h b/src/Calculator/Controls/OperatorTextBox.h deleted file mode 100644 index db92c46e..00000000 --- a/src/Calculator/Controls/OperatorTextBox.h +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#pragma once - -namespace CalculatorApp -{ - namespace Controls - { - public ref class OperatorTextBox sealed : public Windows::UI::Xaml::Controls::TextBox - { - public: - OperatorTextBox() { } - - protected: - virtual void OnApplyTemplate() override; - }; - } -} diff --git a/src/Calculator/Views/Calculator.xaml b/src/Calculator/Views/Calculator.xaml index 01164b83..91a945db 100644 --- a/src/Calculator/Views/Calculator.xaml +++ b/src/Calculator/Views/Calculator.xaml @@ -36,106 +36,7 @@ - - - - - +