Removed AppBar, OperatorTextBox and OperandTextBox controls (#440)
Fixes #407 Removed AppBar, OperatorTextBox and OperandTextBox controls
This commit is contained in:
committed by
Daniel Belcher
parent
7a7ceb5888
commit
c150cd4ece
@@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@@ -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<ListViewItem^>(parent);
|
||||
}
|
||||
|
||||
listView = dynamic_cast<ListView^>(parent);
|
||||
if (listView != nullptr)
|
||||
{
|
||||
break;
|
||||
}
|
||||
parent = VisualTreeHelper::GetParent(parent);
|
||||
}
|
||||
|
||||
if (listView != nullptr)
|
||||
{
|
||||
listViewItem->IsEnabled = false;
|
||||
listViewItem->IsHitTestVisible = false;
|
||||
listViewItem->IsTapEnabled = false;
|
||||
}
|
||||
TextBox::OnApplyTemplate();
|
||||
}
|
@@ -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;
|
||||
};
|
||||
}
|
||||
}
|
@@ -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<ListViewItem^>(parent);
|
||||
}
|
||||
|
||||
listView = dynamic_cast<ListView^>(parent);
|
||||
if (listView != nullptr)
|
||||
{
|
||||
break;
|
||||
}
|
||||
parent = VisualTreeHelper::GetParent(parent);
|
||||
}
|
||||
|
||||
if (listView != nullptr)
|
||||
{
|
||||
listViewItem->IsEnabled = false;
|
||||
listViewItem->IsHitTestVisible = false;
|
||||
listViewItem->IsTapEnabled = false;
|
||||
}
|
||||
TextBox::OnApplyTemplate();
|
||||
}
|
@@ -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;
|
||||
};
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user